From 5f96413ab729a1b566688c860ee99013aacd3eea Mon Sep 17 00:00:00 2001 From: DielN Date: Sun, 10 Nov 2024 00:37:48 +0100 Subject: [PATCH] Add commons-lang3 dependency for useReflectionEqualsHashCode --- .../workflows/samples-java-client-jdk11.yaml | 1 + bin/configs/java-feign-no-nullable.yaml | 5 ++- bin/configs/java-jersey2-8.yaml | 3 +- bin/configs/java-jersey3.yaml | 3 +- bin/configs/java-native.yaml | 1 + bin/configs/java-okhttp-gson.yaml | 5 ++- .../main/resources/Java/build.gradle.mustache | 6 +++ .../libraries/feign/build.gradle.mustache | 10 ++++- .../Java/libraries/feign/build.sbt.mustache | 3 ++ .../Java/libraries/feign/pom.mustache | 11 +++++ .../libraries/jersey2/build.gradle.mustache | 6 +++ .../Java/libraries/jersey2/build.sbt.mustache | 3 ++ .../libraries/jersey3/build.gradle.mustache | 6 +++ .../Java/libraries/jersey3/build.sbt.mustache | 3 ++ .../Java/libraries/jersey3/pom.mustache | 12 ++++++ .../libraries/native/build.gradle.mustache | 6 +++ .../Java/libraries/native/pom.mustache | 11 +++++ .../okhttp-gson/build.gradle.mustache | 2 +- .../libraries/okhttp-gson/build.sbt.mustache | 2 +- .../Java/libraries/okhttp-gson/pom.mustache | 2 +- .../src/main/resources/Java/pom.mustache | 24 ++++++++--- .../build.gradle | 2 +- .../build.sbt | 2 +- .../pom.xml | 2 +- .../echo_api/java/okhttp-gson/build.gradle | 2 +- .../echo_api/java/okhttp-gson/build.sbt | 2 +- .../client/echo_api/java/okhttp-gson/pom.xml | 2 +- .../java/okhttp-gson-oneOf-array/build.gradle | 2 +- .../java/okhttp-gson-oneOf-array/build.sbt | 2 +- .../java/okhttp-gson-oneOf-array/pom.xml | 2 +- .../java/okhttp-gson-oneOf/build.gradle | 2 +- .../others/java/okhttp-gson-oneOf/build.sbt | 2 +- .../others/java/okhttp-gson-oneOf/pom.xml | 2 +- .../java/okhttp-gson-streaming/build.gradle | 2 +- .../java/okhttp-gson-streaming/build.sbt | 2 +- .../others/java/okhttp-gson-streaming/pom.xml | 2 +- .../java/feign-no-nullable/build.gradle | 2 + .../petstore/java/feign-no-nullable/build.sbt | 1 + .../petstore/java/feign-no-nullable/pom.xml | 7 ++++ .../model/AdditionalPropertiesAnyType.java | 14 ++----- .../model/AdditionalPropertiesArray.java | 14 ++----- .../model/AdditionalPropertiesBoolean.java | 14 ++----- .../model/AdditionalPropertiesClass.java | 23 ++--------- .../model/AdditionalPropertiesInteger.java | 14 ++----- .../model/AdditionalPropertiesNumber.java | 14 ++----- .../model/AdditionalPropertiesObject.java | 14 ++----- .../model/AdditionalPropertiesString.java | 14 ++----- .../org/openapitools/client/model/Animal.java | 14 ++----- .../model/ArrayOfArrayOfNumberOnly.java | 13 ++---- .../client/model/ArrayOfNumberOnly.java | 13 ++---- .../openapitools/client/model/ArrayTest.java | 15 ++----- .../org/openapitools/client/model/BigCat.java | 14 ++----- .../client/model/Capitalization.java | 18 ++------ .../org/openapitools/client/model/Cat.java | 14 ++----- .../openapitools/client/model/Category.java | 14 ++----- .../openapitools/client/model/ClassModel.java | 13 ++---- .../org/openapitools/client/model/Client.java | 13 ++---- .../org/openapitools/client/model/Dog.java | 14 ++----- .../openapitools/client/model/EnumArrays.java | 14 ++----- .../openapitools/client/model/EnumClass.java | 2 + .../openapitools/client/model/EnumTest.java | 17 ++------ .../org/openapitools/client/model/File.java | 13 ++---- .../client/model/FileSchemaTestClass.java | 14 ++----- .../openapitools/client/model/FormatTest.java | 26 ++---------- .../client/model/HasOnlyReadOnly.java | 14 ++----- .../openapitools/client/model/MapTest.java | 16 ++------ ...ropertiesAndAdditionalPropertiesClass.java | 15 ++----- .../client/model/Model200Response.java | 14 ++----- .../client/model/ModelApiResponse.java | 15 ++----- .../openapitools/client/model/ModelList.java | 13 ++---- .../client/model/ModelReturn.java | 13 ++---- .../org/openapitools/client/model/Name.java | 16 ++------ .../openapitools/client/model/NumberOnly.java | 13 ++---- .../org/openapitools/client/model/Order.java | 18 ++------ .../client/model/OuterComposite.java | 15 ++----- .../openapitools/client/model/OuterEnum.java | 2 + .../org/openapitools/client/model/Pet.java | 18 ++------ .../client/model/ReadOnlyFirst.java | 14 ++----- .../client/model/SpecialModelName.java | 13 ++---- .../org/openapitools/client/model/Tag.java | 14 ++----- .../client/model/TypeHolderDefault.java | 17 ++------ .../client/model/TypeHolderExample.java | 18 ++------ .../org/openapitools/client/model/User.java | 20 ++------- .../openapitools/client/model/XmlItem.java | 41 ++----------------- .../petstore/java/jersey3-oneOf/pom.xml | 1 + .../client/petstore/java/jersey3/build.gradle | 2 + .../client/petstore/java/jersey3/build.sbt | 1 + samples/client/petstore/java/jersey3/pom.xml | 8 ++++ .../model/AdditionalPropertiesClass.java | 20 ++------- .../org/openapitools/client/model/Animal.java | 14 ++----- .../org/openapitools/client/model/Apple.java | 14 ++----- .../openapitools/client/model/AppleReq.java | 14 ++----- .../model/ArrayOfArrayOfNumberOnly.java | 13 ++---- .../client/model/ArrayOfNumberOnly.java | 13 ++---- .../openapitools/client/model/ArrayTest.java | 15 ++----- .../org/openapitools/client/model/Banana.java | 13 ++---- .../openapitools/client/model/BananaReq.java | 14 ++----- .../openapitools/client/model/BasquePig.java | 13 ++---- .../client/model/Capitalization.java | 18 ++------ .../org/openapitools/client/model/Cat.java | 15 ++----- .../openapitools/client/model/Category.java | 14 ++----- .../openapitools/client/model/ChildCat.java | 16 ++------ .../openapitools/client/model/ClassModel.java | 13 ++---- .../org/openapitools/client/model/Client.java | 13 ++---- .../client/model/ComplexQuadrilateral.java | 15 ++----- .../openapitools/client/model/DanishPig.java | 13 ++---- .../client/model/DeprecatedObject.java | 13 ++---- .../org/openapitools/client/model/Dog.java | 15 ++----- .../openapitools/client/model/Drawing.java | 17 ++------ .../openapitools/client/model/EnumArrays.java | 14 ++----- .../openapitools/client/model/EnumClass.java | 2 + .../openapitools/client/model/EnumTest.java | 21 ++-------- .../client/model/EquilateralTriangle.java | 15 ++----- .../client/model/FileSchemaTestClass.java | 14 ++----- .../org/openapitools/client/model/Foo.java | 13 ++---- .../client/model/FooGetDefaultResponse.java | 13 ++---- .../openapitools/client/model/FormatTest.java | 28 ++----------- .../org/openapitools/client/model/Fruit.java | 2 + .../openapitools/client/model/FruitReq.java | 2 + .../openapitools/client/model/GmFruit.java | 2 + .../client/model/GrandparentAnimal.java | 13 ++---- .../client/model/HasOnlyReadOnly.java | 14 ++----- .../client/model/HealthCheckResult.java | 13 ++---- .../client/model/IsoscelesTriangle.java | 14 ++----- .../org/openapitools/client/model/Mammal.java | 2 + .../client/model/MammalAnyof.java | 2 + .../openapitools/client/model/MapTest.java | 16 ++------ ...ropertiesAndAdditionalPropertiesClass.java | 15 ++----- .../client/model/Model200Response.java | 14 ++----- .../client/model/ModelApiResponse.java | 15 ++----- .../openapitools/client/model/ModelFile.java | 13 ++---- .../openapitools/client/model/ModelList.java | 13 ++---- .../client/model/ModelReturn.java | 13 ++---- .../org/openapitools/client/model/Name.java | 16 ++------ .../client/model/NullableClass.java | 25 ++--------- .../client/model/NullableShape.java | 2 + .../openapitools/client/model/NumberOnly.java | 13 ++---- .../model/ObjectWithDeprecatedFields.java | 16 ++------ .../org/openapitools/client/model/Order.java | 18 ++------ .../client/model/OuterComposite.java | 15 ++----- .../openapitools/client/model/OuterEnum.java | 2 + .../client/model/OuterEnumDefaultValue.java | 2 + .../client/model/OuterEnumInteger.java | 2 + .../model/OuterEnumIntegerDefaultValue.java | 2 + .../openapitools/client/model/ParentPet.java | 12 ++---- .../org/openapitools/client/model/Pet.java | 18 ++------ .../org/openapitools/client/model/Pig.java | 2 + .../client/model/Quadrilateral.java | 2 + .../client/model/QuadrilateralInterface.java | 13 ++---- .../client/model/ReadOnlyFirst.java | 14 ++----- .../client/model/ScaleneTriangle.java | 15 ++----- .../org/openapitools/client/model/Shape.java | 2 + .../client/model/ShapeInterface.java | 13 ++---- .../client/model/ShapeOrNull.java | 2 + .../client/model/SimpleQuadrilateral.java | 15 ++----- .../client/model/SpecialModelName.java | 14 ++----- .../org/openapitools/client/model/Tag.java | 14 ++----- ...neFreeformAdditionalPropertiesRequest.java | 14 ++----- .../openapitools/client/model/Triangle.java | 2 + .../client/model/TriangleInterface.java | 13 ++---- .../org/openapitools/client/model/User.java | 24 ++--------- .../org/openapitools/client/model/Whale.java | 15 ++----- .../org/openapitools/client/model/Zebra.java | 15 ++----- .../client/petstore/java/native/build.gradle | 2 + samples/client/petstore/java/native/pom.xml | 7 ++++ .../model/AdditionalPropertiesClass.java | 20 ++------- .../org/openapitools/client/model/Animal.java | 14 ++----- .../org/openapitools/client/model/Apple.java | 14 ++----- .../openapitools/client/model/AppleReq.java | 14 ++----- .../model/ArrayOfArrayOfNumberOnly.java | 13 ++---- .../client/model/ArrayOfNumberOnly.java | 13 ++---- .../openapitools/client/model/ArrayTest.java | 15 ++----- .../org/openapitools/client/model/Banana.java | 13 ++---- .../openapitools/client/model/BananaReq.java | 14 ++----- .../openapitools/client/model/BasquePig.java | 13 ++---- .../client/model/Capitalization.java | 18 ++------ .../org/openapitools/client/model/Cat.java | 14 ++----- .../openapitools/client/model/Category.java | 14 ++----- .../openapitools/client/model/ChildCat.java | 15 ++----- .../openapitools/client/model/ClassModel.java | 13 ++---- .../org/openapitools/client/model/Client.java | 13 ++---- .../client/model/ComplexQuadrilateral.java | 14 ++----- .../openapitools/client/model/DanishPig.java | 13 ++---- .../client/model/DeprecatedObject.java | 13 ++---- .../org/openapitools/client/model/Dog.java | 14 ++----- .../openapitools/client/model/Drawing.java | 18 ++------ .../openapitools/client/model/EnumArrays.java | 14 ++----- .../openapitools/client/model/EnumClass.java | 2 + .../openapitools/client/model/EnumTest.java | 21 ++-------- .../client/model/EquilateralTriangle.java | 14 ++----- .../model/FakeBigDecimalMap200Response.java | 14 ++----- .../client/model/FileSchemaTestClass.java | 14 ++----- .../org/openapitools/client/model/Foo.java | 13 ++---- .../client/model/FooGetDefaultResponse.java | 13 ++---- .../openapitools/client/model/FormatTest.java | 28 ++----------- .../org/openapitools/client/model/Fruit.java | 2 + .../openapitools/client/model/FruitReq.java | 2 + .../openapitools/client/model/GmFruit.java | 2 + .../client/model/GrandparentAnimal.java | 13 ++---- .../client/model/HasOnlyReadOnly.java | 14 ++----- .../client/model/HealthCheckResult.java | 13 ++---- .../client/model/IsoscelesTriangle.java | 14 ++----- .../org/openapitools/client/model/Mammal.java | 2 + .../openapitools/client/model/MapTest.java | 16 ++------ ...ropertiesAndAdditionalPropertiesClass.java | 15 ++----- .../client/model/Model200Response.java | 14 ++----- .../client/model/ModelApiResponse.java | 15 ++----- .../openapitools/client/model/ModelFile.java | 13 ++---- .../openapitools/client/model/ModelList.java | 13 ++---- .../client/model/ModelReturn.java | 13 ++---- .../org/openapitools/client/model/Name.java | 16 ++------ .../client/model/NullableClass.java | 26 ++---------- .../client/model/NullableShape.java | 2 + .../openapitools/client/model/NumberOnly.java | 13 ++---- .../model/ObjectWithDeprecatedFields.java | 16 ++------ .../org/openapitools/client/model/Order.java | 18 ++------ .../client/model/OuterComposite.java | 15 ++----- .../openapitools/client/model/OuterEnum.java | 2 + .../client/model/OuterEnumDefaultValue.java | 2 + .../client/model/OuterEnumInteger.java | 2 + .../model/OuterEnumIntegerDefaultValue.java | 2 + .../openapitools/client/model/ParentPet.java | 12 ++---- .../org/openapitools/client/model/Pet.java | 18 ++------ .../org/openapitools/client/model/Pig.java | 2 + .../client/model/Quadrilateral.java | 2 + .../client/model/QuadrilateralInterface.java | 13 ++---- .../client/model/ReadOnlyFirst.java | 14 ++----- .../client/model/ScaleneTriangle.java | 14 ++----- .../org/openapitools/client/model/Shape.java | 2 + .../client/model/ShapeInterface.java | 13 ++---- .../client/model/ShapeOrNull.java | 2 + .../client/model/SimpleQuadrilateral.java | 14 ++----- .../client/model/SpecialModelName.java | 14 ++----- .../org/openapitools/client/model/Tag.java | 14 ++----- ...neFreeformAdditionalPropertiesRequest.java | 15 ++----- .../openapitools/client/model/Triangle.java | 2 + .../client/model/TriangleInterface.java | 13 ++---- .../org/openapitools/client/model/User.java | 24 ++--------- .../org/openapitools/client/model/Whale.java | 15 ++----- .../org/openapitools/client/model/Zebra.java | 16 ++------ .../java/okhttp-gson-3.1/build.gradle | 2 +- .../petstore/java/okhttp-gson-3.1/build.sbt | 2 +- .../petstore/java/okhttp-gson-3.1/pom.xml | 2 +- .../okhttp-gson-awsv4signature/build.gradle | 2 +- .../java/okhttp-gson-awsv4signature/build.sbt | 2 +- .../java/okhttp-gson-awsv4signature/pom.xml | 2 +- .../build.gradle | 2 +- .../okhttp-gson-dynamicOperations/build.sbt | 2 +- .../okhttp-gson-dynamicOperations/pom.xml | 2 +- .../okhttp-gson-group-parameter/build.gradle | 2 +- .../okhttp-gson-group-parameter/build.sbt | 2 +- .../java/okhttp-gson-group-parameter/pom.xml | 2 +- .../build.gradle | 2 +- .../okhttp-gson-nullable-required/build.sbt | 2 +- .../okhttp-gson-nullable-required/pom.xml | 2 +- .../okhttp-gson-parcelableModel/build.gradle | 2 +- .../okhttp-gson-parcelableModel/build.sbt | 2 +- .../java/okhttp-gson-parcelableModel/pom.xml | 2 +- .../java/okhttp-gson-swagger1/build.gradle | 2 +- .../java/okhttp-gson-swagger1/build.sbt | 2 +- .../java/okhttp-gson-swagger1/pom.xml | 2 +- .../java/okhttp-gson-swagger2/build.gradle | 2 +- .../java/okhttp-gson-swagger2/build.sbt | 2 +- .../java/okhttp-gson-swagger2/pom.xml | 2 +- .../petstore/java/okhttp-gson/build.gradle | 2 +- .../petstore/java/okhttp-gson/build.sbt | 2 +- .../petstore/java/jersey2-java8/build.gradle | 2 + .../petstore/java/jersey2-java8/build.sbt | 1 + .../model/AdditionalPropertiesClass.java | 20 ++------- .../org/openapitools/client/model/Animal.java | 14 ++----- .../org/openapitools/client/model/Apple.java | 14 ++----- .../openapitools/client/model/AppleReq.java | 14 ++----- .../model/ArrayOfArrayOfNumberOnly.java | 13 ++---- .../client/model/ArrayOfNumberOnly.java | 13 ++---- .../openapitools/client/model/ArrayTest.java | 15 ++----- .../org/openapitools/client/model/Banana.java | 13 ++---- .../openapitools/client/model/BananaReq.java | 14 ++----- .../openapitools/client/model/BasquePig.java | 13 ++---- .../client/model/Capitalization.java | 18 ++------ .../org/openapitools/client/model/Cat.java | 15 ++----- .../openapitools/client/model/Category.java | 14 ++----- .../openapitools/client/model/ChildCat.java | 16 ++------ .../openapitools/client/model/ClassModel.java | 13 ++---- .../org/openapitools/client/model/Client.java | 13 ++---- .../client/model/ComplexQuadrilateral.java | 15 ++----- .../openapitools/client/model/DanishPig.java | 13 ++---- .../client/model/DeprecatedObject.java | 13 ++---- .../org/openapitools/client/model/Dog.java | 15 ++----- .../openapitools/client/model/Drawing.java | 17 ++------ .../openapitools/client/model/EnumArrays.java | 14 ++----- .../openapitools/client/model/EnumClass.java | 2 + .../openapitools/client/model/EnumTest.java | 21 ++-------- .../client/model/EquilateralTriangle.java | 15 ++----- .../client/model/FileSchemaTestClass.java | 14 ++----- .../org/openapitools/client/model/Foo.java | 13 ++---- .../client/model/FooGetDefaultResponse.java | 13 ++---- .../openapitools/client/model/FormatTest.java | 28 ++----------- .../org/openapitools/client/model/Fruit.java | 2 + .../openapitools/client/model/FruitReq.java | 2 + .../openapitools/client/model/GmFruit.java | 2 + .../client/model/GrandparentAnimal.java | 13 ++---- .../client/model/HasOnlyReadOnly.java | 14 ++----- .../client/model/HealthCheckResult.java | 13 ++---- .../client/model/IsoscelesTriangle.java | 14 ++----- .../org/openapitools/client/model/Mammal.java | 2 + .../client/model/MammalAnyof.java | 2 + .../openapitools/client/model/MapTest.java | 16 ++------ ...ropertiesAndAdditionalPropertiesClass.java | 15 ++----- .../client/model/Model200Response.java | 14 ++----- .../client/model/ModelApiResponse.java | 15 ++----- .../openapitools/client/model/ModelFile.java | 13 ++---- .../openapitools/client/model/ModelList.java | 13 ++---- .../client/model/ModelReturn.java | 13 ++---- .../org/openapitools/client/model/Name.java | 16 ++------ .../client/model/NullableClass.java | 25 ++--------- .../client/model/NullableShape.java | 2 + .../openapitools/client/model/NumberOnly.java | 13 ++---- .../model/ObjectWithDeprecatedFields.java | 16 ++------ .../org/openapitools/client/model/Order.java | 18 ++------ .../client/model/OuterComposite.java | 15 ++----- .../openapitools/client/model/OuterEnum.java | 2 + .../client/model/OuterEnumDefaultValue.java | 2 + .../client/model/OuterEnumInteger.java | 2 + .../model/OuterEnumIntegerDefaultValue.java | 2 + .../openapitools/client/model/ParentPet.java | 12 ++---- .../org/openapitools/client/model/Pet.java | 18 ++------ .../org/openapitools/client/model/Pig.java | 2 + .../client/model/Quadrilateral.java | 2 + .../client/model/QuadrilateralInterface.java | 13 ++---- .../client/model/ReadOnlyFirst.java | 14 ++----- .../client/model/ScaleneTriangle.java | 15 ++----- .../org/openapitools/client/model/Shape.java | 2 + .../client/model/ShapeInterface.java | 13 ++---- .../client/model/ShapeOrNull.java | 2 + .../client/model/SimpleQuadrilateral.java | 15 ++----- .../client/model/SpecialModelName.java | 14 ++----- .../org/openapitools/client/model/Tag.java | 14 ++----- ...neFreeformAdditionalPropertiesRequest.java | 14 ++----- .../openapitools/client/model/Triangle.java | 2 + .../client/model/TriangleInterface.java | 13 ++---- .../org/openapitools/client/model/User.java | 24 ++--------- .../org/openapitools/client/model/Whale.java | 15 ++----- .../org/openapitools/client/model/Zebra.java | 15 ++----- 343 files changed, 1165 insertions(+), 2526 deletions(-) diff --git a/.github/workflows/samples-java-client-jdk11.yaml b/.github/workflows/samples-java-client-jdk11.yaml index 268d078095c3..332c4f1909df 100644 --- a/.github/workflows/samples-java-client-jdk11.yaml +++ b/.github/workflows/samples-java-client-jdk11.yaml @@ -67,6 +67,7 @@ jobs: - samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter - samples/client/petstore/java/apache-httpclient - samples/client/petstore/java/feign + - samples/client/petstore/java/feign-no-nullable - samples/client/petstore/java/okhttp-gson-awsv4signature - samples/openapi3/client/petstore/java/jersey2-java8-special-characters - samples/openapi3/client/petstore/java/native diff --git a/bin/configs/java-feign-no-nullable.yaml b/bin/configs/java-feign-no-nullable.yaml index 05453b419dcf..ddafc6ef2bfa 100644 --- a/bin/configs/java-feign-no-nullable.yaml +++ b/bin/configs/java-feign-no-nullable.yaml @@ -6,6 +6,7 @@ templateDir: modules/openapi-generator/src/main/resources/Java additionalProperties: booleanGetterPrefix: is artifactId: petstore-feign-no-nullable - hideGenerationTimestamp: "true" + hideGenerationTimestamp: true additionalModelTypeAnnotations: '@javax.annotation.concurrent.Immutable' - openApiNullable: "false" + openApiNullable: false + useReflectionEqualsHashCode: true diff --git a/bin/configs/java-jersey2-8.yaml b/bin/configs/java-jersey2-8.yaml index e4407a08260b..259b88e07ceb 100644 --- a/bin/configs/java-jersey2-8.yaml +++ b/bin/configs/java-jersey2-8.yaml @@ -11,4 +11,5 @@ additionalProperties: useOneOfDiscriminatorLookup: true disallowAdditionalPropertiesIfNotPresent: false gradleProperties: "\n# JVM arguments\norg.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m\n# set timeout\norg.gradle.daemon.idletimeout=3600000\n# show all warnings\norg.gradle.warning.mode=all" - failOnUnknownProperties: true \ No newline at end of file + failOnUnknownProperties: true + useReflectionEqualsHashCode: true diff --git a/bin/configs/java-jersey3.yaml b/bin/configs/java-jersey3.yaml index 3d958f012564..513f3889d3c7 100644 --- a/bin/configs/java-jersey3.yaml +++ b/bin/configs/java-jersey3.yaml @@ -12,4 +12,5 @@ additionalProperties: useOneOfDiscriminatorLookup: true disallowAdditionalPropertiesIfNotPresent: false gradleProperties: "\n# JVM arguments\norg.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m\n# set timeout\norg.gradle.daemon.idletimeout=3600000\n# show all warnings\norg.gradle.warning.mode=all" - failOnUnknownProperties: true \ No newline at end of file + failOnUnknownProperties: true + useReflectionEqualsHashCode: true diff --git a/bin/configs/java-native.yaml b/bin/configs/java-native.yaml index ba1795d9de39..467d6da65459 100644 --- a/bin/configs/java-native.yaml +++ b/bin/configs/java-native.yaml @@ -7,3 +7,4 @@ additionalProperties: artifactId: petstore-native hideGenerationTimestamp: "true" generateBuilders: true + useReflectionEqualsHashCode: "true" diff --git a/bin/configs/java-okhttp-gson.yaml b/bin/configs/java-okhttp-gson.yaml index 8b402a580a80..8f5c07cae49c 100644 --- a/bin/configs/java-okhttp-gson.yaml +++ b/bin/configs/java-okhttp-gson.yaml @@ -11,9 +11,10 @@ parameterNameMappings: type_: typeWithUnderscore additionalProperties: artifactId: petstore-okhttp-gson - hideGenerationTimestamp: "true" - useOneOfDiscriminatorLookup: "true" + hideGenerationTimestamp: true + useOneOfDiscriminatorLookup: true disallowAdditionalPropertiesIfNotPresent: false + useReflectionEqualsHashCode:: true enumNameMappings: s: LOWER_CASE_S S: UPPER_CASE_S diff --git a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache index 7409e650ff85..6557a7c70b38 100644 --- a/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/build.gradle.mustache @@ -126,6 +126,9 @@ ext { jersey_version = "1.19.4" jodatime_version = "2.9.9" junit_version = "5.10.2" + {{#useReflectionEqualsHashCode}} + commons_lang3_version = "3.17.0" + {{/useReflectionEqualsHashCode}} } dependencies { @@ -148,6 +151,9 @@ dependencies { {{#useBeanValidation}} implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" {{/useBeanValidation}} + {{#useReflectionEqualsHashCode}} + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/useReflectionEqualsHashCode}} testImplementation "junit:junit:$junit_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache index 4c485fede0cc..2b4e0340e7fc 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -114,6 +114,9 @@ ext { feign_form_version = "3.8.0" junit_version = "5.7.0" scribejava_version = "8.0.0" + {{#useReflectionEqualsHashCode}} + commons_lang3_version = "3.17.0" + {{/useReflectionEqualsHashCode}} } dependencies { @@ -127,9 +130,9 @@ dependencies { implementation "io.github.openfeign:feign-okhttp:$feign_version" implementation "io.github.openfeign.form:feign-form:$feign_form_version" {{#jackson}} - {{#joda}} + {{#joda}} implementation "com.fasterxml.jackson.datatype:jackson-datatype-joda:$jackson_version" - {{/joda}} + {{/joda}} implementation "com.fasterxml.jackson.core:jackson-core:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" implementation "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" @@ -142,6 +145,9 @@ dependencies { implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + {{#useReflectionEqualsHashCode}} + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/useReflectionEqualsHashCode}} testImplementation "org.junit.jupiter:junit-jupiter:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache index f42f909cc70f..1a24b99f55d7 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -28,6 +28,9 @@ lazy val root = (project in file(".")). "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", +{{#useReflectionEqualsHashCode}} + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", +{{/useReflectionEqualsHashCode}} "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % "test", "org.junit.jupiter" % "junit-jupiter-params" % "5.7.0" % "test", "com.github.tomakehurst" % "wiremock-jre8" % "2.35.1" % "test", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache index 79712da6a4e7..c915ea0ec9f4 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/feign/pom.mustache @@ -345,6 +345,14 @@ provided {{/useBeanValidation}} + {{#useReflectionEqualsHashCode}} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + {{/useReflectionEqualsHashCode}} @@ -409,6 +417,9 @@ 1.3.5 2.0.2 {{/useJakartaEe}} + {{#useReflectionEqualsHashCode}} + 3.17.0 + {{/useReflectionEqualsHashCode}} 5.10.0 1.0.0 8.3.3 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index a9ab96231611..ca6ae2abe01e 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -116,6 +116,9 @@ ext { {{#hasHttpSignatureMethods}} tomitribe_http_signatures_version = "1.7" {{/hasHttpSignatureMethods}} + {{#useReflectionEqualsHashCode}} + commons_lang3_version = "3.17.0" + {{/useReflectionEqualsHashCode}} } dependencies { @@ -146,6 +149,9 @@ dependencies { {{#useBeanValidation}} implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" {{/useBeanValidation}} + {{#useReflectionEqualsHashCode}} + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/useReflectionEqualsHashCode}} testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index d055cf378de5..fa3ead60a2d6 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -33,6 +33,9 @@ lazy val root = (project in file(".")). "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", {{/hasHttpSignatureMethods}} "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + {{#useReflectionEqualsHashCode}} + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", + {{/useReflectionEqualsHashCode}} "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache index 42908c8bb47e..f95eafca0c69 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.gradle.mustache @@ -116,6 +116,9 @@ ext { {{#hasHttpSignatureMethods}} tomitribe_http_signatures_version = "1.7" {{/hasHttpSignatureMethods}} + {{#useReflectionEqualsHashCode}} + commons_lang3_version = "3.17.0" + {{/useReflectionEqualsHashCode}} } dependencies { @@ -146,6 +149,9 @@ dependencies { {{#useBeanValidation}} implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" {{/useBeanValidation}} + {{#useReflectionEqualsHashCode}} + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/useReflectionEqualsHashCode}} testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache index 6e89375a6a1c..5f07e56716e8 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/build.sbt.mustache @@ -33,6 +33,9 @@ lazy val root = (project in file(".")). "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", {{/hasHttpSignatureMethods}} "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", + {{#useReflectionEqualsHashCode}} + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", + {{/useReflectionEqualsHashCode}} "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache index 49583229d488..a3c115041714 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pom.mustache @@ -379,6 +379,15 @@ jersey-apache-connector ${jersey-version} + {{#useReflectionEqualsHashCode}} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + {{/useReflectionEqualsHashCode}} + org.junit.jupiter @@ -408,6 +417,9 @@ {{#hasOAuthMethods}} 8.3.3 {{/hasOAuthMethods}} + {{#useReflectionEqualsHashCode}} + 3.17.0 + {{/useReflectionEqualsHashCode}} 2.21.0 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache index 34f24d891617..a04a9645e175 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/build.gradle.mustache @@ -85,6 +85,9 @@ ext { {{#hasFormParamsInSpec}} httpmime_version = "4.5.13" {{/hasFormParamsInSpec}} + {{#useReflectionEqualsHashCode}} + commons_lang3_version = "3.17.0" + {{/useReflectionEqualsHashCode}} } dependencies { @@ -107,6 +110,9 @@ dependencies { {{#hasFormParamsInSpec}} implementation "org.apache.httpcomponents:httpmime:$httpmime_version" {{/hasFormParamsInSpec}} + {{#useReflectionEqualsHashCode}} + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" + {{/useReflectionEqualsHashCode}} testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache index 62bb7917deb1..0ccfa84182c2 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pom.mustache @@ -271,6 +271,14 @@ ${httpmime-version} {{/hasFormParamsInSpec}} + {{#useReflectionEqualsHashCode}} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + {{/useReflectionEqualsHashCode}} @@ -304,6 +312,9 @@ {{#hasFormParamsInSpec}} 4.5.14 {{/hasFormParamsInSpec}} + {{#useReflectionEqualsHashCode}} + 3.17.0 + {{/useReflectionEqualsHashCode}} 5.10.2 2.27.2 diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache index eb67fc112409..1b527257ae0f 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.gradle.mustache @@ -126,7 +126,7 @@ dependencies { {{#hasOAuthMethods}} implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' {{/hasOAuthMethods}} - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' {{#joda}} implementation 'joda-time:joda-time:2.9.9' {{/joda}} diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index 2045b84742e3..54bd804c4411 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", {{#openApiNullable}} "org.openapitools" % "jackson-databind-nullable" % "0.2.6", diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index 465076a4d6ea..5e7bd9b86ed0 100644 --- a/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -414,7 +414,7 @@ {{/swagger2AnnotationLibrary}} 4.12.0 2.10.1 - 3.14.0 + 3.17.0 {{#openApiNullable}} 0.2.6 {{/openApiNullable}} diff --git a/modules/openapi-generator/src/main/resources/Java/pom.mustache b/modules/openapi-generator/src/main/resources/Java/pom.mustache index b2bc5a25d8a6..c46bc598e739 100644 --- a/modules/openapi-generator/src/main/resources/Java/pom.mustache +++ b/modules/openapi-generator/src/main/resources/Java/pom.mustache @@ -289,12 +289,12 @@ {{/useJakartaEe}} {{#withXml}} - - - com.fasterxml.jackson.dataformat - jackson-dataformat-xml - ${jackson-version} - + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + ${jackson-version} + {{/withXml}} {{#joda}} @@ -341,6 +341,15 @@ ${jakarta-annotation-version} provided + {{#useReflectionEqualsHashCode}} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + {{/useReflectionEqualsHashCode}} + org.junit.jupiter @@ -374,6 +383,9 @@ 1.3.5 2.0.2 {{/useJakartaEe}} + {{#useReflectionEqualsHashCode}} + 3.17.0 + {{/useReflectionEqualsHashCode}} 1.0.0 5.10.2 1.10.0 diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle index 676e8c999a0e..2d1609df2afc 100644 --- a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt index 41a2d93764c2..e79c5140fca8 100644 --- a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml index 7a5b714d3160..0e717a3ab121 100644 --- a/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml +++ b/samples/client/echo_api/java/okhttp-gson-user-defined-templates/pom.xml @@ -331,7 +331,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/echo_api/java/okhttp-gson/build.gradle b/samples/client/echo_api/java/okhttp-gson/build.gradle index 1f433364a3a5..ac77e86d715c 100644 --- a/samples/client/echo_api/java/okhttp-gson/build.gradle +++ b/samples/client/echo_api/java/okhttp-gson/build.gradle @@ -114,7 +114,7 @@ dependencies { implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/echo_api/java/okhttp-gson/build.sbt b/samples/client/echo_api/java/okhttp-gson/build.sbt index 12ac2795172e..ecb09dd27f59 100644 --- a/samples/client/echo_api/java/okhttp-gson/build.sbt +++ b/samples/client/echo_api/java/okhttp-gson/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", diff --git a/samples/client/echo_api/java/okhttp-gson/pom.xml b/samples/client/echo_api/java/okhttp-gson/pom.xml index 862d43891b8e..806622488c7b 100644 --- a/samples/client/echo_api/java/okhttp-gson/pom.xml +++ b/samples/client/echo_api/java/okhttp-gson/pom.xml @@ -326,7 +326,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle b/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle index d1dc4ac2a571..d96f6d99d885 100644 --- a/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle +++ b/samples/client/others/java/okhttp-gson-oneOf-array/build.gradle @@ -114,7 +114,7 @@ dependencies { implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/others/java/okhttp-gson-oneOf-array/build.sbt b/samples/client/others/java/okhttp-gson-oneOf-array/build.sbt index ecdac6b908f2..8c3d65a33a6e 100644 --- a/samples/client/others/java/okhttp-gson-oneOf-array/build.sbt +++ b/samples/client/others/java/okhttp-gson-oneOf-array/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", diff --git a/samples/client/others/java/okhttp-gson-oneOf-array/pom.xml b/samples/client/others/java/okhttp-gson-oneOf-array/pom.xml index 4796ef596cba..bd334327c87a 100644 --- a/samples/client/others/java/okhttp-gson-oneOf-array/pom.xml +++ b/samples/client/others/java/okhttp-gson-oneOf-array/pom.xml @@ -333,7 +333,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/others/java/okhttp-gson-oneOf/build.gradle b/samples/client/others/java/okhttp-gson-oneOf/build.gradle index d1dc4ac2a571..d96f6d99d885 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/build.gradle +++ b/samples/client/others/java/okhttp-gson-oneOf/build.gradle @@ -114,7 +114,7 @@ dependencies { implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/others/java/okhttp-gson-oneOf/build.sbt b/samples/client/others/java/okhttp-gson-oneOf/build.sbt index ecdac6b908f2..8c3d65a33a6e 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/build.sbt +++ b/samples/client/others/java/okhttp-gson-oneOf/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", diff --git a/samples/client/others/java/okhttp-gson-oneOf/pom.xml b/samples/client/others/java/okhttp-gson-oneOf/pom.xml index 8d703337d94e..667b3b718af6 100644 --- a/samples/client/others/java/okhttp-gson-oneOf/pom.xml +++ b/samples/client/others/java/okhttp-gson-oneOf/pom.xml @@ -326,7 +326,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/others/java/okhttp-gson-streaming/build.gradle b/samples/client/others/java/okhttp-gson-streaming/build.gradle index b454a3a81321..41bc90123d83 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.gradle +++ b/samples/client/others/java/okhttp-gson-streaming/build.gradle @@ -114,7 +114,7 @@ dependencies { implementation 'io.gsonfire:gson-fire:1.9.0' implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/others/java/okhttp-gson-streaming/build.sbt b/samples/client/others/java/okhttp-gson-streaming/build.sbt index b776f34e427a..c074040f59f4 100644 --- a/samples/client/others/java/okhttp-gson-streaming/build.sbt +++ b/samples/client/others/java/okhttp-gson-streaming/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "io.gsonfire" % "gson-fire" % "1.9.0" % "compile", diff --git a/samples/client/others/java/okhttp-gson-streaming/pom.xml b/samples/client/others/java/okhttp-gson-streaming/pom.xml index 4b0f7510602c..1db320466c16 100644 --- a/samples/client/others/java/okhttp-gson-streaming/pom.xml +++ b/samples/client/others/java/okhttp-gson-streaming/pom.xml @@ -326,7 +326,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/feign-no-nullable/build.gradle b/samples/client/petstore/java/feign-no-nullable/build.gradle index b71958edb547..7df6a10718df 100644 --- a/samples/client/petstore/java/feign-no-nullable/build.gradle +++ b/samples/client/petstore/java/feign-no-nullable/build.gradle @@ -109,6 +109,7 @@ ext { feign_form_version = "3.8.0" junit_version = "5.7.0" scribejava_version = "8.0.0" + commons_lang3_version = "3.17.0" } dependencies { @@ -127,6 +128,7 @@ dependencies { implementation "com.github.scribejava:scribejava-core:$scribejava_version" implementation "com.brsanthu:migbase64:2.2" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" testImplementation "org.junit.jupiter:junit-jupiter:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" testImplementation "org.junit.jupiter:junit-jupiter-params:$junit_version" diff --git a/samples/client/petstore/java/feign-no-nullable/build.sbt b/samples/client/petstore/java/feign-no-nullable/build.sbt index 6a1f2cb2fb3e..1f85088e35a9 100644 --- a/samples/client/petstore/java/feign-no-nullable/build.sbt +++ b/samples/client/petstore/java/feign-no-nullable/build.sbt @@ -24,6 +24,7 @@ lazy val root = (project in file(".")). "com.github.scribejava" % "scribejava-core" % "8.0.0" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % "test", "org.junit.jupiter" % "junit-jupiter-params" % "5.7.0" % "test", "com.github.tomakehurst" % "wiremock-jre8" % "2.35.1" % "test", diff --git a/samples/client/petstore/java/feign-no-nullable/pom.xml b/samples/client/petstore/java/feign-no-nullable/pom.xml index 1e12c67db067..f5ad65da60ee 100644 --- a/samples/client/petstore/java/feign-no-nullable/pom.xml +++ b/samples/client/petstore/java/feign-no-nullable/pom.xml @@ -273,6 +273,12 @@ ${jakarta-annotation-version} provided + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + @@ -317,6 +323,7 @@ 2.17.1 1.3.5 2.0.2 + 3.17.0 5.10.0 1.0.0 8.3.3 diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index d956eec0ce1a..e181db7bd1f7 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -117,20 +119,12 @@ public Object getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index ea7b682f2740..62f6651a8e55 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -118,20 +120,12 @@ public List getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 957e51a26c22..45cd6e1a7da7 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -117,20 +119,12 @@ public Boolean getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index e5f2a700681c..48d8f99a24c3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -445,29 +447,12 @@ public void setAnytype3(@javax.annotation.Nullable Object anytype3) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 1d3aa6aa79df..88700692933e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -117,20 +119,12 @@ public Integer getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 08090c876bae..89eee3d8adfe 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -118,20 +120,12 @@ public BigDecimal getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index 889e43891ea2..75dd96a92458 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -117,20 +119,12 @@ public Map getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 8b779bcb0f2b..12b0034a1b7d 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -117,20 +119,12 @@ public String getAdditionalProperty(String key) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java index f62cf986f2c5..ee12001a73e8 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Animal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; @@ -112,20 +114,12 @@ public void setColor(@javax.annotation.Nullable String color) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(className, color); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 3268072dde76..96044e224a91 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -79,19 +81,12 @@ public void setArrayArrayNumber(@javax.annotation.Nullable List @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayArrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 9a2cc4f2cd56..6fead57314ef 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -79,19 +81,12 @@ public void setArrayNumber(@javax.annotation.Nullable List arrayNumb @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java index b513a4b9ebb5..1e17602fd128 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -157,21 +159,12 @@ public void setArrayArrayOfModel(@javax.annotation.Nullable List arrayEnu @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumClass.java index 1190cf5abe3c..111927ab55fe 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java index d45573450000..43fcc470ce60 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/EnumTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -337,23 +339,12 @@ public void setOuterEnum(@javax.annotation.Nullable OuterEnum outerEnum) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java index e96a02bcd023..f937cc2b85bc 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/File.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -67,19 +69,12 @@ public void setSourceURI(@javax.annotation.Nullable String sourceURI) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(sourceURI); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 250122ef1808..f55115d330e8 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -110,20 +112,12 @@ public void setFiles(@javax.annotation.Nullable List files) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(file, files); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java index 93940d641d01..ebf94ea7287c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/FormatTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -486,32 +488,12 @@ public void setBigDecimal(@javax.annotation.Nullable BigDecimal bigDecimal) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 9dc90d1f3cea..4495894dd6d4 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -87,20 +89,12 @@ public String getFoo() { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar, foo); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java index 81c20684340b..e8050beddf6c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MapTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -229,22 +231,12 @@ public void setIndirectMap(@javax.annotation.Nullable Map indir @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 85e8725ad6f3..d88e3fd3351c 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -142,21 +144,12 @@ public void setMap(@javax.annotation.Nullable Map map) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(uuid, dateTime, map); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java index 05d89779ec12..978a71aa2fca 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Model200Response.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -99,20 +101,12 @@ public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, propertyClass); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 831e6c8580a5..3dee469c0459 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -130,21 +132,12 @@ public void setMessage(@javax.annotation.Nullable String message) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(code, type, message); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java index 712b3cf6b47c..7259402c6f95 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelList.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -68,19 +70,12 @@ public void set123list(@javax.annotation.Nullable String _123list) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_123list); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java index c2c62f72330c..d20af26e708e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -68,19 +70,12 @@ public void setReturn(@javax.annotation.Nullable Integer _return) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_return); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java index bbe70280caef..7229530cb632 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Name.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -148,22 +150,12 @@ public Integer get123number() { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java index 1d49eb406fed..206245c480de 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -68,19 +70,12 @@ public void setJustNumber(@javax.annotation.Nullable BigDecimal justNumber) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(justNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java index dc6d52dc2091..c910207c3acd 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Order.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -260,24 +262,12 @@ public void setComplete(@javax.annotation.Nullable Boolean complete) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java index e919c4e6d9e1..3a76d41e3764 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -130,21 +132,12 @@ public void setMyBoolean(@javax.annotation.Nullable Boolean myBoolean) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterEnum.java index d2924eb9c29b..925066b50704 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java index 3fd31774a9dd..207bfa7d49cc 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Pet.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -284,24 +286,12 @@ public void setStatus(@javax.annotation.Nullable StatusEnum status) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index e59d26515366..27f4a0cd04af 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -95,20 +97,12 @@ public void setBaz(@javax.annotation.Nullable String baz) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar, baz); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java index 30f18df8bd54..cdcb003fd5d3 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -68,19 +70,12 @@ public SpecialModelName() { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash($specialPropertyName); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java index bdb029f73197..517cf267b942 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/Tag.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -98,20 +100,12 @@ public void setName(@javax.annotation.Nullable String name) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, name); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index f6c5a693e8a0..e578c14af83e 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -203,23 +205,12 @@ public void setArrayItem(@javax.annotation.Nonnull List arrayItem) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 90c368d7a770..ae952293e9ca 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -234,24 +236,12 @@ public void setArrayItem(@javax.annotation.Nonnull List arrayItem) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java index 453196da0143..674ed998b6bd 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/User.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -284,26 +286,12 @@ public void setUserStatus(@javax.annotation.Nullable Integer userStatus) { @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java index bc3a8faa2f06..1f94d605088f 100644 --- a/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/feign-no-nullable/src/main/java/org/openapitools/client/model/XmlItem.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonInclude; @@ -1011,47 +1013,12 @@ public void setPrefixNsWrappedArray(@javax.annotation.Nullable List pre @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3-oneOf/pom.xml b/samples/client/petstore/java/jersey3-oneOf/pom.xml index 616be794b601..590d772f329e 100644 --- a/samples/client/petstore/java/jersey3-oneOf/pom.xml +++ b/samples/client/petstore/java/jersey3-oneOf/pom.xml @@ -318,6 +318,7 @@ jersey-apache-connector ${jersey-version} + org.junit.jupiter diff --git a/samples/client/petstore/java/jersey3/build.gradle b/samples/client/petstore/java/jersey3/build.gradle index 66e463de413e..10c96f84970e 100644 --- a/samples/client/petstore/java/jersey3/build.gradle +++ b/samples/client/petstore/java/jersey3/build.gradle @@ -108,6 +108,7 @@ ext { junit_version = "5.8.2" scribejava_apis_version = "8.3.1" tomitribe_http_signatures_version = "1.7" + commons_lang3_version = "3.17.0" } dependencies { @@ -127,6 +128,7 @@ dependencies { implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" implementation "jakarta.validation:jakarta.validation-api:$bean_validation_version" + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" diff --git a/samples/client/petstore/java/jersey3/build.sbt b/samples/client/petstore/java/jersey3/build.sbt index f57389cc41f5..693ad5c72089 100644 --- a/samples/client/petstore/java/jersey3/build.sbt +++ b/samples/client/petstore/java/jersey3/build.sbt @@ -24,6 +24,7 @@ lazy val root = (project in file(".")). "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "2.1.0" % "compile", + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/samples/client/petstore/java/jersey3/pom.xml b/samples/client/petstore/java/jersey3/pom.xml index 11aaeb47b7fb..69c559dbede8 100644 --- a/samples/client/petstore/java/jersey3/pom.xml +++ b/samples/client/petstore/java/jersey3/pom.xml @@ -335,6 +335,13 @@ jersey-apache-connector ${jersey-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + + org.junit.jupiter @@ -354,6 +361,7 @@ 5.10.0 1.8 8.3.3 + 3.17.0 2.21.0 diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 795337f2d52b..38600bbe6fc2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -337,21 +339,7 @@ public void setMapWithUndeclaredPropertiesString(@jakarta.annotation.Nullable Ma */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) && - equalsNullable(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) && - Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) && - Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -360,7 +348,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty, hashCodeNullable(anytype1), mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java index 118df7958065..e5f42f8b418f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Animal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -119,20 +121,12 @@ public void setColor(@jakarta.annotation.Nullable String color) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(className, color); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java index 24e7849e22b6..0d82658dac6d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Apple.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -106,20 +108,12 @@ public void setOrigin(@jakarta.annotation.Nullable String origin) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Apple apple = (Apple) o; - return Objects.equals(this.cultivar, apple.cultivar) && - Objects.equals(this.origin, apple.origin); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(cultivar, origin); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java index 73918b98ff7f..7ae4e6cbe17a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/AppleReq.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -107,20 +109,12 @@ public void setMealy(@jakarta.annotation.Nullable Boolean mealy) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AppleReq appleReq = (AppleReq) o; - return Objects.equals(this.cultivar, appleReq.cultivar) && - Objects.equals(this.mealy, appleReq.mealy); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(cultivar, mealy); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 7f4d13dbf205..579df04b5179 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -86,19 +88,12 @@ public void setArrayArrayNumber(@jakarta.annotation.Nullable List arrayNu */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java index 81b5130763e0..27cfadfc1e1e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -165,21 +167,12 @@ public void setArrayArrayOfModel(@jakarta.annotation.Nullable List boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -264,7 +255,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(mainShape, hashCodeNullable(shapeOrNull), hashCodeNullable(nullableShape), shapes, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java index c171e5308d65..52eb75c7a2c3 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -185,20 +187,12 @@ public void setArrayEnum(@jakarta.annotation.Nullable List arrayE */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java index 8896a4043cba..a8d97ff8d03d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java index 156ca8f8972b..4a78c7cdf54b 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EnumTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -522,22 +524,7 @@ public void setOuterEnumIntegerDefaultValue(@jakarta.annotation.Nullable OuterEn */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumIntegerOnly, enumTest.enumIntegerOnly) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - equalsNullable(this.outerEnum, enumTest.outerEnum) && - Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && - Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && - Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -546,7 +533,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumIntegerOnly, enumNumber, hashCodeNullable(outerEnum), outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 44732e013917..89b557c00d4f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -148,21 +150,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o; - return Objects.equals(this.shapeType, equilateralTriangle.shapeType) && - Objects.equals(this.triangleType, equilateralTriangle.triangleType)&& - Objects.equals(this.additionalProperties, equilateralTriangle.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index ba770c57dd9b..b35606dfb0c2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -118,20 +120,12 @@ public void setFiles(@jakarta.annotation.Nullable List<@Valid ModelFile> files) */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this._file, fileSchemaTestClass._file) && - Objects.equals(this.files, fileSchemaTestClass.files); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_file, files); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java index 62210e1b6ce4..d0f4a278200d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Foo.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -74,19 +76,12 @@ public void setBar(@jakarta.annotation.Nullable String bar) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Foo foo = (Foo) o; - return Objects.equals(this.bar, foo.bar); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index c18b124e09af..ff6ef3437c26 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -77,19 +79,12 @@ public void setString(@jakarta.annotation.Nullable Foo string) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; - return Objects.equals(this.string, fooGetDefaultResponse.string); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(string); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java index a82a6a123b79..23bae6a2b07d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FormatTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -565,34 +567,12 @@ public void setPatternWithDigitsAndDelimiter(@jakarta.annotation.Nullable String */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.decimal, formatTest.decimal) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && - Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java index c819d5a93657..fed2a9288fad 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Fruit.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java index 17c9e85e05c1..c84f7a734393 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/FruitReq.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java index 36ffb634603e..5f1d0c0244ae 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GmFruit.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index fbbe6f2788a1..56c27efa3ee2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -88,19 +90,12 @@ public void setPetType(@jakarta.annotation.Nonnull String petType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GrandparentAnimal grandparentAnimal = (GrandparentAnimal) o; - return Objects.equals(this.petType, grandparentAnimal.petType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(petType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 2b6cd744bd21..7a4669ecd5af 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -96,20 +98,12 @@ public String getFoo() { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar, foo); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java index cb1d09c13c50..e4b40a5da077 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -85,14 +87,7 @@ public void setNullableMessage(@jakarta.annotation.Nullable String nullableMessa */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HealthCheckResult healthCheckResult = (HealthCheckResult) o; - return equalsNullable(this.nullableMessage, healthCheckResult.nullableMessage); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -101,7 +96,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(nullableMessage)); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index d116617abdd7..3274a6c2de5d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -107,20 +109,12 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IsoscelesTriangle isoscelesTriangle = (IsoscelesTriangle) o; - return Objects.equals(this.shapeType, isoscelesTriangle.shapeType) && - Objects.equals(this.triangleType, isoscelesTriangle.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java index 6b46ceee645b..dff17656315c 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Mammal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java index 90e11adaa73b..21af2f6a0ffb 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MammalAnyof.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java index 03f3eda9cc3c..6e4215d1e93d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MapTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -237,22 +239,12 @@ public void setIndirectMap(@jakarta.annotation.Nullable Map ind */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index eb9a5aef5007..a0849457b7d5 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -152,21 +154,12 @@ public void setMap(@jakarta.annotation.Nullable Map map) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(uuid, dateTime, map); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java index aabc6c471b2c..9d7b704fcd58 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Model200Response.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -106,20 +108,12 @@ public void setPropertyClass(@jakarta.annotation.Nullable String propertyClass) */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, propertyClass); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 33bdc417985e..2ed3b0d59f72 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -137,21 +139,12 @@ public void setMessage(@jakarta.annotation.Nullable String message) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(code, type, message); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java index 98a0e80e521d..ea54901098c8 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelFile.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -75,19 +77,12 @@ public void setSourceURI(@jakarta.annotation.Nullable String sourceURI) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(sourceURI); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java index 0434c06ae29c..fb84e33166e0 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelList.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -75,19 +77,12 @@ public void set123list(@jakarta.annotation.Nullable String _123list) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_123list); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java index 840f3dae748c..bc0267264958 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -75,19 +77,12 @@ public void setReturn(@jakarta.annotation.Nullable Integer _return) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_return); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java index 2bd14b77f3a1..bf7c1a23f05f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Name.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -158,22 +160,12 @@ public Integer get123number() { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java index 883f1cbba65c..ec8d3c13a93e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -604,26 +606,7 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NullableClass nullableClass = (NullableClass) o; - return equalsNullable(this.integerProp, nullableClass.integerProp) && - equalsNullable(this.numberProp, nullableClass.numberProp) && - equalsNullable(this.booleanProp, nullableClass.booleanProp) && - equalsNullable(this.stringProp, nullableClass.stringProp) && - equalsNullable(this.dateProp, nullableClass.dateProp) && - equalsNullable(this.datetimeProp, nullableClass.datetimeProp) && - equalsNullable(this.arrayNullableProp, nullableClass.arrayNullableProp) && - equalsNullable(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && - Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && - equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && - equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && - Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable)&& - Objects.equals(this.additionalProperties, nullableClass.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -632,7 +615,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java index 429b0dde63eb..b1def258839e 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NullableShape.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java index 2ce68e240848..be29d3d8a137 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -76,19 +78,12 @@ public void setJustNumber(@jakarta.annotation.Nullable BigDecimal justNumber) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(justNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index a79d8c67c625..af61194f8168 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -196,22 +198,12 @@ public void setBars(@jakarta.annotation.Nullable List bars) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; - return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && - Objects.equals(this.id, objectWithDeprecatedFields.id) && - Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && - Objects.equals(this.bars, objectWithDeprecatedFields.bars); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(uuid, id, deprecatedRef, bars); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java index 1205e73cfcf7..7990be6a7ce4 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Order.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -268,24 +270,12 @@ public void setComplete(@jakarta.annotation.Nullable Boolean complete) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java index 286cf92b75b8..a356b02afb94 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -138,21 +140,12 @@ public void setMyBoolean(@jakarta.annotation.Nullable Boolean myBoolean) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java index d1406d0afca8..ff6b4dff8e97 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java index e20841e97c8c..55e81d230056 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java index f7c3095b681b..55c38bd319f2 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java index 71b91d2f62b2..b6156de0ce6a 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java index 68ee6a8725e3..363d6876db9f 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ParentPet.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -97,18 +99,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java index 0db1e4785521..229b5c7cd9ed 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pet.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -290,24 +292,12 @@ public void setStatus(@jakarta.annotation.Nullable StatusEnum status) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java index 16cb5a576e22..ec067e21df82 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Pig.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java index 3d0dea5e0ce3..0bd869d79a06 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index b143ca302ec5..949b2c848752 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -75,19 +77,12 @@ public void setQuadrilateralType(@jakarta.annotation.Nonnull String quadrilatera */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QuadrilateralInterface quadrilateralInterface = (QuadrilateralInterface) o; - return Objects.equals(this.quadrilateralType, quadrilateralInterface.quadrilateralType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(quadrilateralType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 8cfa6a5ae6fc..25adc586f1da 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -103,20 +105,12 @@ public void setBaz(@jakarta.annotation.Nullable String baz) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar, baz); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 3714690b9482..9c57722230a1 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -148,21 +150,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o; - return Objects.equals(this.shapeType, scaleneTriangle.shapeType) && - Objects.equals(this.triangleType, scaleneTriangle.triangleType)&& - Objects.equals(this.additionalProperties, scaleneTriangle.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java index efa80a0e1e0f..aeab1549cc60 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Shape.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java index c24a869e117d..63d2b7745adb 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -75,19 +77,12 @@ public void setShapeType(@jakarta.annotation.Nonnull String shapeType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ShapeInterface shapeInterface = (ShapeInterface) o; - return Objects.equals(this.shapeType, shapeInterface.shapeType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 5bf7e3480669..a8dc52548452 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 7fd5a7fc8f6f..98fe5d7e3c45 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -148,21 +150,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o; - return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) && - Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType)&& - Objects.equals(this.additionalProperties, simpleQuadrilateral.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, quadrilateralType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java index ae88910475e1..409808085413 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -106,20 +108,12 @@ public void setSpecialModelName(@jakarta.annotation.Nullable String specialModel */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName) && - Objects.equals(this.specialModelName, specialModelName.specialModelName); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash($specialPropertyName, specialModelName); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java index 14fd4f1c7665..ba300d4c073d 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Tag.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -105,20 +107,12 @@ public void setName(@jakarta.annotation.Nullable String name) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, name); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index deeba97cf158..d9efa6f38b48 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -116,20 +118,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; - return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& - Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(someProperty, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java index 65bc16911cfa..1d54ef1adea1 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Triangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java index 374c74068280..eb2b25d202a1 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -75,19 +77,12 @@ public void setTriangleType(@jakarta.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TriangleInterface triangleInterface = (TriangleInterface) o; - return Objects.equals(this.triangleType, triangleInterface.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java index f515fdb5a1f7..8df0a4c4ca80 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/User.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -440,25 +442,7 @@ public void setAnyTypePropNullable(@jakarta.annotation.Nullable Object anyTypePr */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus) && - Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) && - equalsNullable(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) && - equalsNullable(this.anyTypeProp, user.anyTypeProp) && - equalsNullable(this.anyTypePropNullable, user.anyTypePropNullable); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -467,7 +451,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, hashCodeNullable(objectWithNoDeclaredPropsNullable), hashCodeNullable(anyTypeProp), hashCodeNullable(anyTypePropNullable)); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java index f82b8c58919a..2912a02ef2fd 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Whale.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -138,21 +140,12 @@ public void setClassName(@jakarta.annotation.Nonnull String className) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Whale whale = (Whale) o; - return Objects.equals(this.hasBaleen, whale.hasBaleen) && - Objects.equals(this.hasTeeth, whale.hasTeeth) && - Objects.equals(this.className, whale.className); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(hasBaleen, hasTeeth, className); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java index 7d2e7458855b..560538a81608 100644 --- a/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/jersey3/src/main/java/org/openapitools/client/model/Zebra.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -185,21 +187,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Zebra zebra = (Zebra) o; - return Objects.equals(this.type, zebra.type) && - Objects.equals(this.className, zebra.className)&& - Objects.equals(this.additionalProperties, zebra.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(type, className, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/build.gradle b/samples/client/petstore/java/native/build.gradle index ad4e835b7708..bdc8a7c7d512 100644 --- a/samples/client/petstore/java/native/build.gradle +++ b/samples/client/petstore/java/native/build.gradle @@ -71,6 +71,7 @@ ext { beanvalidation_version = "2.0.2" junit_version = "5.10.2" httpmime_version = "4.5.13" + commons_lang3_version = "3.17.0" } dependencies { @@ -82,6 +83,7 @@ dependencies { implementation "org.openapitools:jackson-databind-nullable:0.2.1" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" implementation "org.apache.httpcomponents:httpmime:$httpmime_version" + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" } diff --git a/samples/client/petstore/java/native/pom.xml b/samples/client/petstore/java/native/pom.xml index f5aa8987b095..68923150e4b7 100644 --- a/samples/client/petstore/java/native/pom.xml +++ b/samples/client/petstore/java/native/pom.xml @@ -239,6 +239,12 @@ httpmime ${httpmime-version} + + + org.apache.commons + commons-lang3 + ${commons-lang3-version} + @@ -258,6 +264,7 @@ 1.3.5 2.0.2 4.5.14 + 3.17.0 5.10.2 2.27.2 diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 76dc10c07a8b..599568bde9f2 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -321,21 +323,7 @@ public void setMapWithUndeclaredPropertiesString(@javax.annotation.Nullable Map< */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) && - equalsNullable(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) && - Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) && - Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -344,7 +332,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty, hashCodeNullable(anytype1), mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java index d1f3c98076fb..b94a0b477c59 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Animal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -116,20 +118,12 @@ public void setColor(@javax.annotation.Nullable String color) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(className, color); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Apple.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Apple.java index 1c61171ebe6c..7254eb1a7250 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Apple.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setOrigin(@javax.annotation.Nullable String origin) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Apple apple = (Apple) o; - return Objects.equals(this.cultivar, apple.cultivar) && - Objects.equals(this.origin, apple.origin); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(cultivar, origin); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AppleReq.java index a34652b3c109..c29b483efe47 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AppleReq.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setMealy(@javax.annotation.Nullable Boolean mealy) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AppleReq appleReq = (AppleReq) o; - return Objects.equals(this.cultivar, appleReq.cultivar) && - Objects.equals(this.mealy, appleReq.mealy); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(cultivar, mealy); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 9028a95c7d42..b0651d33cd8c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -84,19 +86,12 @@ public void setArrayArrayNumber(@javax.annotation.Nullable List */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayArrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 03e2f228771c..7d0e66aafd2f 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -84,19 +86,12 @@ public void setArrayNumber(@javax.annotation.Nullable List arrayNumb */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java index 234361daf01a..3fc422984c5a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -158,21 +160,12 @@ public void setArrayArrayOfModel(@javax.annotation.Nullable List boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -255,7 +245,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(mainShape, shapeOrNull, hashCodeNullable(nullableShape), shapes, super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java index 91d031f2d384..c8be0bc01545 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -182,20 +184,12 @@ public void setArrayEnum(@javax.annotation.Nullable List arrayEnu */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.java index 456228e0398f..799cc43f029b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java index a5b629557a10..84c1f7dbef64 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EnumTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -499,22 +501,7 @@ public void setOuterEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnum */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumIntegerOnly, enumTest.enumIntegerOnly) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - equalsNullable(this.outerEnum, enumTest.outerEnum) && - Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && - Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && - Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -523,7 +510,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumIntegerOnly, enumNumber, hashCodeNullable(outerEnum), outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 2033162fd120..e995ec26a551 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setTriangleType(@javax.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o; - return Objects.equals(this.shapeType, equilateralTriangle.shapeType) && - Objects.equals(this.triangleType, equilateralTriangle.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java index 24888be137f3..56df082222e8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -113,20 +115,12 @@ public void setSomeMap(@javax.annotation.Nullable Map someMa */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o; - return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) && - Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(someId, someMap); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 5a0e40370724..5bd7e5480dd3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -113,20 +115,12 @@ public void setFiles(@javax.annotation.Nullable List files) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this._file, fileSchemaTestClass._file) && - Objects.equals(this.files, fileSchemaTestClass.files); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_file, files); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Foo.java index baf2ad201972..f626dd429df8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Foo.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setBar(@javax.annotation.Nullable String bar) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Foo foo = (Foo) o; - return Objects.equals(this.bar, foo.bar); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 63ff6395a1e5..77541ddac031 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -74,19 +76,12 @@ public void setString(@javax.annotation.Nullable Foo string) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; - return Objects.equals(this.string, fooGetDefaultResponse.string); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(string); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java index 3bb358c894a1..06081ade5c97 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FormatTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -523,34 +525,12 @@ public void setPatternWithDigitsAndDelimiter(@javax.annotation.Nullable String p */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.decimal, formatTest.decimal) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && - Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java index 657dfc19c850..7076e9cfc827 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Fruit.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java index 66a63ec9eb0f..253518900575 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FruitReq.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java index 6b3ba6739e35..5d32e6502769 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GmFruit.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 4d5c1dcadf07..d7861e6bc4e5 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -87,19 +89,12 @@ public void setPetType(@javax.annotation.Nonnull String petType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GrandparentAnimal grandparentAnimal = (GrandparentAnimal) o; - return Objects.equals(this.petType, grandparentAnimal.petType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(petType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 26ce80f3fc92..36059dcb94f3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -92,20 +94,12 @@ public String getFoo() { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar, foo); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 128a16915fbb..dc73ce1cd163 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -84,14 +86,7 @@ public void setNullableMessage(@javax.annotation.Nullable String nullableMessage */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HealthCheckResult healthCheckResult = (HealthCheckResult) o; - return equalsNullable(this.nullableMessage, healthCheckResult.nullableMessage); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -100,7 +95,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(nullableMessage)); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 640a0091b9aa..2ce076ed6eb1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setTriangleType(@javax.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IsoscelesTriangle isoscelesTriangle = (IsoscelesTriangle) o; - return Objects.equals(this.shapeType, isoscelesTriangle.shapeType) && - Objects.equals(this.triangleType, isoscelesTriangle.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java index 727d75d58098..903b59b8f06a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Mammal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java index e8ab4903c9f7..199a4599163e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MapTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -229,22 +231,12 @@ public void setIndirectMap(@javax.annotation.Nullable Map indir */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9b8ea43fb256..58b3b554af24 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -144,21 +146,12 @@ public void setMap(@javax.annotation.Nullable Map map) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(uuid, dateTime, map); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java index a587abd842bb..71fac698fae0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Model200Response.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, propertyClass); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java index f1a305ac8130..b5972d9c1c33 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -131,21 +133,12 @@ public void setMessage(@javax.annotation.Nullable String message) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(code, type, message); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java index 2cbb873e1bbc..833706d38750 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelFile.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setSourceURI(@javax.annotation.Nullable String sourceURI) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(sourceURI); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java index 688bd3a492bd..3267f84f60a8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelList.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void set123list(@javax.annotation.Nullable String _123list) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_123list); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java index 8afe2aa291cb..3e40db3fbfae 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setReturn(@javax.annotation.Nullable Integer _return) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_return); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java index 254eb93783dc..038ad7859f90 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Name.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -150,22 +152,12 @@ public Integer get123number() { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java index 9cc1aec009d9..00551c478190 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -584,27 +586,7 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NullableClass nullableClass = (NullableClass) o; - return equalsNullable(this.integerProp, nullableClass.integerProp) && - equalsNullable(this.numberProp, nullableClass.numberProp) && - equalsNullable(this.booleanProp, nullableClass.booleanProp) && - equalsNullable(this.stringProp, nullableClass.stringProp) && - equalsNullable(this.dateProp, nullableClass.dateProp) && - equalsNullable(this.datetimeProp, nullableClass.datetimeProp) && - equalsNullable(this.arrayNullableProp, nullableClass.arrayNullableProp) && - equalsNullable(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && - Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && - equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && - equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && - Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable)&& - Objects.equals(this.additionalProperties, nullableClass.additionalProperties) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -613,7 +595,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java index 69337631f598..1010877832f5 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NullableShape.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java index 311bddd0737b..ee0cbaa9b284 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -74,19 +76,12 @@ public void setJustNumber(@javax.annotation.Nullable BigDecimal justNumber) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(justNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index 9f22ac33b402..9a22c13d20b0 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -178,22 +180,12 @@ public void setBars(@javax.annotation.Nullable List bars) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; - return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && - Objects.equals(this.id, objectWithDeprecatedFields.id) && - Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && - Objects.equals(this.bars, objectWithDeprecatedFields.bars); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(uuid, id, deprecatedRef, bars); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java index 3ba6eeb6d87c..93c7ad4b17b2 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Order.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -256,24 +258,12 @@ public void setComplete(@javax.annotation.Nullable Boolean complete) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java index da51395e38f7..e5f001062f03 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -132,21 +134,12 @@ public void setMyBoolean(@javax.annotation.Nullable Boolean myBoolean) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.java index 8a5b13cb19c1..27626a28cd0d 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java index 284de643c1ad..f4fa162b0351 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumInteger.java index ac32ba440077..9e3ec295345e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumInteger.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java index 356b2635800e..f3cdf262a274 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java index 93528aa7d7d2..9d4b9e660b47 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ParentPet.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -64,18 +66,12 @@ public ParentPet petType(@javax.annotation.Nonnull String petType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(super.hashCode()); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java index d5b671856b55..ae945f391b6a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pet.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -275,24 +277,12 @@ public void setStatus(@javax.annotation.Nullable StatusEnum status) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java index 4ee5c3fc43c8..ff075735ed66 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Pig.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java index b2a851b351fb..754046b4c83e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index ca89b2c6f144..3b14b5e07bf1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralT */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QuadrilateralInterface quadrilateralInterface = (QuadrilateralInterface) o; - return Objects.equals(this.quadrilateralType, quadrilateralInterface.quadrilateralType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(quadrilateralType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index c3c0fff1d5c8..4c02d91cfb2b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -100,20 +102,12 @@ public void setBaz(@javax.annotation.Nullable String baz) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar, baz); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index d72f51aecf74..505a2129d344 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setTriangleType(@javax.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o; - return Objects.equals(this.shapeType, scaleneTriangle.shapeType) && - Objects.equals(this.triangleType, scaleneTriangle.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java index 6a44b5a721ea..b16d6bc49176 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Shape.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java index 41fcfc600691..75d01e3b7380 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setShapeType(@javax.annotation.Nonnull String shapeType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ShapeInterface shapeInterface = (ShapeInterface) o; - return Objects.equals(this.shapeType, shapeInterface.shapeType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java index 07f9a1bd3aa5..bab94a62534b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 98b7071d41fc..782aa3c8dfb9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralT */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o; - return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) && - Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, quadrilateralType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java index 12a839c0a153..8f7abe06d9ea 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setSpecialModelName(@javax.annotation.Nullable String specialModelNa */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName) && - Objects.equals(this.specialModelName, specialModelName.specialModelName); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash($specialPropertyName, specialModelName); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java index 5f7135324b9d..83c49d2caa09 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Tag.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -102,20 +104,12 @@ public void setName(@javax.annotation.Nullable String name) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, name); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 0fd01ccbd17e..ed333dcabd4b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -122,21 +124,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; - return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& - Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(someProperty, super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java index d97ae14675f0..d67364ded19a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Triangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TriangleInterface.java index b8c67a63ab6f..774f2324463c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -73,19 +75,12 @@ public void setTriangleType(@javax.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TriangleInterface triangleInterface = (TriangleInterface) o; - return Objects.equals(this.triangleType, triangleInterface.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java index 12e3f8ce519f..2ead11d78b60 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/User.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -417,25 +419,7 @@ public void setAnyTypePropNullable(@javax.annotation.Nullable Object anyTypeProp */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus) && - Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) && - equalsNullable(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) && - equalsNullable(this.anyTypeProp, user.anyTypeProp) && - equalsNullable(this.anyTypePropNullable, user.anyTypePropNullable); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -444,7 +428,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, hashCodeNullable(objectWithNoDeclaredPropsNullable), hashCodeNullable(anyTypeProp), hashCodeNullable(anyTypePropNullable)); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Whale.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Whale.java index be60877fab8c..7d49c88d862e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Whale.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; import java.util.StringJoiner; @@ -131,21 +133,12 @@ public void setClassName(@javax.annotation.Nonnull String className) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Whale whale = (Whale) o; - return Objects.equals(this.hasBaleen, whale.hasBaleen) && - Objects.equals(this.hasTeeth, whale.hasTeeth) && - Objects.equals(this.className, whale.className); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(hasBaleen, hasTeeth, className); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Zebra.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Zebra.java index 9e1fbf95636f..fbd174fee928 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Zebra.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -188,22 +190,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Zebra zebra = (Zebra) o; - return Objects.equals(this.type, zebra.type) && - Objects.equals(this.className, zebra.className)&& - Objects.equals(this.additionalProperties, zebra.additionalProperties) && - super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(type, className, super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/client/petstore/java/okhttp-gson-3.1/build.gradle b/samples/client/petstore/java/okhttp-gson-3.1/build.gradle index f2a6e8e06eb7..3481d0b7c6fc 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-3.1/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-3.1/build.sbt b/samples/client/petstore/java/okhttp-gson-3.1/build.sbt index fc99baef382c..a4ec728212aa 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-3.1/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-3.1/pom.xml b/samples/client/petstore/java/okhttp-gson-3.1/pom.xml index f35785a5ecf9..2834afabd935 100644 --- a/samples/client/petstore/java/okhttp-gson-3.1/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-3.1/pom.xml @@ -331,7 +331,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle index 9efe9b9f0a0e..96bee6a6a581 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.gradle @@ -116,7 +116,7 @@ dependencies { implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation 'software.amazon.awssdk:auth:2.20.157' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt index 993651032ca7..ca9e47046395 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "software.amazon.awssdk" % "auth" % "2.20.157", diff --git a/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml b/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml index 4d1adf440d55..fcca932920ac 100644 --- a/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-awsv4signature/pom.xml @@ -336,7 +336,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle index df040d5aac19..ff5a6701b9e7 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation 'io.swagger.parser.v3:swagger-parser-v3:2.0.30' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt index fe2edb8e3f11..35c2e615d1f3 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml index 093370ee3238..922ba2a9ba6e 100644 --- a/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-dynamicOperations/pom.xml @@ -336,7 +336,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle index 23a62038557c..07ac6648265f 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt b/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt index 824632fc6621..baea7b60bf0b 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml b/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml index ad5944f75711..a3cb5d2afac0 100644 --- a/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-group-parameter/pom.xml @@ -331,7 +331,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle b/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle index d52a031af35f..add44e0ec5fc 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt b/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt index f0b139580df4..cd615f72411c 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml b/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml index ea83c53acf89..7a2c9e5acd80 100644 --- a/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-nullable-required/pom.xml @@ -331,7 +331,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle index 51ba39863b41..aa345bbc8a92 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index f93a3516af95..4af66177f326 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 8f24c134707b..bb09a11bde8a 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -338,7 +338,7 @@ 1.9.0 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle b/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle index 5ce050edbdd4..bfee284c1c6f 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-swagger1/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt b/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt index ce7b54dda966..ce1336dd084f 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-swagger1/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml b/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml index e7d136d699ce..938900a24d6e 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-swagger1/pom.xml @@ -337,7 +337,7 @@ 1.6.6 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle b/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle index 5ce050edbdd4..bfee284c1c6f 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle +++ b/samples/client/petstore/java/okhttp-gson-swagger2/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt b/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt index ce7b54dda966..ce1336dd084f 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-swagger2/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml b/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml index 5cab5823b798..fda28b6c3132 100644 --- a/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-swagger2/pom.xml @@ -337,7 +337,7 @@ 2.2.15 4.12.0 2.10.1 - 3.14.0 + 3.17.0 0.2.6 1.3.5 2.0.2 diff --git a/samples/client/petstore/java/okhttp-gson/build.gradle b/samples/client/petstore/java/okhttp-gson/build.gradle index 5ce050edbdd4..bfee284c1c6f 100644 --- a/samples/client/petstore/java/okhttp-gson/build.gradle +++ b/samples/client/petstore/java/okhttp-gson/build.gradle @@ -115,7 +115,7 @@ dependencies { implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6' implementation 'org.openapitools:jackson-databind-nullable:0.2.6' implementation group: 'org.apache.oltu.oauth2', name: 'org.apache.oltu.oauth2.client', version: '1.0.2' - implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0' + implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0' implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3' testImplementation 'org.mockito:mockito-core:3.12.4' diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index ce7b54dda966..ce1336dd084f 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp3" % "okhttp" % "4.12.0", "com.squareup.okhttp3" % "logging-interceptor" % "4.12.0", "com.google.code.gson" % "gson" % "2.9.1", - "org.apache.commons" % "commons-lang3" % "3.12.0", + "org.apache.commons" % "commons-lang3" % "3.17.0", "jakarta.ws.rs" % "jakarta.ws.rs-api" % "2.1.6", "org.openapitools" % "jackson-databind-nullable" % "0.2.6", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.2", diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle index e395c9d2d6fa..da665aa10774 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.gradle @@ -107,6 +107,7 @@ ext { junit_version = "5.8.2" scribejava_apis_version = "8.3.1" tomitribe_http_signatures_version = "1.7" + commons_lang3_version = "3.17.0" } dependencies { @@ -125,6 +126,7 @@ dependencies { implementation "com.github.scribejava:scribejava-apis:$scribejava_apis_version" implementation "org.tomitribe:tomitribe-http-signatures:$tomitribe_http_signatures_version" implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version" + implementation "org.apache.commons:commons-lang3:$commons_lang3_version" testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version" testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_version" } diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt index 73d21d4824b4..873fe19c3f15 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/openapi3/client/petstore/java/jersey2-java8/build.sbt @@ -24,6 +24,7 @@ lazy val root = (project in file(".")). "com.github.scribejava" % "scribejava-apis" % "8.3.1" % "compile", "org.tomitribe" % "tomitribe-http-signatures" % "1.7" % "compile", "jakarta.annotation" % "jakarta.annotation-api" % "1.3.5" % "compile", + "org.apache.commons" % "commons-lang3" % "3.17.0" % "compile", "org.junit.jupiter" % "junit-jupiter-api" % "5.8.2" % "test" ) ) diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java index 43745cdf21ae..4bfe6ff4da78 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -326,21 +328,7 @@ public void setMapWithUndeclaredPropertiesString(@javax.annotation.Nullable Map< */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && - Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty) && - equalsNullable(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype1, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype1) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype2, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype2) && - Objects.equals(this.mapWithUndeclaredPropertiesAnytype3, additionalPropertiesClass.mapWithUndeclaredPropertiesAnytype3) && - Objects.equals(this.emptyMap, additionalPropertiesClass.emptyMap) && - Objects.equals(this.mapWithUndeclaredPropertiesString, additionalPropertiesClass.mapWithUndeclaredPropertiesString); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -349,7 +337,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty, hashCodeNullable(anytype1), mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java index 4d2ce0fec2e7..7f217ced6c59 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Animal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -114,20 +116,12 @@ public void setColor(@javax.annotation.Nullable String color) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(className, color); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java index e53e2e86c5d3..a486705a439b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Apple.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -102,20 +104,12 @@ public void setOrigin(@javax.annotation.Nullable String origin) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Apple apple = (Apple) o; - return Objects.equals(this.cultivar, apple.cultivar) && - Objects.equals(this.origin, apple.origin); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(cultivar, origin); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java index 8557a52e9948..8ed48f4669f4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/AppleReq.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -102,20 +104,12 @@ public void setMealy(@javax.annotation.Nullable Boolean mealy) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AppleReq appleReq = (AppleReq) o; - return Objects.equals(this.cultivar, appleReq.cultivar) && - Objects.equals(this.mealy, appleReq.mealy); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(cultivar, mealy); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java index 5510fb44e7cd..6e6180d6ad5c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -82,19 +84,12 @@ public void setArrayArrayNumber(@javax.annotation.Nullable List */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayArrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java index 2d594551dab5..c0ad5cab87b2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -82,19 +84,12 @@ public void setArrayNumber(@javax.annotation.Nullable List arrayNumb */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(arrayNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java index 3ae301ac9bf7..47a40e040007 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ArrayTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -158,21 +160,12 @@ public void setArrayArrayOfModel(@javax.annotation.Nullable List boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -254,7 +245,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(mainShape, hashCodeNullable(shapeOrNull), hashCodeNullable(nullableShape), shapes, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java index 6238af12763a..6702d2f72756 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumArrays.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -181,20 +183,12 @@ public void setArrayEnum(@javax.annotation.Nullable List arrayEnu */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java index 0150ebe31b41..4f09e72dbe2c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java index 59c58ab91ebe..2cf366f2620a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EnumTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -506,22 +508,7 @@ public void setOuterEnumIntegerDefaultValue(@javax.annotation.Nullable OuterEnum */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumIntegerOnly, enumTest.enumIntegerOnly) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - equalsNullable(this.outerEnum, enumTest.outerEnum) && - Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && - Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && - Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -530,7 +517,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumIntegerOnly, enumNumber, hashCodeNullable(outerEnum), outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java index 1c31a6c15b79..e99102bea3a3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/EquilateralTriangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -142,21 +144,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EquilateralTriangle equilateralTriangle = (EquilateralTriangle) o; - return Objects.equals(this.shapeType, equilateralTriangle.shapeType) && - Objects.equals(this.triangleType, equilateralTriangle.triangleType)&& - Objects.equals(this.additionalProperties, equilateralTriangle.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java index 170ad2b8b492..8ecdae1cb265 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -112,20 +114,12 @@ public void setFiles(@javax.annotation.Nullable List files) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this._file, fileSchemaTestClass._file) && - Objects.equals(this.files, fileSchemaTestClass.files); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_file, files); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java index c3d7e4aa3d8c..6f4e938ed9ac 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Foo.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -71,19 +73,12 @@ public void setBar(@javax.annotation.Nullable String bar) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Foo foo = (Foo) o; - return Objects.equals(this.bar, foo.bar); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java index 986bb8b5d00c..d02039382f20 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -73,19 +75,12 @@ public void setString(@javax.annotation.Nullable Foo string) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; - return Objects.equals(this.string, fooGetDefaultResponse.string); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(string); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java index a51743669e2c..078dea2c5b63 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FormatTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -537,34 +539,12 @@ public void setPatternWithDigitsAndDelimiter(@javax.annotation.Nullable String p */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.decimal, formatTest.decimal) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && - Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java index e0063f25c61c..9fbfd53e52fc 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Fruit.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java index 528c23fefd39..52ba66ff1266 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/FruitReq.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java index d2e59719e3b5..38aa06694ca3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GmFruit.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java index 4512e112c8d4..73270e37e9a1 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/GrandparentAnimal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -84,19 +86,12 @@ public void setPetType(@javax.annotation.Nonnull String petType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - GrandparentAnimal grandparentAnimal = (GrandparentAnimal) o; - return Objects.equals(this.petType, grandparentAnimal.petType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(petType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java index 10721debfd1d..c5d036e8ee7f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -92,20 +94,12 @@ public String getFoo() { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar, foo); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java index 547f0d1bc849..bc9625b44e9b 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/HealthCheckResult.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -82,14 +84,7 @@ public void setNullableMessage(@javax.annotation.Nullable String nullableMessage */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HealthCheckResult healthCheckResult = (HealthCheckResult) o; - return equalsNullable(this.nullableMessage, healthCheckResult.nullableMessage); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -98,7 +93,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(nullableMessage)); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java index 741c289a890f..cccace584b0a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/IsoscelesTriangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -101,20 +103,12 @@ public void setTriangleType(@javax.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - IsoscelesTriangle isoscelesTriangle = (IsoscelesTriangle) o; - return Objects.equals(this.shapeType, isoscelesTriangle.shapeType) && - Objects.equals(this.triangleType, isoscelesTriangle.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java index 7b007cb213a2..6d1c1769c6c2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Mammal.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java index 42b10eb69ada..708b89790b36 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MammalAnyof.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java index dffb29de558f..141884a7f7ee 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MapTest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -230,22 +232,12 @@ public void setIndirectMap(@javax.annotation.Nullable Map indir */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java index 0cdae9a6d433..f84af4b6aa94 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -144,21 +146,12 @@ public void setMap(@javax.annotation.Nullable Map map) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(uuid, dateTime, map); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java index 35c20d8ca6a8..cf03abcff2fb 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Model200Response.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -102,20 +104,12 @@ public void setPropertyClass(@javax.annotation.Nullable String propertyClass) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, propertyClass); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java index 15a4a419b283..8ffcda988793 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelApiResponse.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -132,21 +134,12 @@ public void setMessage(@javax.annotation.Nullable String message) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(code, type, message); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java index b9a89f3a17e4..2a9a907e327c 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelFile.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -72,19 +74,12 @@ public void setSourceURI(@javax.annotation.Nullable String sourceURI) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(sourceURI); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java index 1b91713f4454..eeedd9dd4ba9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelList.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -72,19 +74,12 @@ public void set123list(@javax.annotation.Nullable String _123list) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_123list); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java index 96d2ac44fe71..b3b8b7d9d1bd 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ModelReturn.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -72,19 +74,12 @@ public void setReturn(@javax.annotation.Nullable Integer _return) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(_return); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java index 56f543a8e558..7c709b7b4374 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Name.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -151,22 +153,12 @@ public Integer get123number() { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java index f5617df68849..443983c9fdb7 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableClass.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -587,26 +589,7 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NullableClass nullableClass = (NullableClass) o; - return equalsNullable(this.integerProp, nullableClass.integerProp) && - equalsNullable(this.numberProp, nullableClass.numberProp) && - equalsNullable(this.booleanProp, nullableClass.booleanProp) && - equalsNullable(this.stringProp, nullableClass.stringProp) && - equalsNullable(this.dateProp, nullableClass.dateProp) && - equalsNullable(this.datetimeProp, nullableClass.datetimeProp) && - equalsNullable(this.arrayNullableProp, nullableClass.arrayNullableProp) && - equalsNullable(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && - Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && - equalsNullable(this.objectNullableProp, nullableClass.objectNullableProp) && - equalsNullable(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && - Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable)&& - Objects.equals(this.additionalProperties, nullableClass.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -615,7 +598,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(hashCodeNullable(integerProp), hashCodeNullable(numberProp), hashCodeNullable(booleanProp), hashCodeNullable(stringProp), hashCodeNullable(dateProp), hashCodeNullable(datetimeProp), hashCodeNullable(arrayNullableProp), hashCodeNullable(arrayAndItemsNullableProp), arrayItemsNullable, hashCodeNullable(objectNullableProp), hashCodeNullable(objectAndItemsNullableProp), objectItemsNullable, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java index f948d1e5e50f..bec64556a9b6 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NullableShape.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java index 4a496bd97f4c..31fe42147472 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/NumberOnly.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -72,19 +74,12 @@ public void setJustNumber(@javax.annotation.Nullable BigDecimal justNumber) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(justNumber); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java index e6c33ef2e1dd..de28645a6874 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -188,22 +190,12 @@ public void setBars(@javax.annotation.Nullable List bars) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; - return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && - Objects.equals(this.id, objectWithDeprecatedFields.id) && - Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && - Objects.equals(this.bars, objectWithDeprecatedFields.bars); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(uuid, id, deprecatedRef, bars); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java index 6193d72decd2..9902b3c466d2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Order.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -259,24 +261,12 @@ public void setComplete(@javax.annotation.Nullable Boolean complete) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java index 26773fbe640b..70a43c2a0c86 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterComposite.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -132,21 +134,12 @@ public void setMyBoolean(@javax.annotation.Nullable Boolean myBoolean) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java index d50018b999d5..608bb2c96897 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnum.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java index 73020e1e3b87..25b3940b7490 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumDefaultValue.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java index a83925c58695..c3072f8a0ae4 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumInteger.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java index 383ca4227422..0d894f96178d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/OuterEnumIntegerDefaultValue.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java index 7e9f542d0c0e..a5d08c1d752f 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ParentPet.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -95,18 +97,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(super.hashCode(), additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java index 1a2bbc67b03e..914785f40506 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pet.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -278,24 +280,12 @@ public void setStatus(@javax.annotation.Nullable StatusEnum status) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java index ed0f54318a1c..9ead76fb3db2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Pig.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java index 772923318677..4c057de95478 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Quadrilateral.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java index 7d2f4602c43a..179430a039a2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/QuadrilateralInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -71,19 +73,12 @@ public void setQuadrilateralType(@javax.annotation.Nonnull String quadrilateralT */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - QuadrilateralInterface quadrilateralInterface = (QuadrilateralInterface) o; - return Objects.equals(this.quadrilateralType, quadrilateralInterface.quadrilateralType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(quadrilateralType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java index 1900fe83eedb..63e9d3c76813 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -99,20 +101,12 @@ public void setBaz(@javax.annotation.Nullable String baz) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(bar, baz); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java index 757ca96e161f..fff63ed6fc29 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ScaleneTriangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -142,21 +144,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ScaleneTriangle scaleneTriangle = (ScaleneTriangle) o; - return Objects.equals(this.shapeType, scaleneTriangle.shapeType) && - Objects.equals(this.triangleType, scaleneTriangle.triangleType)&& - Objects.equals(this.additionalProperties, scaleneTriangle.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, triangleType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java index 001b0b8e4b28..574712cbd16a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Shape.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java index 1ca563f30480..e8fe2c342ba8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -71,19 +73,12 @@ public void setShapeType(@javax.annotation.Nonnull String shapeType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ShapeInterface shapeInterface = (ShapeInterface) o; - return Objects.equals(this.shapeType, shapeInterface.shapeType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java index a9e0c8e3e7dc..ab031659017a 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/ShapeOrNull.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java index 9b4b85607a6f..9a8798ee37e8 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SimpleQuadrilateral.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -142,21 +144,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SimpleQuadrilateral simpleQuadrilateral = (SimpleQuadrilateral) o; - return Objects.equals(this.shapeType, simpleQuadrilateral.shapeType) && - Objects.equals(this.quadrilateralType, simpleQuadrilateral.quadrilateralType)&& - Objects.equals(this.additionalProperties, simpleQuadrilateral.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(shapeType, quadrilateralType, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java index d2ee2257b9cf..a938622d429e 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/SpecialModelName.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -102,20 +104,12 @@ public void setSpecialModelName(@javax.annotation.Nullable String specialModelNa */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName) && - Objects.equals(this.specialModelName, specialModelName.specialModelName); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash($specialPropertyName, specialModelName); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java index ebad74cb005e..f75d60741ba9 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Tag.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -101,20 +103,12 @@ public void setName(@javax.annotation.Nullable String name) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(id, name); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java index 2fed072b1e7e..08c15e10f2ab 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -113,20 +115,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; - return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty)&& - Objects.equals(this.additionalProperties, testInlineFreeformAdditionalPropertiesRequest.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(someProperty, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java index d073c8a5133f..4620db38bb0d 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Triangle.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java index b736e78ae309..309a695e57e3 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/TriangleInterface.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -71,19 +73,12 @@ public void setTriangleType(@javax.annotation.Nonnull String triangleType) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TriangleInterface triangleInterface = (TriangleInterface) o; - return Objects.equals(this.triangleType, triangleInterface.triangleType); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(triangleType); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java index 2a11183ef575..966580fac007 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/User.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -426,25 +428,7 @@ public void setAnyTypePropNullable(@javax.annotation.Nullable Object anyTypeProp */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus) && - Objects.equals(this.objectWithNoDeclaredProps, user.objectWithNoDeclaredProps) && - equalsNullable(this.objectWithNoDeclaredPropsNullable, user.objectWithNoDeclaredPropsNullable) && - equalsNullable(this.anyTypeProp, user.anyTypeProp) && - equalsNullable(this.anyTypePropNullable, user.anyTypePropNullable); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } private static boolean equalsNullable(JsonNullable a, JsonNullable b) { @@ -453,7 +437,7 @@ private static boolean equalsNullable(JsonNullable a, JsonNullable b) @Override public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, hashCodeNullable(objectWithNoDeclaredPropsNullable), hashCodeNullable(anyTypeProp), hashCodeNullable(anyTypePropNullable)); + return HashCodeBuilder.reflectionHashCode(this); } private static int hashCodeNullable(JsonNullable a) { diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java index 192047427435..cde2b928c0e2 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Whale.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Objects; import java.util.Map; import java.util.HashMap; @@ -132,21 +134,12 @@ public void setClassName(@javax.annotation.Nonnull String className) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Whale whale = (Whale) o; - return Objects.equals(this.hasBaleen, whale.hasBaleen) && - Objects.equals(this.hasTeeth, whale.hasTeeth) && - Objects.equals(this.className, whale.className); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(hasBaleen, hasTeeth, className); + return HashCodeBuilder.reflectionHashCode(this); } @Override diff --git a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java index f408a6fac662..aa0cfeb44570 100644 --- a/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java +++ b/samples/openapi3/client/petstore/java/jersey2-java8/src/main/java/org/openapitools/client/model/Zebra.java @@ -13,6 +13,8 @@ package org.openapitools.client.model; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; import java.util.Map; import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonAnyGetter; @@ -180,21 +182,12 @@ public Object getAdditionalProperty(String key) { */ @Override public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Zebra zebra = (Zebra) o; - return Objects.equals(this.type, zebra.type) && - Objects.equals(this.className, zebra.className)&& - Objects.equals(this.additionalProperties, zebra.additionalProperties); + return EqualsBuilder.reflectionEquals(this, o, false, null, true); } @Override public int hashCode() { - return Objects.hash(type, className, additionalProperties); + return HashCodeBuilder.reflectionHashCode(this); } @Override