-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: miguel-vila <[email protected]>
- Loading branch information
1 parent
0652c5d
commit 3e1dfa8
Showing
11 changed files
with
48 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions
22
...en/src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/Equals.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
27 changes: 11 additions & 16 deletions
27
.../src/main/resources/org/opensearch/client/codegen/templates/ObjectShape/HashCode.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |