Skip to content

Commit

Permalink
Add @Override to equals & hashCode (opensearch-project#1249)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
(cherry picked from commit 282f415)
  • Loading branch information
Xtansia committed Oct 31, 2024
1 parent 49ff1f0 commit 8512bbe
Show file tree
Hide file tree
Showing 41 changed files with 78 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ protected static void setupErrorCauseDeserializer(ObjectDeserializer<ErrorCause.
});
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.causedBy);
Expand All @@ -427,6 +428,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ protected static void setupShardFailureDeserializer(ObjectDeserializer<ShardFail
op.add(Builder::status, JsonpDeserializer.stringDeserializer(), "status");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.index);
Expand All @@ -260,6 +261,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ protected static void setupShardStatisticsDeserializer(ObjectDeserializer<ShardS
op.add(Builder::total, JsonpDeserializer.numberDeserializer(), "total");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.failed.hashCode();
Expand All @@ -284,6 +285,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupWriteRes
op.add(AbstractBuilder::version, JsonpDeserializer.longDeserializer(), "_version");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.forcedRefresh);
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ protected static void setupActionDeserializer(ObjectDeserializer<Action.Builder>
op.add(Builder::url, JsonpDeserializer.stringDeserializer(), "url");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.actionType);
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ protected static void setupClientConfigDeserializer(ObjectDeserializer<ClientCon
op.add(Builder::retryTimeoutSeconds, JsonpDeserializer.integerDeserializer(), "retry_timeout_seconds");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.connectionTimeout);
Expand All @@ -293,6 +294,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ protected static void setupCreateConnectorRequestDeserializer(ObjectDeserializer
CreateConnectorResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.actions.hashCode();
Expand All @@ -393,6 +394,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ protected static void setupCreateConnectorResponseDeserializer(ObjectDeserialize
op.add(Builder::connectorId, JsonpDeserializer.stringDeserializer(), "connector_id");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.connectorId);
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ protected static void setupCredentialDeserializer(ObjectDeserializer<Credential.
});
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.accessKey);
Expand All @@ -228,6 +229,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ public DeleteAgentRequest build() {
DeleteAgentResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.agentId.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ protected static void setupDeleteAgentResponseDeserializer(ObjectDeserializer<De
setupWriteResponseBaseDeserializer(op);
}

@Override
public int hashCode() {
int result = super.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (!super.equals(o)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ public DeleteConnectorRequest build() {
DeleteConnectorResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.connectorId.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ protected static void setupDeleteConnectorResponseDeserializer(ObjectDeserialize
setupWriteResponseBaseDeserializer(op);
}

@Override
public int hashCode() {
int result = super.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (!super.equals(o)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ public DeleteModelGroupRequest build() {
DeleteModelGroupResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.modelGroupId.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ protected static void setupDeleteModelGroupResponseDeserializer(ObjectDeserializ
setupWriteResponseBaseDeserializer(op);
}

@Override
public int hashCode() {
int result = super.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (!super.equals(o)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ public DeleteModelRequest build() {
DeleteModelResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.modelId.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ protected static void setupDeleteModelResponseDeserializer(ObjectDeserializer<De
setupWriteResponseBaseDeserializer(op);
}

@Override
public int hashCode() {
int result = super.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (!super.equals(o)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ public DeleteTaskRequest build() {
DeleteTaskResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.taskId.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,13 @@ protected static void setupDeleteTaskResponseDeserializer(ObjectDeserializer<Del
setupWriteResponseBaseDeserializer(op);
}

@Override
public int hashCode() {
int result = super.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (!super.equals(o)) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,14 @@ public DeployModelRequest build() {
DeployModelResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.modelId.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ protected static void setupDeployModelResponseDeserializer(ObjectDeserializer<De
op.add(Builder::taskType, JsonpDeserializer.stringDeserializer(), "task_type");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.status.hashCode();
Expand All @@ -173,6 +174,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ public GetModelGroupRequest build() {
GetModelGroupResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.modelGroupId.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ protected static void setupGetModelGroupResponseDeserializer(ObjectDeserializer<
op.add(Builder::name, JsonpDeserializer.stringDeserializer(), "name");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.access.hashCode();
Expand All @@ -276,6 +277,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,14 @@ public GetTaskRequest build() {
GetTaskResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.taskId.hashCode();
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,7 @@ protected static void setupGetTaskResponseDeserializer(ObjectDeserializer<GetTas
);
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.createTime);
Expand All @@ -414,6 +415,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,15 @@ protected static void setupHeadersDeserializer(ObjectDeserializer<Headers.Builde
});
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.contentType);
result = 31 * result + Objects.hashCode(this.metadata);
return result;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || this.getClass() != o.getClass()) return false;
Expand Down
Loading

0 comments on commit 8512bbe

Please sign in to comment.