Skip to content

Commit 074b355

Browse files
Remove equals and hashcode from oneRequestParameter model
1 parent f88e043 commit 074b355

5 files changed

Lines changed: 0 additions & 263 deletions

File tree

modules/openapi-generator/src/main/resources/Java/libraries/restclient/api.mustache

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -83,40 +83,6 @@ public class {{classname}} {
8383
}
8484

8585
{{/allParams}}
86-
@Override
87-
public boolean equals(Object o) {
88-
{{#useReflectionEqualsHashCode}}
89-
return EqualsBuilder.reflectionEquals(this, o, false, null, true);
90-
{{/useReflectionEqualsHashCode}}
91-
{{^useReflectionEqualsHashCode}}
92-
if (this == o) {
93-
return true;
94-
}
95-
if (o == null || getClass() != o.getClass()) {
96-
return false;
97-
}{{#hasVars}}
98-
{{classname}} {{classVarName}} = ({{classname}}) o;
99-
return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} &&
100-
{{/-last}}{{/vars}}{{#additionalPropertiesType}} &&
101-
Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/additionalPropertiesType}}{{#parent}} &&
102-
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
103-
return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}}
104-
{{/useReflectionEqualsHashCode}}
105-
}{{#vendorExtensions.x-jackson-optional-nullable-helpers}}
106-
107-
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
108-
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
109-
}{{/vendorExtensions.x-jackson-optional-nullable-helpers}}
110-
111-
@Override
112-
public int hashCode() {
113-
{{#useReflectionEqualsHashCode}}
114-
return HashCodeBuilder.reflectionHashCode(this);
115-
{{/useReflectionEqualsHashCode}}
116-
{{^useReflectionEqualsHashCode}}
117-
return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}, additionalProperties{{/additionalPropertiesType}});
118-
{{/useReflectionEqualsHashCode}}
119-
}
12086
}
12187
{{/staticRequest}}
12288

modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -77,40 +77,6 @@ public class {{classname}} {
7777
}
7878

7979
{{/allParams}}
80-
@Override
81-
public boolean equals(Object o) {
82-
{{#useReflectionEqualsHashCode}}
83-
return EqualsBuilder.reflectionEquals(this, o, false, null, true);
84-
{{/useReflectionEqualsHashCode}}
85-
{{^useReflectionEqualsHashCode}}
86-
if (this == o) {
87-
return true;
88-
}
89-
if (o == null || getClass() != o.getClass()) {
90-
return false;
91-
}{{#hasVars}}
92-
{{classname}} {{classVarName}} = ({{classname}}) o;
93-
return {{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}equalsNullable(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#isByteArray}}Arrays{{/isByteArray}}{{^isByteArray}}Objects{{/isByteArray}}.equals(this.{{name}}, {{classVarName}}.{{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}} &&
94-
{{/-last}}{{/vars}}{{#additionalPropertiesType}} &&
95-
Objects.equals(this.additionalProperties, {{classVarName}}.additionalProperties){{/additionalPropertiesType}}{{#parent}} &&
96-
super.equals(o){{/parent}};{{/hasVars}}{{^hasVars}}
97-
return {{#parent}}super.equals(o){{/parent}}{{^parent}}true{{/parent}};{{/hasVars}}
98-
{{/useReflectionEqualsHashCode}}
99-
}{{#vendorExtensions.x-jackson-optional-nullable-helpers}}
100-
101-
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
102-
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
103-
}{{/vendorExtensions.x-jackson-optional-nullable-helpers}}
104-
105-
@Override
106-
public int hashCode() {
107-
{{#useReflectionEqualsHashCode}}
108-
return HashCodeBuilder.reflectionHashCode(this);
109-
{{/useReflectionEqualsHashCode}}
110-
{{^useReflectionEqualsHashCode}}
111-
return Objects.hash({{#vars}}{{#vendorExtensions.x-is-jackson-optional-nullable}}hashCodeNullable({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{^isByteArray}}{{name}}{{/isByteArray}}{{#isByteArray}}Arrays.hashCode({{name}}){{/isByteArray}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{^-last}}, {{/-last}}{{/vars}}{{#parent}}{{#hasVars}}, {{/hasVars}}super.hashCode(){{/parent}}{{#additionalPropertiesType}}, additionalProperties{{/additionalPropertiesType}});
112-
{{/useReflectionEqualsHashCode}}
113-
}
11480
}
11581

11682
/**

samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/FakeApi.java

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -228,21 +228,6 @@ public FakeHttpSignatureTestRequest header1(String header1) {
228228
return this;
229229
}
230230

231-
@Override
232-
public boolean equals(Object o) {
233-
if (this == o) {
234-
return true;
235-
}
236-
if (o == null || getClass() != o.getClass()) {
237-
return false;
238-
}
239-
return true;
240-
}
241-
242-
@Override
243-
public int hashCode() {
244-
return Objects.hash();
245-
}
246231
}
247232

248233
/**
@@ -959,21 +944,6 @@ public TestBodyWithQueryParamsRequest user(User user) {
959944
return this;
960945
}
961946

962-
@Override
963-
public boolean equals(Object o) {
964-
if (this == o) {
965-
return true;
966-
}
967-
if (o == null || getClass() != o.getClass()) {
968-
return false;
969-
}
970-
return true;
971-
}
972-
973-
@Override
974-
public int hashCode() {
975-
return Objects.hash();
976-
}
977947
}
978948

979949
/**
@@ -1313,21 +1283,6 @@ public TestEndpointParametersRequest paramCallback(String paramCallback) {
13131283
return this;
13141284
}
13151285

1316-
@Override
1317-
public boolean equals(Object o) {
1318-
if (this == o) {
1319-
return true;
1320-
}
1321-
if (o == null || getClass() != o.getClass()) {
1322-
return false;
1323-
}
1324-
return true;
1325-
}
1326-
1327-
@Override
1328-
public int hashCode() {
1329-
return Objects.hash();
1330-
}
13311286
}
13321287

13331288
/**
@@ -1632,21 +1587,6 @@ public TestEnumParametersRequest enumFormString(String enumFormString) {
16321587
return this;
16331588
}
16341589

1635-
@Override
1636-
public boolean equals(Object o) {
1637-
if (this == o) {
1638-
return true;
1639-
}
1640-
if (o == null || getClass() != o.getClass()) {
1641-
return false;
1642-
}
1643-
return true;
1644-
}
1645-
1646-
@Override
1647-
public int hashCode() {
1648-
return Objects.hash();
1649-
}
16501590
}
16511591

16521592
/**
@@ -1872,21 +1812,6 @@ public TestGroupParametersRequest int64Group(Long int64Group) {
18721812
return this;
18731813
}
18741814

1875-
@Override
1876-
public boolean equals(Object o) {
1877-
if (this == o) {
1878-
return true;
1879-
}
1880-
if (o == null || getClass() != o.getClass()) {
1881-
return false;
1882-
}
1883-
return true;
1884-
}
1885-
1886-
@Override
1887-
public int hashCode() {
1888-
return Objects.hash();
1889-
}
18901815
}
18911816

18921817
/**
@@ -2197,21 +2122,6 @@ public TestJsonFormDataRequest param2(String param2) {
21972122
return this;
21982123
}
21992124

2200-
@Override
2201-
public boolean equals(Object o) {
2202-
if (this == o) {
2203-
return true;
2204-
}
2205-
if (o == null || getClass() != o.getClass()) {
2206-
return false;
2207-
}
2208-
return true;
2209-
}
2210-
2211-
@Override
2212-
public int hashCode() {
2213-
return Objects.hash();
2214-
}
22152125
}
22162126

22172127
/**
@@ -2479,21 +2389,6 @@ public TestQueryParameterCollectionFormatRequest language(Map<String, String> la
24792389
return this;
24802390
}
24812391

2482-
@Override
2483-
public boolean equals(Object o) {
2484-
if (this == o) {
2485-
return true;
2486-
}
2487-
if (o == null || getClass() != o.getClass()) {
2488-
return false;
2489-
}
2490-
return true;
2491-
}
2492-
2493-
@Override
2494-
public int hashCode() {
2495-
return Objects.hash();
2496-
}
24972392
}
24982393

24992394
/**

samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/PetApi.java

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -151,21 +151,6 @@ public DeletePetRequest apiKey(String apiKey) {
151151
return this;
152152
}
153153

154-
@Override
155-
public boolean equals(Object o) {
156-
if (this == o) {
157-
return true;
158-
}
159-
if (o == null || getClass() != o.getClass()) {
160-
return false;
161-
}
162-
return true;
163-
}
164-
165-
@Override
166-
public int hashCode() {
167-
return Objects.hash();
168-
}
169154
}
170155

171156
/**
@@ -649,21 +634,6 @@ public UpdatePetWithFormRequest status(String status) {
649634
return this;
650635
}
651636

652-
@Override
653-
public boolean equals(Object o) {
654-
if (this == o) {
655-
return true;
656-
}
657-
if (o == null || getClass() != o.getClass()) {
658-
return false;
659-
}
660-
return true;
661-
}
662-
663-
@Override
664-
public int hashCode() {
665-
return Objects.hash();
666-
}
667637
}
668638

669639
/**
@@ -830,21 +800,6 @@ public UploadFileRequest _file(File _file) {
830800
return this;
831801
}
832802

833-
@Override
834-
public boolean equals(Object o) {
835-
if (this == o) {
836-
return true;
837-
}
838-
if (o == null || getClass() != o.getClass()) {
839-
return false;
840-
}
841-
return true;
842-
}
843-
844-
@Override
845-
public int hashCode() {
846-
return Objects.hash();
847-
}
848803
}
849804

850805
/**
@@ -1011,21 +966,6 @@ public UploadFileWithRequiredFileRequest additionalMetadata(String additionalMet
1011966
return this;
1012967
}
1013968

1014-
@Override
1015-
public boolean equals(Object o) {
1016-
if (this == o) {
1017-
return true;
1018-
}
1019-
if (o == null || getClass() != o.getClass()) {
1020-
return false;
1021-
}
1022-
return true;
1023-
}
1024-
1025-
@Override
1026-
public int hashCode() {
1027-
return Objects.hash();
1028-
}
1029969
}
1030970

1031971
/**

samples/client/petstore/java/webclient-useSingleRequestParameter/src/main/java/org/openapitools/client/api/UserApi.java

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -442,21 +442,6 @@ public LoginUserRequest password(String password) {
442442
return this;
443443
}
444444

445-
@Override
446-
public boolean equals(Object o) {
447-
if (this == o) {
448-
return true;
449-
}
450-
if (o == null || getClass() != o.getClass()) {
451-
return false;
452-
}
453-
return true;
454-
}
455-
456-
@Override
457-
public int hashCode() {
458-
return Objects.hash();
459-
}
460445
}
461446

462447
/**
@@ -674,21 +659,6 @@ public UpdateUserRequest user(User user) {
674659
return this;
675660
}
676661

677-
@Override
678-
public boolean equals(Object o) {
679-
if (this == o) {
680-
return true;
681-
}
682-
if (o == null || getClass() != o.getClass()) {
683-
return false;
684-
}
685-
return true;
686-
}
687-
688-
@Override
689-
public int hashCode() {
690-
return Objects.hash();
691-
}
692662
}
693663

694664
/**

0 commit comments

Comments
 (0)