Skip to content

Commit

Permalink
Add @Override to equals & hashCode (#1249)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <tsfarr@amazon.com>
  • Loading branch information
Xtansia authored Oct 23, 2024
1 parent a3a3e54 commit 282f415
Show file tree
Hide file tree
Showing 81 changed files with 474 additions and 291 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,14 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> 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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupBaseNode
op.add(AbstractBuilder::transportAddress, JsonpDeserializer.stringDeserializer(), "transport_address");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.attributes);
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 @@ -315,6 +315,7 @@ protected static void setupBulkByScrollFailureDeserializer(ObjectDeserializer<Bu
op.add(Builder::status, JsonpDeserializer.integerDeserializer(), "status");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.cause);
Expand All @@ -327,6 +328,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 @@ -619,6 +619,7 @@ protected static void setupBulkByScrollTaskStatusDeserializer(ObjectDeserializer
op.add(Builder::versionConflicts, JsonpDeserializer.longDeserializer(), "version_conflicts");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Integer.hashCode(this.batches);
Expand All @@ -640,6 +641,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 @@ -180,13 +180,15 @@ private static JsonpDeserializer<BulkByScrollTaskStatusOrException> buildBulkByS
BulkByScrollTaskStatusOrException::buildBulkByScrollTaskStatusOrExceptionDeserializer
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this._kind);
result = 31 * result + Objects.hashCode(this._value);
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 @@ -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 @@ -260,6 +260,7 @@ protected static void setupNodeStatisticsDeserializer(ObjectDeserializer<NodeSta
op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Integer.hashCode(this.failed);
Expand All @@ -269,6 +270,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 @@ -370,6 +370,7 @@ protected static void setupOpenSearchVersionInfoDeserializer(ObjectDeserializer<
op.add(Builder::number, JsonpDeserializer.stringDeserializer(), "number");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.buildDate.hashCode();
Expand All @@ -385,6 +386,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 @@ -154,13 +154,15 @@ protected static void setupRetriesDeserializer(ObjectDeserializer<Retries.Builde
op.add(Builder::search, JsonpDeserializer.longDeserializer(), "search");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Long.hashCode(this.bulk);
result = 31 * result + Long.hashCode(this.search);
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 @@ -268,6 +268,7 @@ protected static void setupShardStatisticsDeserializer(ObjectDeserializer<ShardS
op.add(Builder::total, JsonpDeserializer.integerDeserializer(), "total");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Integer.hashCode(this.failed);
Expand All @@ -278,6 +279,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 @@ -214,6 +214,7 @@ protected static void setupTaskFailureDeserializer(ObjectDeserializer<TaskFailur
op.add(Builder::taskId, JsonpDeserializer.integerDeserializer(), "task_id");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.nodeId.hashCode();
Expand All @@ -223,6 +224,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 @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ protected static void setupInfoResponseDeserializer(ObjectDeserializer<InfoRespo
op.add(Builder::version, OpenSearchVersionInfo._DESERIALIZER, "version");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.clusterName.hashCode();
Expand All @@ -252,6 +253,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 @@ -295,6 +295,7 @@ public DeleteDanglingIndexRequest build() {
DeleteDanglingIndexResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Boolean.hashCode(this.acceptDataLoss);
Expand All @@ -305,6 +306,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 @@ -103,11 +103,13 @@ protected static void setupDeleteDanglingIndexResponseDeserializer(ObjectDeseria
setupAcknowledgedResponseBaseDeserializer(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 @@ -295,6 +295,7 @@ public ImportDanglingIndexRequest build() {
ImportDanglingIndexResponse._DESERIALIZER
);

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Boolean.hashCode(this.acceptDataLoss);
Expand All @@ -305,6 +306,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 @@ -103,11 +103,13 @@ protected static void setupImportDanglingIndexResponseDeserializer(ObjectDeseria
setupAcknowledgedResponseBaseDeserializer(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 @@ -73,11 +73,13 @@ public ListDanglingIndicesRequest() {}
ListDanglingIndicesResponse._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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ protected static void setupListDanglingIndicesResponseDeserializer(ObjectDeseria
op.add(Builder::nodes, NodeStatistics._DESERIALIZER, "_nodes");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.clusterName);
Expand All @@ -243,6 +244,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 @@ -258,6 +258,7 @@ protected static void setupDanglingIndexDeserializer(ObjectDeserializer<Dangling
op.add(Builder::nodeIds, JsonpDeserializer.arrayDeserializer(JsonpDeserializer.stringDeserializer()), "node_ids");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.creationDate);
Expand All @@ -268,6 +269,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
Loading

0 comments on commit 282f415

Please sign in to comment.