Skip to content

Commit

Permalink
take into account primitives
Browse files Browse the repository at this point in the history
Signed-off-by: miguel-vila <[email protected]>
  • Loading branch information
miguel-vila committed Sep 19, 2024
1 parent 69ba6dd commit 0652c5d
Show file tree
Hide file tree
Showing 40 changed files with 358 additions and 206 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,16 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupAcknowle
}

public int hashCode() {
return Objects.hash(this.acknowledged);
int result = 17;
result = 31 * result + Boolean.hashCode(this.acknowledged);
return result;
}

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
AcknowledgedResponseBase other = (AcknowledgedResponseBase) o;
if (!this.acknowledged().equals(other.acknowledged())) {
if (this.acknowledged() != other.acknowledged()) {
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,14 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupBaseNode
}

public int hashCode() {
return Objects.hash(this.attributes, this.host, this.ip, this.name, this.roles, this.transportAddress);
int result = 17;
result = 31 * result + (attributes != null ? this.attributes.hashCode() : 0);
result = 31 * result + (host != null ? this.host.hashCode() : 0);
result = 31 * result + (ip != null ? this.ip.hashCode() : 0);
result = 31 * result + this.name.hashCode();
result = 31 * result + (roles != null ? this.roles.hashCode() : 0);
result = 31 * result + (transportAddress != null ? this.transportAddress.hashCode() : 0);
return result;
}

public boolean equals(Object o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,15 @@ protected static void setupBulkByScrollFailureDeserializer(ObjectDeserializer<Bu
}

public int hashCode() {
return Objects.hash(this.cause, this.id, this.index, this.node, this.reason, this.shard, this.status);
int result = 17;
result = 31 * result + (cause != null ? this.cause.hashCode() : 0);
result = 31 * result + (id != null ? this.id.hashCode() : 0);
result = 31 * result + (index != null ? this.index.hashCode() : 0);
result = 31 * result + (node != null ? this.node.hashCode() : 0);
result = 31 * result + (reason != null ? this.reason.hashCode() : 0);
result = 31 * result + (shard != null ? Integer.hashCode(this.shard) : 0);
result = 31 * result + Integer.hashCode(this.status);
return result;
}

public boolean equals(Object o) {
Expand All @@ -337,10 +345,10 @@ public boolean equals(Object o) {
if (!this.reason().equals(other.reason())) {
return false;
}
if (!this.shard().equals(other.shard())) {
if (this.shard() != other.shard()) {
return false;
}
if (!this.status().equals(other.status())) {
if (this.status() != other.status()) {
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -616,52 +616,52 @@ protected static void setupBulkByScrollTaskStatusDeserializer(ObjectDeserializer
}

public int hashCode() {
return Objects.hash(
this.batches,
this.canceled,
this.created,
this.deleted,
this.noops,
this.requestsPerSecond,
this.retries,
this.sliceId,
this.slices,
this.throttled,
this.throttledMillis,
this.throttledUntil,
this.throttledUntilMillis,
this.total,
this.updated,
this.versionConflicts
);
int result = 17;
result = 31 * result + Integer.hashCode(this.batches);
result = 31 * result + (canceled != null ? this.canceled.hashCode() : 0);
result = 31 * result + (created != null ? Long.hashCode(this.created) : 0);
result = 31 * result + Long.hashCode(this.deleted);
result = 31 * result + Long.hashCode(this.noops);
result = 31 * result + Float.hashCode(this.requestsPerSecond);
result = 31 * result + this.retries.hashCode();
result = 31 * result + (sliceId != null ? Integer.hashCode(this.sliceId) : 0);
result = 31 * result + (slices != null ? this.slices.hashCode() : 0);
result = 31 * result + (throttled != null ? this.throttled.hashCode() : 0);
result = 31 * result + Long.hashCode(this.throttledMillis);
result = 31 * result + (throttledUntil != null ? this.throttledUntil.hashCode() : 0);
result = 31 * result + Long.hashCode(this.throttledUntilMillis);
result = 31 * result + Long.hashCode(this.total);
result = 31 * result + (updated != null ? Long.hashCode(this.updated) : 0);
result = 31 * result + Long.hashCode(this.versionConflicts);
return result;
}

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
BulkByScrollTaskStatus other = (BulkByScrollTaskStatus) o;
if (!this.batches().equals(other.batches())) {
if (this.batches() != other.batches()) {
return false;
}
if (!this.canceled().equals(other.canceled())) {
return false;
}
if (!this.created().equals(other.created())) {
if (this.created() != other.created()) {
return false;
}
if (!this.deleted().equals(other.deleted())) {
if (this.deleted() != other.deleted()) {
return false;
}
if (!this.noops().equals(other.noops())) {
if (this.noops() != other.noops()) {
return false;
}
if (!this.requestsPerSecond().equals(other.requestsPerSecond())) {
if (this.requestsPerSecond() != other.requestsPerSecond()) {
return false;
}
if (!this.retries().equals(other.retries())) {
return false;
}
if (!this.sliceId().equals(other.sliceId())) {
if (this.sliceId() != other.sliceId()) {
return false;
}
if (!this.slices().equals(other.slices())) {
Expand All @@ -670,22 +670,22 @@ public boolean equals(Object o) {
if (!this.throttled().equals(other.throttled())) {
return false;
}
if (!this.throttledMillis().equals(other.throttledMillis())) {
if (this.throttledMillis() != other.throttledMillis()) {
return false;
}
if (!this.throttledUntil().equals(other.throttledUntil())) {
return false;
}
if (!this.throttledUntilMillis().equals(other.throttledUntilMillis())) {
if (this.throttledUntilMillis() != other.throttledUntilMillis()) {
return false;
}
if (!this.total().equals(other.total())) {
if (this.total() != other.total()) {
return false;
}
if (!this.updated().equals(other.updated())) {
if (this.updated() != other.updated()) {
return false;
}
if (!this.versionConflicts().equals(other.versionConflicts())) {
if (this.versionConflicts() != other.versionConflicts()) {
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,15 @@ protected static void setupErrorCauseDeserializer(ObjectDeserializer<ErrorCause.
}

public int hashCode() {
return Objects.hash(this.causedBy, this.reason, this.rootCause, this.stackTrace, this.suppressed, this.type, this.metadata);
int result = 17;
result = 31 * result + (causedBy != null ? this.causedBy.hashCode() : 0);
result = 31 * result + (reason != null ? this.reason.hashCode() : 0);
result = 31 * result + (rootCause != null ? this.rootCause.hashCode() : 0);
result = 31 * result + (stackTrace != null ? this.stackTrace.hashCode() : 0);
result = 31 * result + (suppressed != null ? this.suppressed.hashCode() : 0);
result = 31 * result + this.type.hashCode();
result = 31 * result + (metadata != null ? this.metadata.hashCode() : 0);
return result;
}

public boolean equals(Object o) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,23 +257,28 @@ protected static void setupNodeStatisticsDeserializer(ObjectDeserializer<NodeSta
}

public int hashCode() {
return Objects.hash(this.failed, this.failures, this.successful, this.total);
int result = 17;
result = 31 * result + Integer.hashCode(this.failed);
result = 31 * result + (failures != null ? this.failures.hashCode() : 0);
result = 31 * result + Integer.hashCode(this.successful);
result = 31 * result + Integer.hashCode(this.total);
return result;
}

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
NodeStatistics other = (NodeStatistics) o;
if (!this.failed().equals(other.failed())) {
if (this.failed() != other.failed()) {
return false;
}
if (!this.failures().equals(other.failures())) {
return false;
}
if (!this.successful().equals(other.successful())) {
if (this.successful() != other.successful()) {
return false;
}
if (!this.total().equals(other.total())) {
if (this.total() != other.total()) {
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,18 +353,18 @@ protected static void setupOpenSearchVersionInfoDeserializer(ObjectDeserializer<
}

public int hashCode() {
return Objects.hash(
this.buildDate,
this.buildFlavor,
this.buildHash,
this.buildSnapshot,
this.buildType,
this.distribution,
this.luceneVersion,
this.minimumIndexCompatibilityVersion,
this.minimumWireCompatibilityVersion,
this.number
);
int result = 17;
result = 31 * result + this.buildDate.hashCode();
result = 31 * result + (buildFlavor != null ? this.buildFlavor.hashCode() : 0);
result = 31 * result + this.buildHash.hashCode();
result = 31 * result + Boolean.hashCode(this.buildSnapshot);
result = 31 * result + this.buildType.hashCode();
result = 31 * result + this.distribution.hashCode();
result = 31 * result + this.luceneVersion.hashCode();
result = 31 * result + this.minimumIndexCompatibilityVersion.hashCode();
result = 31 * result + this.minimumWireCompatibilityVersion.hashCode();
result = 31 * result + this.number.hashCode();
return result;
}

public boolean equals(Object o) {
Expand All @@ -380,7 +380,7 @@ public boolean equals(Object o) {
if (!this.buildHash().equals(other.buildHash())) {
return false;
}
if (!this.buildSnapshot().equals(other.buildSnapshot())) {
if (this.buildSnapshot() != other.buildSnapshot()) {
return false;
}
if (!this.buildType().equals(other.buildType())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,20 @@ protected static void setupRetriesDeserializer(ObjectDeserializer<Retries.Builde
}

public int hashCode() {
return Objects.hash(this.bulk, this.search);
int result = 17;
result = 31 * result + Long.hashCode(this.bulk);
result = 31 * result + Long.hashCode(this.search);
return result;
}

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
Retries other = (Retries) o;
if (!this.bulk().equals(other.bulk())) {
if (this.bulk() != other.bulk()) {
return false;
}
if (!this.search().equals(other.search())) {
if (this.search() != other.search()) {
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,13 @@ protected static void setupShardFailureDeserializer(ObjectDeserializer<ShardFail
}

public int hashCode() {
return Objects.hash(this.index, this.node, this.reason, this.shard, this.status);
int result = 17;
result = 31 * result + (index != null ? this.index.hashCode() : 0);
result = 31 * result + (node != null ? this.node.hashCode() : 0);
result = 31 * result + this.reason.hashCode();
result = 31 * result + Integer.hashCode(this.shard);
result = 31 * result + (status != null ? this.status.hashCode() : 0);
return result;
}

public boolean equals(Object o) {
Expand All @@ -263,7 +269,7 @@ public boolean equals(Object o) {
if (!this.reason().equals(other.reason())) {
return false;
}
if (!this.shard().equals(other.shard())) {
if (this.shard() != other.shard()) {
return false;
}
if (!this.status().equals(other.status())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,26 +265,32 @@ protected static void setupShardStatisticsDeserializer(ObjectDeserializer<ShardS
}

public int hashCode() {
return Objects.hash(this.failed, this.failures, this.skipped, this.successful, this.total);
int result = 17;
result = 31 * result + Integer.hashCode(this.failed);
result = 31 * result + (failures != null ? this.failures.hashCode() : 0);
result = 31 * result + (skipped != null ? Integer.hashCode(this.skipped) : 0);
result = 31 * result + Integer.hashCode(this.successful);
result = 31 * result + Integer.hashCode(this.total);
return result;
}

public boolean equals(Object o) {
if (this == o) return true;
if (this.getClass() != o.getClass()) return false;
ShardStatistics other = (ShardStatistics) o;
if (!this.failed().equals(other.failed())) {
if (this.failed() != other.failed()) {
return false;
}
if (!this.failures().equals(other.failures())) {
return false;
}
if (!this.skipped().equals(other.skipped())) {
if (this.skipped() != other.skipped()) {
return false;
}
if (!this.successful().equals(other.successful())) {
if (this.successful() != other.successful()) {
return false;
}
if (!this.total().equals(other.total())) {
if (this.total() != other.total()) {
return false;
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ protected static void setupTaskFailureDeserializer(ObjectDeserializer<TaskFailur
}

public int hashCode() {
return Objects.hash(this.nodeId, this.reason, this.status, this.taskId);
int result = 17;
result = 31 * result + this.nodeId.hashCode();
result = 31 * result + this.reason.hashCode();
result = 31 * result + this.status.hashCode();
result = 31 * result + Integer.hashCode(this.taskId);
return result;
}

public boolean equals(Object o) {
Expand All @@ -224,7 +229,7 @@ public boolean equals(Object o) {
if (!this.status().equals(other.status())) {
return false;
}
if (!this.taskId().equals(other.taskId())) {
if (this.taskId() != other.taskId()) {
return false;
}
return true;
Expand Down
Loading

0 comments on commit 0652c5d

Please sign in to comment.