Skip to content

Commit

Permalink
Add @Override to equals & hashCode
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Oct 16, 2024
1 parent db2c9a0 commit afb4e70
Show file tree
Hide file tree
Showing 106 changed files with 208 additions and 0 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 @@ -109,12 +109,14 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupIndicesR
op.add(AbstractBuilder::shards, ShardStatistics._DESERIALIZER, "_shards");
}

@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + Objects.hashCode(this.shards);
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 @@ -225,6 +225,7 @@ protected static void setupInlineScriptDeserializer(ObjectDeserializer<InlineScr
op.shortcutProperty("source");
}

@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + Objects.hashCode(this.lang);
Expand All @@ -233,6 +234,7 @@ public int 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 @@ -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 @@ -170,13 +170,15 @@ private static JsonpDeserializer<Script> buildScriptDeserializer() {

public static final JsonpDeserializer<Script> _DESERIALIZER = JsonpDeserializer.lazy(Script::buildScriptDeserializer);

@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 @@ -145,12 +145,14 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupScriptBa
op.add(AbstractBuilder::params, JsonpDeserializer.stringMapDeserializer(JsonData._DESERIALIZER), "params");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.params);
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 @@ -182,13 +182,15 @@ private static JsonpDeserializer<ScriptLanguage> buildScriptLanguageDeserializer
ScriptLanguage::buildScriptLanguageDeserializer
);

@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 @@ -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 @@ -130,12 +130,14 @@ protected static void setupStoredScriptIdDeserializer(ObjectDeserializer<StoredS
op.add(Builder::id, JsonpDeserializer.stringDeserializer(), "id");
}

@Override
public int hashCode() {
int result = super.hashCode();
result = 31 * result + this.id.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 @@ -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 @@ -182,13 +182,15 @@ private static JsonpDeserializer<WaitForActiveShards> buildWaitForActiveShardsDe
WaitForActiveShards::buildWaitForActiveShardsDeserializer
);

@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 @@ -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 @@ -345,6 +345,7 @@ protected static void setupAllFieldDeserializer(ObjectDeserializer<AllField.Buil
op.add(Builder::storeTermVectors, JsonpDeserializer.booleanDeserializer(), "store_term_vectors");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + this.analyzer.hashCode();
Expand All @@ -360,6 +361,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 @@ -131,12 +131,14 @@ protected static void setupDataStreamTimestampDeserializer(ObjectDeserializer<Da
op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Boolean.hashCode(this.enabled);
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 @@ -312,6 +312,7 @@ protected static void setupDynamicTemplateDeserializer(ObjectDeserializer<Dynami
op.add(Builder::unmatch, JsonpDeserializer.stringDeserializer(), "unmatch");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.mapping);
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,14 @@ protected static void setupFieldNamesFieldDeserializer(ObjectDeserializer<FieldN
op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Boolean.hashCode(this.enabled);
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 @@ -131,12 +131,14 @@ protected static void setupIndexFieldDeserializer(ObjectDeserializer<IndexField.
op.add(Builder::enabled, JsonpDeserializer.booleanDeserializer(), "enabled");
}

@Override
public int hashCode() {
int result = 17;
result = 31 * result + Boolean.hashCode(this.enabled);
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 afb4e70

Please sign in to comment.