From 282f415304b6434565eab424ef5c17ec785615a6 Mon Sep 17 00:00:00 2001 From: Thomas Farr Date: Thu, 24 Oct 2024 09:39:19 +1300 Subject: [PATCH] Add `@Override` to equals & hashCode (#1249) Signed-off-by: Thomas Farr --- .../_types/AcknowledgedResponseBase.java | 2 + .../client/opensearch/_types/BaseNode.java | 2 + .../_types/BulkByScrollFailure.java | 2 + .../_types/BulkByScrollTaskStatus.java | 2 + .../BulkByScrollTaskStatusOrException.java | 2 + .../client/opensearch/_types/ErrorCause.java | 2 + .../opensearch/_types/NodeStatistics.java | 2 + .../_types/OpenSearchVersionInfo.java | 2 + .../client/opensearch/_types/Retries.java | 2 + .../opensearch/_types/ShardFailure.java | 2 + .../opensearch/_types/ShardStatistics.java | 2 + .../client/opensearch/_types/TaskFailure.java | 2 + .../opensearch/_types/WriteResponseBase.java | 2 + .../client/opensearch/core/InfoRequest.java | 2 + .../client/opensearch/core/InfoResponse.java | 2 + .../DeleteDanglingIndexRequest.java | 2 + .../DeleteDanglingIndexResponse.java | 2 + .../ImportDanglingIndexRequest.java | 2 + .../ImportDanglingIndexResponse.java | 2 + .../ListDanglingIndicesRequest.java | 2 + .../ListDanglingIndicesResponse.java | 2 + .../list_dangling_indices/DanglingIndex.java | 2 + .../client/opensearch/ml/Action.java | 2 + .../client/opensearch/ml/ClientConfig.java | 2 + .../opensearch/ml/CreateConnectorRequest.java | 2 + .../ml/CreateConnectorResponse.java | 2 + .../client/opensearch/ml/Credential.java | 2 + .../opensearch/ml/DeleteAgentRequest.java | 2 + .../opensearch/ml/DeleteAgentResponse.java | 2 + .../opensearch/ml/DeleteConnectorRequest.java | 2 + .../ml/DeleteConnectorResponse.java | 2 + .../ml/DeleteModelGroupRequest.java | 2 + .../ml/DeleteModelGroupResponse.java | 2 + .../opensearch/ml/DeleteModelRequest.java | 2 + .../opensearch/ml/DeleteModelResponse.java | 2 + .../opensearch/ml/DeleteTaskRequest.java | 2 + .../opensearch/ml/DeleteTaskResponse.java | 2 + .../opensearch/ml/DeployModelRequest.java | 2 + .../opensearch/ml/DeployModelResponse.java | 2 + .../opensearch/ml/GetModelGroupRequest.java | 2 + .../opensearch/ml/GetModelGroupResponse.java | 2 + .../client/opensearch/ml/GetTaskRequest.java | 2 + .../client/opensearch/ml/GetTaskResponse.java | 2 + .../client/opensearch/ml/Headers.java | 2 + .../opensearch/client/opensearch/ml/LLM.java | 2 + .../client/opensearch/ml/Memory.java | 2 + .../opensearch/ml/RegisterAgentsRequest.java | 2 + .../opensearch/ml/RegisterAgentsResponse.java | 2 + .../ml/RegisterModelGroupRequest.java | 2 + .../ml/RegisterModelGroupResponse.java | 2 + .../opensearch/ml/RegisterModelRequest.java | 2 + .../opensearch/ml/RegisterModelResponse.java | 2 + .../client/opensearch/ml/ToolItems.java | 2 + .../opensearch/ml/UndeployModelNode.java | 2 + .../opensearch/ml/UndeployModelRequest.java | 2 + .../snapshot/CleanupRepositoryRequest.java | 2 + .../snapshot/CleanupRepositoryResponse.java | 2 + .../snapshot/CloneSnapshotRequest.java | 2 + .../snapshot/CloneSnapshotResponse.java | 2 + .../snapshot/VerifyRepositoryRequest.java | 2 + .../snapshot/VerifyRepositoryResponse.java | 2 + .../CleanupRepositoryResults.java | 2 + .../verify_repository/CompactNodeInfo.java | 2 + .../opensearch/tasks/CancelRequest.java | 2 + .../opensearch/tasks/CancelResponse.java | 2 + .../opensearch/tasks/GetTasksRequest.java | 2 + .../opensearch/tasks/GetTasksResponse.java | 2 + .../client/opensearch/tasks/ListRequest.java | 2 + .../client/opensearch/tasks/ListResponse.java | 2 + .../client/opensearch/tasks/Status.java | 2 + .../opensearch/tasks/TaskExecutingNode.java | 2 + .../client/opensearch/tasks/TaskGroup.java | 2 + .../client/opensearch/tasks/TaskInfo.java | 2 + .../client/opensearch/tasks/TaskInfos.java | 2 + .../tasks/TaskListResponseBase.java | 2 + .../client/opensearch/tasks/TaskResponse.java | 2 + java-codegen/opensearch-openapi.yaml | 609 +++++++++--------- .../templates/ObjectShape/Equals.mustache | 1 + .../templates/ObjectShape/HashCode.mustache | 1 + .../TaggedUnionShape/Equals.mustache | 1 + .../TaggedUnionShape/HashCode.mustache | 1 + 81 files changed, 474 insertions(+), 291 deletions(-) diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java index 13e2183302..ceb941a151 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/AcknowledgedResponseBase.java @@ -110,12 +110,14 @@ protected static > void setupAcknowle op.add(AbstractBuilder::acknowledged, JsonpDeserializer.booleanDeserializer(), "acknowledged"); } + @Override public int hashCode() { int result = 17; result = 31 * result + Boolean.hashCode(this.acknowledged); return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java index bcc2b4cf99..ef07e83910 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BaseNode.java @@ -290,6 +290,7 @@ protected static > void setupBaseNode op.add(AbstractBuilder::transportAddress, JsonpDeserializer.stringDeserializer(), "transport_address"); } + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.attributes); @@ -301,6 +302,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java index 861e1f9a1e..66578fe695 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/BulkByScrollFailure.java @@ -315,6 +315,7 @@ protected static void setupBulkByScrollFailureDeserializer(ObjectDeserializer buildBulkByS BulkByScrollTaskStatusOrException::buildBulkByScrollTaskStatusOrExceptionDeserializer ); + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this._kind); @@ -187,6 +188,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java index 97f899eb8c..912a69c5c9 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/_types/ErrorCause.java @@ -415,6 +415,7 @@ protected static void setupErrorCauseDeserializer(ObjectDeserializer> void setupWriteRes op.add(AbstractBuilder::version, JsonpDeserializer.longDeserializer(), "_version"); } + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.forcedRefresh); @@ -301,6 +302,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java index 63f0b50600..f2753f32fa 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoRequest.java @@ -73,11 +73,13 @@ public InfoRequest() {} InfoResponse._DESERIALIZER ); + @Override public int hashCode() { int result = 17; return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoResponse.java index 36fec1ee30..d340007675 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/core/InfoResponse.java @@ -242,6 +242,7 @@ protected static void setupInfoResponseDeserializer(ObjectDeserializer op.add(Builder::url, JsonpDeserializer.stringDeserializer(), "url"); } + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.actionType); @@ -300,6 +301,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java index bd03b5ec22..9e1be3d3c8 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/ClientConfig.java @@ -281,6 +281,7 @@ protected static void setupClientConfigDeserializer(ObjectDeserializer op) { op.add(Builder::parameters, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "parameters"); } + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.modelId); @@ -170,6 +171,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java index 0660178e13..83bda00de2 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/Memory.java @@ -113,12 +113,14 @@ protected static void setupMemoryDeserializer(ObjectDeserializer op.add(Builder::type, JsonpDeserializer.stringDeserializer(), "type"); } + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.type); return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java index 2c2e560a6d..4e5c31c555 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsRequest.java @@ -397,6 +397,7 @@ protected static void setupRegisterAgentsRequestDeserializer(ObjectDeserializer< RegisterAgentsResponse._DESERIALIZER ); + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.appType); @@ -410,6 +411,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java index b15475a2aa..816fe2cf91 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterAgentsResponse.java @@ -113,12 +113,14 @@ protected static void setupRegisterAgentsResponseDeserializer(ObjectDeserializer op.add(Builder::agentId, JsonpDeserializer.stringDeserializer(), "agent_id"); } + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.agentId); return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java index e7bc41bb13..fc1b736361 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupRequest.java @@ -301,6 +301,7 @@ protected static void setupRegisterModelGroupRequestDeserializer(ObjectDeseriali RegisterModelGroupResponse._DESERIALIZER ); + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.accessMode); @@ -311,6 +312,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java index ac99154507..3b0faba22c 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelGroupResponse.java @@ -149,6 +149,7 @@ protected static void setupRegisterModelGroupResponseDeserializer(ObjectDeserial op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status"); } + @Override public int hashCode() { int result = 17; result = 31 * result + this.modelGroupId.hashCode(); @@ -156,6 +157,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java index 5261601622..ac004ddd21 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/ml/RegisterModelRequest.java @@ -271,6 +271,7 @@ protected static void setupRegisterModelRequestDeserializer(ObjectDeserializer }); } + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.batches); @@ -796,6 +797,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java index 563a74ea7a..9a8ed67e25 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskExecutingNode.java @@ -164,12 +164,14 @@ protected static void setupTaskExecutingNodeDeserializer(ObjectDeserializer> void setupTaskInfo op.add(AbstractBuilder::type, JsonpDeserializer.stringDeserializer(), "type"); } + @Override public int hashCode() { int result = 17; result = 31 * result + this.action.hashCode(); @@ -507,6 +508,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfos.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfos.java index 4bf5585791..e451ade16d 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfos.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskInfos.java @@ -183,6 +183,7 @@ private static JsonpDeserializer buildTaskInfosDeserializer() { public static final JsonpDeserializer _DESERIALIZER = JsonpDeserializer.lazy(TaskInfos::buildTaskInfosDeserializer); + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this._kind); @@ -190,6 +191,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java index fee4a80485..aab6b1618f 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskListResponseBase.java @@ -315,6 +315,7 @@ protected static > void setupTaskList op.add(AbstractBuilder::tasks, TaskInfos._DESERIALIZER, "tasks"); } + @Override public int hashCode() { int result = 17; result = 31 * result + Objects.hashCode(this.nodeFailures); @@ -324,6 +325,7 @@ public int hashCode() { return result; } + @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || this.getClass() != o.getClass()) return false; diff --git a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java index 6b75a33c7d..fecdd4e742 100644 --- a/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java +++ b/java-client/src/generated/java/org/opensearch/client/opensearch/tasks/TaskResponse.java @@ -725,6 +725,7 @@ protected static void setupTaskResponseDeserializer(ObjectDeserializer