Skip to content

Commit

Permalink
refactor and format
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 0652c5d commit 3e1dfa8
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ public int hashCode() {
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.shard);
result = 31 * result + Integer.hashCode(this.status);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,19 +619,19 @@ public int hashCode() {
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.created);
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 + Integer.hashCode(this.sliceId);
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.updated);
result = 31 * result + Long.hashCode(this.versionConflicts);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public int hashCode() {
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.skipped);
result = 31 * result + Integer.hashCode(this.successful);
result = 31 * result + Integer.hashCode(this.total);
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupWriteRes

public int hashCode() {
int result = 17;
result = 31 * result + (forcedRefresh != null ? Boolean.hashCode(this.forcedRefresh) : 0);
result = 31 * result + Boolean.hashCode(this.forcedRefresh);
result = 31 * result + this.id.hashCode();
result = 31 * result + this.index.hashCode();
result = 31 * result + Long.hashCode(this.primaryTerm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ protected static void setupGetModelGroupResponseDeserializer(ObjectDeserializer<
public int hashCode() {
int result = 17;
result = 31 * result + this.access.hashCode();
result = 31 * result + (createdTime != null ? Long.hashCode(this.createdTime) : 0);
result = 31 * result + Long.hashCode(this.createdTime);
result = 31 * result + this.description.hashCode();
result = 31 * result + (lastUpdatedTime != null ? Long.hashCode(this.lastUpdatedTime) : 0);
result = 31 * result + Long.hashCode(this.lastUpdatedTime);
result = 31 * result + Integer.hashCode(this.latestVersion);
result = 31 * result + this.name.hashCode();
return result;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,11 @@ protected static void setupGetTaskResponseDeserializer(ObjectDeserializer<GetTas

public int hashCode() {
int result = 17;
result = 31 * result + (createTime != null ? Long.hashCode(this.createTime) : 0);
result = 31 * result + Long.hashCode(this.createTime);
result = 31 * result + (error != null ? this.error.hashCode() : 0);
result = 31 * result + (functionName != null ? this.functionName.hashCode() : 0);
result = 31 * result + (isAsync != null ? Boolean.hashCode(this.isAsync) : 0);
result = 31 * result + (lastUpdateTime != null ? Long.hashCode(this.lastUpdateTime) : 0);
result = 31 * result + Boolean.hashCode(this.isAsync);
result = 31 * result + Long.hashCode(this.lastUpdateTime);
result = 31 * result + (modelId != null ? this.modelId.hashCode() : 0);
result = 31 * result + this.state.hashCode();
result = 31 * result + (taskId != null ? this.taskId.hashCode() : 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,24 +770,24 @@ protected static void setupStatusDeserializer(ObjectDeserializer<Status.Builder>

public int hashCode() {
int result = 17;
result = 31 * result + (batches != null ? Integer.hashCode(this.batches) : 0);
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 + (deleted != null ? Long.hashCode(this.deleted) : 0);
result = 31 * result + (noops != null ? Long.hashCode(this.noops) : 0);
result = 31 * result + Long.hashCode(this.created);
result = 31 * result + Long.hashCode(this.deleted);
result = 31 * result + Long.hashCode(this.noops);
result = 31 * result + (phase != null ? this.phase.hashCode() : 0);
result = 31 * result + (requestsPerSecond != null ? Float.hashCode(this.requestsPerSecond) : 0);
result = 31 * result + Float.hashCode(this.requestsPerSecond);
result = 31 * result + (retries != null ? this.retries.hashCode() : 0);
result = 31 * result + (sliceId != null ? Integer.hashCode(this.sliceId) : 0);
result = 31 * result + Integer.hashCode(this.sliceId);
result = 31 * result + (slices != null ? this.slices.hashCode() : 0);
result = 31 * result + (state != null ? this.state.hashCode() : 0);
result = 31 * result + (throttled != null ? this.throttled.hashCode() : 0);
result = 31 * result + (throttledMillis != null ? Long.hashCode(this.throttledMillis) : 0);
result = 31 * result + Long.hashCode(this.throttledMillis);
result = 31 * result + (throttledUntil != null ? this.throttledUntil.hashCode() : 0);
result = 31 * result + (throttledUntilMillis != null ? Long.hashCode(this.throttledUntilMillis) : 0);
result = 31 * result + (total != null ? Long.hashCode(this.total) : 0);
result = 31 * result + (updated != null ? Long.hashCode(this.updated) : 0);
result = 31 * result + (versionConflicts != null ? Long.hashCode(this.versionConflicts) : 0);
result = 31 * result + Long.hashCode(this.throttledUntilMillis);
result = 31 * result + Long.hashCode(this.total);
result = 31 * result + Long.hashCode(this.updated);
result = 31 * result + Long.hashCode(this.versionConflicts);
result = 31 * result + (metadata != null ? this.metadata.hashCode() : 0);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ public int hashCode() {
int result = 17;
result = 31 * result + this.action.hashCode();
result = 31 * result + Boolean.hashCode(this.cancellable);
result = 31 * result + (cancelled != null ? Boolean.hashCode(this.cancelled) : 0);
result = 31 * result + Boolean.hashCode(this.cancelled);
result = 31 * result + (description != null ? this.description.hashCode() : 0);
result = 31 * result + this.headers.hashCode();
result = 31 * result + Long.hashCode(this.id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -723,13 +723,13 @@ public int hashCode() {
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.created);
result = 31 * result + Long.hashCode(this.deleted);
result = 31 * result + this.failures.hashCode();
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 + Integer.hashCode(this.sliceId);
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);
Expand All @@ -738,7 +738,7 @@ public int hashCode() {
result = 31 * result + Boolean.hashCode(this.timedOut);
result = 31 * result + Long.hashCode(this.took);
result = 31 * result + Long.hashCode(this.total);
result = 31 * result + (updated != null ? Long.hashCode(this.updated) : 0);
result = 31 * result + Long.hashCode(this.updated);
result = 31 * result + Long.hashCode(this.versionConflicts);
return result;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
public boolean equals(Object o) {
{{#extendsOtherShape}}
if(!super.equals(o)) {
return false;
}
if(!super.equals(o)) {
return false;
}
{{/extendsOtherShape}}
if(this == o) return true;
if(this.getClass() != o.getClass()) return false;
{{className}} other = ({{className}})o;
{{#fields}}
{{#isUnboxedPrimitive}}
if(this.{{name}}() != other.{{name}}()) {
{{/isUnboxedPrimitive}}
{{^isUnboxedPrimitive}}
if(!this.{{name}}().equals(other.{{name}}())) {
{{/isUnboxedPrimitive}}
return false;
}
{{#isUnboxedPrimitive}}
if(this.{{name}}() != other.{{name}}()) {
{{/isUnboxedPrimitive}}
{{^isUnboxedPrimitive}}
if(!this.{{name}}().equals(other.{{name}}())) {
{{/isUnboxedPrimitive}}
return false;
}
{{/fields}}
return true;
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
public int hashCode() {
int result = 17;
{{#fields}}
{{#isRequired}}
{{^isUnboxedPrimitive}}
result = 31 * result + this.{{name}}.hashCode();
{{/isUnboxedPrimitive}}
{{#isUnboxedPrimitive}}
result = 31 * result + {{getBoxedType}}.hashCode(this.{{name}});
{{/isUnboxedPrimitive}}
{{/isRequired}}
{{^isRequired}}
{{^isUnboxedPrimitive}}
result = 31 * result + ({{name}} != null ? this.{{name}}.hashCode() : 0);
{{/isUnboxedPrimitive}}
{{#isUnboxedPrimitive}}
result = 31 * result + ({{name}} != null ? {{getBoxedType}}.hashCode(this.{{name}}) : 0);
{{/isUnboxedPrimitive}}
{{/isRequired}}
{{#isUnboxedPrimitive}}
result = 31 * result + {{getBoxedType}}.hashCode(this.{{name}});
{{/isUnboxedPrimitive}}
{{^isUnboxedPrimitive}}
{{#isRequired}}
result = 31 * result + this.{{name}}.hashCode();
{{/isRequired}}
{{^isRequired}}
result = 31 * result + ({{name}} != null ? this.{{name}}.hashCode() : 0);
{{/isRequired}}
{{/isUnboxedPrimitive}}
{{/fields}}
return result;
}

0 comments on commit 3e1dfa8

Please sign in to comment.