From 485d50bbde417044f8aabaef76dee906afc6798c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 8 Feb 2023 14:51:21 +0800 Subject: [PATCH] apply spotless --- .../org/openapitools/client/ApiClient.java | 747 ++-- .../org/openapitools/client/ApiException.java | 20 +- .../org/openapitools/client/ApiResponse.java | 10 +- .../openapitools/client/Configuration.java | 11 +- .../java/org/openapitools/client/JSON.java | 421 ++- .../java/org/openapitools/client/Pair.java | 5 +- .../client/RFC3339DateFormat.java | 57 +- .../client/ServerConfiguration.java | 23 +- .../openapitools/client/ServerVariable.java | 8 +- .../client/api/AnotherFakeApi.java | 247 +- .../openapitools/client/api/DefaultApi.java | 215 +- .../org/openapitools/client/api/FakeApi.java | 3199 +++++++++-------- .../client/api/FakeClassnameTags123Api.java | 244 +- .../org/openapitools/client/api/PetApi.java | 1726 ++++----- .../org/openapitools/client/api/StoreApi.java | 659 ++-- .../org/openapitools/client/api/UserApi.java | 1319 ++++--- .../client/model/AbstractOpenApiSchema.java | 38 +- .../model/AdditionalPropertiesAnyType.java | 243 +- .../model/AdditionalPropertiesArray.java | 243 +- .../model/AdditionalPropertiesBoolean.java | 243 +- .../model/AdditionalPropertiesClass.java | 916 ++--- .../model/AdditionalPropertiesInteger.java | 243 +- .../model/AdditionalPropertiesNumber.java | 243 +- .../model/AdditionalPropertiesObject.java | 243 +- .../model/AdditionalPropertiesString.java | 243 +- .../client/model/AllOfWithSingleRef.java | 300 +- .../org/openapitools/client/model/Animal.java | 350 +- .../org/openapitools/client/model/Apple.java | 306 +- .../openapitools/client/model/AppleReq.java | 306 +- .../client/model/ArrayDefaultValue.java | 284 +- .../model/ArrayOfArrayOfNumberOnly.java | 269 +- .../client/model/ArrayOfNumberOnly.java | 269 +- .../openapitools/client/model/ArrayTest.java | 476 +-- .../org/openapitools/client/model/Banana.java | 239 +- .../openapitools/client/model/BananaReq.java | 308 +- .../openapitools/client/model/BasquePig.java | 238 +- .../org/openapitools/client/model/BigCat.java | 249 +- .../client/model/BigCatAllOf.java | 215 +- .../client/model/Capitalization.java | 594 +-- .../org/openapitools/client/model/Cat.java | 300 +- .../openapitools/client/model/CatAllOf.java | 237 +- .../openapitools/client/model/Category.java | 305 +- .../openapitools/client/model/ChildCat.java | 368 +- .../client/model/ChildCatAllOf.java | 329 +- .../openapitools/client/model/ClassModel.java | 239 +- .../org/openapitools/client/model/Client.java | 237 +- .../client/model/ComplexQuadrilateral.java | 310 +- .../openapitools/client/model/DanishPig.java | 238 +- .../client/model/DeprecatedObject.java | 234 +- .../org/openapitools/client/model/Dog.java | 300 +- .../openapitools/client/model/DogAllOf.java | 237 +- .../openapitools/client/model/Drawing.java | 601 ++-- .../openapitools/client/model/EnumArrays.java | 457 ++- .../openapitools/client/model/EnumClass.java | 95 +- .../openapitools/client/model/EnumTest.java | 1140 +++--- .../client/model/EquilateralTriangle.java | 308 +- .../client/model/FileSchemaTestClass.java | 331 +- .../org/openapitools/client/model/Foo.java | 237 +- .../client/model/FooGetDefaultResponse.java | 230 +- .../openapitools/client/model/FormatTest.java | 1326 +++---- .../org/openapitools/client/model/Fruit.java | 219 +- .../openapitools/client/model/FruitReq.java | 220 +- .../openapitools/client/model/GmFruit.java | 75 +- .../client/model/GrandparentAnimal.java | 280 +- .../client/model/HasOnlyReadOnly.java | 284 +- .../client/model/HealthCheckResult.java | 284 +- .../client/model/IsoscelesTriangle.java | 308 +- .../org/openapitools/client/model/Mammal.java | 273 +- .../openapitools/client/model/MapTest.java | 623 ++-- ...ropertiesAndAdditionalPropertiesClass.java | 410 +-- .../client/model/Model200Response.java | 307 +- .../client/model/ModelApiResponse.java | 375 +- .../openapitools/client/model/ModelFile.java | 238 +- .../openapitools/client/model/ModelList.java | 237 +- .../client/model/ModelReturn.java | 237 +- .../org/openapitools/client/model/Name.java | 425 +-- .../client/model/NullableClass.java | 1446 ++++---- .../client/model/NullableShape.java | 222 +- .../openapitools/client/model/NumberOnly.java | 240 +- .../model/ObjectWithDeprecatedFields.java | 482 +-- .../org/openapitools/client/model/Order.java | 655 ++-- .../client/model/OuterComposite.java | 378 +- .../openapitools/client/model/OuterEnum.java | 95 +- .../client/model/OuterEnumDefaultValue.java | 95 +- .../client/model/OuterEnumInteger.java | 95 +- .../model/OuterEnumIntegerDefaultValue.java | 95 +- .../model/OuterObjectWithEnumProperty.java | 238 +- .../openapitools/client/model/ParentPet.java | 223 +- .../org/openapitools/client/model/Pet.java | 706 ++-- .../org/openapitools/client/model/Pig.java | 221 +- .../client/model/Quadrilateral.java | 232 +- .../client/model/QuadrilateralInterface.java | 241 +- .../client/model/ReadOnlyFirst.java | 300 +- .../client/model/ScaleneTriangle.java | 308 +- .../org/openapitools/client/model/Shape.java | 217 +- .../client/model/ShapeInterface.java | 238 +- .../client/model/ShapeOrNull.java | 218 +- .../client/model/SimpleQuadrilateral.java | 310 +- .../client/model/SingleRefType.java | 93 +- .../client/model/SpecialModelName.java | 311 +- .../org/openapitools/client/model/Tag.java | 305 +- .../openapitools/client/model/Triangle.java | 280 +- .../client/model/TriangleInterface.java | 239 +- .../client/model/TypeHolderDefault.java | 389 +- .../client/model/TypeHolderExample.java | 447 ++- .../org/openapitools/client/model/User.java | 1133 +++--- .../org/openapitools/client/model/Whale.java | 377 +- .../openapitools/client/model/XmlItem.java | 1914 +++++----- .../org/openapitools/client/model/Zebra.java | 468 ++- .../client/api/AnotherFakeApiTest.java | 31 +- .../client/api/DefaultApiTest.java | 35 +- .../openapitools/client/api/FakeApiTest.java | 252 +- .../api/FakeClassnameTags123ApiTest.java | 31 +- .../openapitools/client/api/PetApiTest.java | 128 +- .../openapitools/client/api/StoreApiTest.java | 69 +- .../openapitools/client/api/UserApiTest.java | 111 +- .../model/AdditionalPropertiesClassTest.java | 31 +- .../client/model/AllOfWithSingleRefTest.java | 30 +- .../openapitools/client/model/AnimalTest.java | 34 +- .../client/model/AppleReqTest.java | 29 +- .../openapitools/client/model/AppleTest.java | 29 +- .../client/model/ArrayDefaultValueTest.java | 31 +- .../model/ArrayOfArrayOfNumberOnlyTest.java | 28 +- .../client/model/ArrayOfNumberOnlyTest.java | 28 +- .../client/model/ArrayTestTest.java | 36 +- .../client/model/BananaReqTest.java | 30 +- .../openapitools/client/model/BananaTest.java | 26 +- .../client/model/BasquePigTest.java | 25 +- .../client/model/CapitalizationTest.java | 45 +- .../client/model/CatAllOfTest.java | 25 +- .../openapitools/client/model/CatTest.java | 37 +- .../client/model/CategoryTest.java | 29 +- .../client/model/ChildCatAllOfTest.java | 31 +- .../client/model/ChildCatTest.java | 35 +- .../client/model/ClassModelTest.java | 25 +- .../openapitools/client/model/ClientTest.java | 25 +- .../model/ComplexQuadrilateralTest.java | 29 +- .../client/model/DanishPigTest.java | 25 +- .../client/model/DeprecatedObjectTest.java | 25 +- .../client/model/DogAllOfTest.java | 25 +- .../openapitools/client/model/DogTest.java | 37 +- .../client/model/DrawingTest.java | 49 +- .../client/model/EnumArraysTest.java | 31 +- .../client/model/EnumClassTest.java | 16 +- .../client/model/EnumTestTest.java | 61 +- .../client/model/EquilateralTriangleTest.java | 29 +- .../client/model/FileSchemaTestClassTest.java | 32 +- .../model/FooGetDefaultResponseTest.java | 26 +- .../openapitools/client/model/FooTest.java | 25 +- .../client/model/FormatTestTest.java | 90 +- .../client/model/FruitReqTest.java | 40 +- .../openapitools/client/model/FruitTest.java | 36 +- .../client/model/GmFruitTest.java | 36 +- .../client/model/GrandparentAnimalTest.java | 30 +- .../client/model/HasOnlyReadOnlyTest.java | 29 +- .../client/model/HealthCheckResultTest.java | 29 +- .../client/model/IsoscelesTriangleTest.java | 29 +- .../openapitools/client/model/MammalTest.java | 43 +- .../client/model/MapTestTest.java | 39 +- ...rtiesAndAdditionalPropertiesClassTest.java | 41 +- .../client/model/Model200ResponseTest.java | 29 +- .../client/model/ModelApiResponseTest.java | 33 +- .../client/model/ModelFileTest.java | 25 +- .../client/model/ModelListTest.java | 25 +- .../client/model/ModelReturnTest.java | 25 +- .../openapitools/client/model/NameTest.java | 37 +- .../client/model/NullableClassTest.java | 80 +- .../client/model/NullableShapeTest.java | 38 +- .../client/model/NumberOnlyTest.java | 26 +- .../model/ObjectWithDeprecatedFieldsTest.java | 41 +- .../openapitools/client/model/OrderTest.java | 46 +- .../client/model/OuterCompositeTest.java | 34 +- .../model/OuterEnumDefaultValueTest.java | 16 +- .../OuterEnumIntegerDefaultValueTest.java | 16 +- .../client/model/OuterEnumIntegerTest.java | 16 +- .../client/model/OuterEnumTest.java | 16 +- .../OuterObjectWithEnumPropertyTest.java | 26 +- .../client/model/ParentPetTest.java | 30 +- .../openapitools/client/model/PetTest.java | 52 +- .../openapitools/client/model/PigTest.java | 30 +- .../model/QuadrilateralInterfaceTest.java | 25 +- .../client/model/QuadrilateralTest.java | 34 +- .../client/model/ReadOnlyFirstTest.java | 29 +- .../client/model/ScaleneTriangleTest.java | 29 +- .../client/model/ShapeInterfaceTest.java | 25 +- .../client/model/ShapeOrNullTest.java | 38 +- .../openapitools/client/model/ShapeTest.java | 38 +- .../client/model/SimpleQuadrilateralTest.java | 29 +- .../client/model/SingleRefTypeTest.java | 16 +- .../client/model/SpecialModelNameTest.java | 25 +- .../openapitools/client/model/TagTest.java | 29 +- .../client/model/TriangleInterfaceTest.java | 25 +- .../client/model/TriangleTest.java | 35 +- .../openapitools/client/model/UserTest.java | 53 +- .../openapitools/client/model/WhaleTest.java | 33 +- .../openapitools/client/model/ZebraTest.java | 31 +- 196 files changed, 21954 insertions(+), 23333 deletions(-) diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java index 7229635a0fd1..caaaa6534cd4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiClient.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,13 +12,13 @@ package org.openapitools.client; +import static java.nio.charset.StandardCharsets.UTF_8; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import org.openapitools.jackson.nullable.JsonNullableModule; - import java.io.InputStream; import java.net.URI; import java.net.URLEncoder; @@ -35,422 +35,411 @@ import java.util.List; import java.util.StringJoiner; import java.util.function.Consumer; import java.util.stream.Collectors; - -import static java.nio.charset.StandardCharsets.UTF_8; +import org.openapitools.jackson.nullable.JsonNullableModule; /** * Configuration and utility class for API clients. * - *

This class can be constructed and modified, then used to instantiate the - * various API classes. The API classes use the settings in this class to - * configure themselves, but otherwise do not store a link to this class.

+ *

This class can be constructed and modified, then used to instantiate the various API classes. + * The API classes use the settings in this class to configure themselves, but otherwise do not + * store a link to this class. * - *

This class is mutable and not synchronized, so it is not thread-safe. - * The API classes generated from this are immutable and thread-safe.

+ *

This class is mutable and not synchronized, so it is not thread-safe. The API classes + * generated from this are immutable and thread-safe. * - *

The setter methods of this class return the current object to facilitate - * a fluent style of configuration.

+ *

The setter methods of this class return the current object to facilitate a fluent style of + * configuration. */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ApiClient { - private HttpClient.Builder builder; - private ObjectMapper mapper; - private String scheme; - private String host; - private int port; - private String basePath; - private Consumer interceptor; - private Consumer> responseInterceptor; - private Consumer> asyncResponseInterceptor; - private Duration readTimeout; - private Duration connectTimeout; + private HttpClient.Builder builder; + private ObjectMapper mapper; + private String scheme; + private String host; + private int port; + private String basePath; + private Consumer interceptor; + private Consumer> responseInterceptor; + private Consumer> asyncResponseInterceptor; + private Duration readTimeout; + private Duration connectTimeout; - private static String valueToString(Object value) { - if (value == null) { - return ""; - } - if (value instanceof OffsetDateTime) { - return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); - } - return value.toString(); - } - - /** - * URL encode a string in the UTF-8 encoding. - * - * @param s String to encode. - * @return URL-encoded representation of the input string. - */ - public static String urlEncode(String s) { - return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); - } - - /** - * Convert a URL query name/value parameter to a list of encoded {@link Pair} - * objects. - * - *

The value can be null, in which case an empty list is returned.

- * - * @param name The query name parameter. - * @param value The query value, which may not be a collection but may be - * null. - * @return A singleton list of the {@link Pair} objects representing the input - * parameters, which is encoded for use in a URL. If the value is null, an - * empty list is returned. - */ - public static List parameterToPairs(String name, Object value) { - if (name == null || name.isEmpty() || value == null) { - return Collections.emptyList(); - } - return Collections.singletonList(new Pair(urlEncode(name), urlEncode(valueToString(value)))); - } - - /** - * Convert a URL query name/collection parameter to a list of encoded - * {@link Pair} objects. - * - * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). - * @param name The query name parameter. - * @param values A collection of values for the given query name, which may be - * null. - * @return A list of {@link Pair} objects representing the input parameters, - * which is encoded for use in a URL. If the values collection is null, an - * empty list is returned. - */ - public static List parameterToPairs( - String collectionFormat, String name, Collection values) { - if (name == null || name.isEmpty() || values == null || values.isEmpty()) { - return Collections.emptyList(); + private static String valueToString(Object value) { + if (value == null) { + return ""; + } + if (value instanceof OffsetDateTime) { + return ((OffsetDateTime) value).format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + return value.toString(); } - // get the collection format (default: csv) - String format = collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; - - // create the params based on the collection format - if ("multi".equals(format)) { - return values.stream() - .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) - .collect(Collectors.toList()); + /** + * URL encode a string in the UTF-8 encoding. + * + * @param s String to encode. + * @return URL-encoded representation of the input string. + */ + public static String urlEncode(String s) { + return URLEncoder.encode(s, UTF_8).replaceAll("\\+", "%20"); } - String delimiter; - switch(format) { - case "csv": - delimiter = urlEncode(","); - break; - case "ssv": - delimiter = urlEncode(" "); - break; - case "tsv": - delimiter = urlEncode("\t"); - break; - case "pipes": - delimiter = urlEncode("|"); - break; - default: - throw new IllegalArgumentException("Illegal collection format: " + collectionFormat); + /** + * Convert a URL query name/value parameter to a list of encoded {@link Pair} objects. + * + *

The value can be null, in which case an empty list is returned. + * + * @param name The query name parameter. + * @param value The query value, which may not be a collection but may be null. + * @return A singleton list of the {@link Pair} objects representing the input parameters, which + * is encoded for use in a URL. If the value is null, an empty list is returned. + */ + public static List parameterToPairs(String name, Object value) { + if (name == null || name.isEmpty() || value == null) { + return Collections.emptyList(); + } + return Collections.singletonList( + new Pair(urlEncode(name), urlEncode(valueToString(value)))); } - StringJoiner joiner = new StringJoiner(delimiter); - for (Object value : values) { - joiner.add(urlEncode(valueToString(value))); + /** + * Convert a URL query name/collection parameter to a list of encoded {@link Pair} objects. + * + * @param collectionFormat The swagger collectionFormat string (csv, tsv, etc). + * @param name The query name parameter. + * @param values A collection of values for the given query name, which may be null. + * @return A list of {@link Pair} objects representing the input parameters, which is encoded + * for use in a URL. If the values collection is null, an empty list is returned. + */ + public static List parameterToPairs( + String collectionFormat, String name, Collection values) { + if (name == null || name.isEmpty() || values == null || values.isEmpty()) { + return Collections.emptyList(); + } + + // get the collection format (default: csv) + String format = + collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat; + + // create the params based on the collection format + if ("multi".equals(format)) { + return values.stream() + .map(value -> new Pair(urlEncode(name), urlEncode(valueToString(value)))) + .collect(Collectors.toList()); + } + + String delimiter; + switch (format) { + case "csv": + delimiter = urlEncode(","); + break; + case "ssv": + delimiter = urlEncode(" "); + break; + case "tsv": + delimiter = urlEncode("\t"); + break; + case "pipes": + delimiter = urlEncode("|"); + break; + default: + throw new IllegalArgumentException( + "Illegal collection format: " + collectionFormat); + } + + StringJoiner joiner = new StringJoiner(delimiter); + for (Object value : values) { + joiner.add(urlEncode(valueToString(value))); + } + + return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); } - return Collections.singletonList(new Pair(urlEncode(name), joiner.toString())); - } + /** Create an instance of ApiClient. */ + public ApiClient() { + this.builder = createDefaultHttpClientBuilder(); + this.mapper = createDefaultObjectMapper(); + updateBaseUri(getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } - /** - * Create an instance of ApiClient. - */ - public ApiClient() { - this.builder = createDefaultHttpClientBuilder(); - this.mapper = createDefaultObjectMapper(); - updateBaseUri(getDefaultBaseUri()); - interceptor = null; - readTimeout = null; - connectTimeout = null; - responseInterceptor = null; - asyncResponseInterceptor = null; - } + /** + * Create an instance of ApiClient. + * + * @param builder Http client builder. + * @param mapper Object mapper. + * @param baseUri Base URI + */ + public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { + this.builder = builder; + this.mapper = mapper; + updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); + interceptor = null; + readTimeout = null; + connectTimeout = null; + responseInterceptor = null; + asyncResponseInterceptor = null; + } - /** - * Create an instance of ApiClient. - * - * @param builder Http client builder. - * @param mapper Object mapper. - * @param baseUri Base URI - */ - public ApiClient(HttpClient.Builder builder, ObjectMapper mapper, String baseUri) { - this.builder = builder; - this.mapper = mapper; - updateBaseUri(baseUri != null ? baseUri : getDefaultBaseUri()); - interceptor = null; - readTimeout = null; - connectTimeout = null; - responseInterceptor = null; - asyncResponseInterceptor = null; - } + protected ObjectMapper createDefaultObjectMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.registerModule(new JavaTimeModule()); + mapper.registerModule(new JsonNullableModule()); + return mapper; + } - protected ObjectMapper createDefaultObjectMapper() { - ObjectMapper mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); - mapper.registerModule(new JavaTimeModule()); - mapper.registerModule(new JsonNullableModule()); - return mapper; - } + protected String getDefaultBaseUri() { + return "http://petstore.swagger.io:80/v2"; + } - protected String getDefaultBaseUri() { - return "http://petstore.swagger.io:80/v2"; - } + protected HttpClient.Builder createDefaultHttpClientBuilder() { + return HttpClient.newBuilder(); + } - protected HttpClient.Builder createDefaultHttpClientBuilder() { - return HttpClient.newBuilder(); - } + public void updateBaseUri(String baseUri) { + URI uri = URI.create(baseUri); + scheme = uri.getScheme(); + host = uri.getHost(); + port = uri.getPort(); + basePath = uri.getRawPath(); + } - public void updateBaseUri(String baseUri) { - URI uri = URI.create(baseUri); - scheme = uri.getScheme(); - host = uri.getHost(); - port = uri.getPort(); - basePath = uri.getRawPath(); - } + /** + * Set a custom {@link HttpClient.Builder} object to use when creating the {@link HttpClient} + * that is used by the API client. + * + * @param builder Custom client builder. + * @return This object. + */ + public ApiClient setHttpClientBuilder(HttpClient.Builder builder) { + this.builder = builder; + return this; + } - /** - * Set a custom {@link HttpClient.Builder} object to use when creating the - * {@link HttpClient} that is used by the API client. - * - * @param builder Custom client builder. - * @return This object. - */ - public ApiClient setHttpClientBuilder(HttpClient.Builder builder) { - this.builder = builder; - return this; - } + /** + * Get an {@link HttpClient} based on the current {@link HttpClient.Builder}. + * + *

The returned object is immutable and thread-safe. + * + * @return The HTTP client. + */ + public HttpClient getHttpClient() { + return builder.build(); + } - /** - * Get an {@link HttpClient} based on the current {@link HttpClient.Builder}. - * - *

The returned object is immutable and thread-safe.

- * - * @return The HTTP client. - */ - public HttpClient getHttpClient() { - return builder.build(); - } + /** + * Set a custom {@link ObjectMapper} to serialize and deserialize the request and response + * bodies. + * + * @param mapper Custom object mapper. + * @return This object. + */ + public ApiClient setObjectMapper(ObjectMapper mapper) { + this.mapper = mapper; + return this; + } - /** - * Set a custom {@link ObjectMapper} to serialize and deserialize the request - * and response bodies. - * - * @param mapper Custom object mapper. - * @return This object. - */ - public ApiClient setObjectMapper(ObjectMapper mapper) { - this.mapper = mapper; - return this; - } + /** + * Get a copy of the current {@link ObjectMapper}. + * + * @return A copy of the current object mapper. + */ + public ObjectMapper getObjectMapper() { + return mapper.copy(); + } - /** - * Get a copy of the current {@link ObjectMapper}. - * - * @return A copy of the current object mapper. - */ - public ObjectMapper getObjectMapper() { - return mapper.copy(); - } + /** + * Set a custom host name for the target service. + * + * @param host The host name of the target service. + * @return This object. + */ + public ApiClient setHost(String host) { + this.host = host; + return this; + } - /** - * Set a custom host name for the target service. - * - * @param host The host name of the target service. - * @return This object. - */ - public ApiClient setHost(String host) { - this.host = host; - return this; - } + /** + * Set a custom port number for the target service. + * + * @param port The port of the target service. Set this to -1 to reset the value to the default + * for the scheme. + * @return This object. + */ + public ApiClient setPort(int port) { + this.port = port; + return this; + } - /** - * Set a custom port number for the target service. - * - * @param port The port of the target service. Set this to -1 to reset the - * value to the default for the scheme. - * @return This object. - */ - public ApiClient setPort(int port) { - this.port = port; - return this; - } + /** + * Set a custom base path for the target service, for example '/v2'. + * + * @param basePath The base path against which the rest of the path is resolved. + * @return This object. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + return this; + } - /** - * Set a custom base path for the target service, for example '/v2'. - * - * @param basePath The base path against which the rest of the path is - * resolved. - * @return This object. - */ - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; - } + /** + * Get the base URI to resolve the endpoint paths against. + * + * @return The complete base URI that the rest of the API parameters are resolved against. + */ + public String getBaseUri() { + return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; + } - /** - * Get the base URI to resolve the endpoint paths against. - * - * @return The complete base URI that the rest of the API parameters are - * resolved against. - */ - public String getBaseUri() { - return scheme + "://" + host + (port == -1 ? "" : ":" + port) + basePath; - } + /** + * Set a custom scheme for the target service, for example 'https'. + * + * @param scheme The scheme of the target service + * @return This object. + */ + public ApiClient setScheme(String scheme) { + this.scheme = scheme; + return this; + } - /** - * Set a custom scheme for the target service, for example 'https'. - * - * @param scheme The scheme of the target service - * @return This object. - */ - public ApiClient setScheme(String scheme){ - this.scheme = scheme; - return this; - } + /** + * Set a custom request interceptor. + * + *

A request interceptor is a mechanism for altering each request before it is sent. After + * the request has been fully configured but not yet built, the request builder is passed into + * this function for further modification, after which it is sent out. + * + *

This is useful for altering the requests in a custom manner, such as adding headers. It + * could also be used for logging and monitoring. + * + * @param interceptor A function invoked before creating each request. A value of null resets + * the interceptor to a no-op. + * @return This object. + */ + public ApiClient setRequestInterceptor(Consumer interceptor) { + this.interceptor = interceptor; + return this; + } - /** - * Set a custom request interceptor. - * - *

A request interceptor is a mechanism for altering each request before it - * is sent. After the request has been fully configured but not yet built, the - * request builder is passed into this function for further modification, - * after which it is sent out.

- * - *

This is useful for altering the requests in a custom manner, such as - * adding headers. It could also be used for logging and monitoring.

- * - * @param interceptor A function invoked before creating each request. A value - * of null resets the interceptor to a no-op. - * @return This object. - */ - public ApiClient setRequestInterceptor(Consumer interceptor) { - this.interceptor = interceptor; - return this; - } + /** + * Get the custom interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer getRequestInterceptor() { + return interceptor; + } - /** - * Get the custom interceptor. - * - * @return The custom interceptor that was set, or null if there isn't any. - */ - public Consumer getRequestInterceptor() { - return interceptor; - } + /** + * Set a custom response interceptor. + * + *

This is useful for logging, monitoring or extraction of header variables + * + * @param interceptor A function invoked before creating each request. A value of null resets + * the interceptor to a no-op. + * @return This object. + */ + public ApiClient setResponseInterceptor(Consumer> interceptor) { + this.responseInterceptor = interceptor; + return this; + } - /** - * Set a custom response interceptor. - * - *

This is useful for logging, monitoring or extraction of header variables

- * - * @param interceptor A function invoked before creating each request. A value - * of null resets the interceptor to a no-op. - * @return This object. - */ - public ApiClient setResponseInterceptor(Consumer> interceptor) { - this.responseInterceptor = interceptor; - return this; - } + /** + * Get the custom response interceptor. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getResponseInterceptor() { + return responseInterceptor; + } - /** - * Get the custom response interceptor. - * - * @return The custom interceptor that was set, or null if there isn't any. - */ - public Consumer> getResponseInterceptor() { - return responseInterceptor; - } + /** + * Set a custom async response interceptor. Use this interceptor when asyncNative is set to + * 'true'. + * + *

This is useful for logging, monitoring or extraction of header variables + * + * @param interceptor A function invoked before creating each request. A value of null resets + * the interceptor to a no-op. + * @return This object. + */ + public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { + this.asyncResponseInterceptor = interceptor; + return this; + } - /** - * Set a custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. - * - *

This is useful for logging, monitoring or extraction of header variables

- * - * @param interceptor A function invoked before creating each request. A value - * of null resets the interceptor to a no-op. - * @return This object. - */ - public ApiClient setAsyncResponseInterceptor(Consumer> interceptor) { - this.asyncResponseInterceptor = interceptor; - return this; - } + /** + * Get the custom async response interceptor. Use this interceptor when asyncNative is set to + * 'true'. + * + * @return The custom interceptor that was set, or null if there isn't any. + */ + public Consumer> getAsyncResponseInterceptor() { + return asyncResponseInterceptor; + } - /** - * Get the custom async response interceptor. Use this interceptor when asyncNative is set to 'true'. - * - * @return The custom interceptor that was set, or null if there isn't any. - */ - public Consumer> getAsyncResponseInterceptor() { - return asyncResponseInterceptor; - } + /** + * Set the read timeout for the http client. + * + *

This is the value used by default for each request, though it can be overridden on a + * per-request basis with a request interceptor. + * + * @param readTimeout The read timeout used by default by the http client. Setting this value to + * null resets the timeout to an effectively infinite value. + * @return This object. + */ + public ApiClient setReadTimeout(Duration readTimeout) { + this.readTimeout = readTimeout; + return this; + } - /** - * Set the read timeout for the http client. - * - *

This is the value used by default for each request, though it can be - * overridden on a per-request basis with a request interceptor.

- * - * @param readTimeout The read timeout used by default by the http client. - * Setting this value to null resets the timeout to an - * effectively infinite value. - * @return This object. - */ - public ApiClient setReadTimeout(Duration readTimeout) { - this.readTimeout = readTimeout; - return this; - } + /** + * Get the read timeout that was set. + * + * @return The read timeout, or null if no timeout was set. Null represents an infinite wait + * time. + */ + public Duration getReadTimeout() { + return readTimeout; + } + /** + * Sets the connect timeout (in milliseconds) for the http client. + * + *

In the case where a new connection needs to be established, if the connection cannot be + * established within the given {@code duration}, then {@link + * HttpClient#send(HttpRequest,BodyHandler) HttpClient::send} throws an {@link + * HttpConnectTimeoutException}, or {@link HttpClient#sendAsync(HttpRequest,BodyHandler) + * HttpClient::sendAsync} completes exceptionally with an {@code HttpConnectTimeoutException}. + * If a new connection does not need to be established, for example if a connection can be + * reused from a previous request, then this timeout duration has no effect. + * + * @param connectTimeout connection timeout in milliseconds + * @return This object. + */ + public ApiClient setConnectTimeout(Duration connectTimeout) { + this.connectTimeout = connectTimeout; + this.builder.connectTimeout(connectTimeout); + return this; + } - /** - * Get the read timeout that was set. - * - * @return The read timeout, or null if no timeout was set. Null represents - * an infinite wait time. - */ - public Duration getReadTimeout() { - return readTimeout; - } - /** - * Sets the connect timeout (in milliseconds) for the http client. - * - *

In the case where a new connection needs to be established, if - * the connection cannot be established within the given {@code - * duration}, then {@link HttpClient#send(HttpRequest,BodyHandler) - * HttpClient::send} throws an {@link HttpConnectTimeoutException}, or - * {@link HttpClient#sendAsync(HttpRequest,BodyHandler) - * HttpClient::sendAsync} completes exceptionally with an - * {@code HttpConnectTimeoutException}. If a new connection does not - * need to be established, for example if a connection can be reused - * from a previous request, then this timeout duration has no effect. - * - * @param connectTimeout connection timeout in milliseconds - * - * @return This object. - */ - public ApiClient setConnectTimeout(Duration connectTimeout) { - this.connectTimeout = connectTimeout; - this.builder.connectTimeout(connectTimeout); - return this; - } - - /** - * Get connection timeout (in milliseconds). - * - * @return Timeout in milliseconds - */ - public Duration getConnectTimeout() { - return connectTimeout; - } + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public Duration getConnectTimeout() { + return connectTimeout; + } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiException.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiException.java index 068ba4081360..cfaed4663ebc 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiException.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiException.java @@ -3,16 +3,16 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client; + import java.net.http.HttpHeaders; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -31,18 +31,25 @@ public class ApiException extends Exception { super(message); } - public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders, String responseBody) { + public ApiException( + String message, + Throwable throwable, + int code, + HttpHeaders responseHeaders, + String responseBody) { super(message, throwable); this.code = code; this.responseHeaders = responseHeaders; this.responseBody = responseBody; } - public ApiException(String message, int code, HttpHeaders responseHeaders, String responseBody) { + public ApiException( + String message, int code, HttpHeaders responseHeaders, String responseBody) { this(message, (Throwable) null, code, responseHeaders, responseBody); } - public ApiException(String message, Throwable throwable, int code, HttpHeaders responseHeaders) { + public ApiException( + String message, Throwable throwable, int code, HttpHeaders responseHeaders) { this(message, throwable, code, responseHeaders, null); } @@ -55,7 +62,8 @@ public class ApiException extends Exception { this.code = code; } - public ApiException(int code, String message, HttpHeaders responseHeaders, String responseBody) { + public ApiException( + int code, String message, HttpHeaders responseHeaders, String responseBody) { this(code, message); this.responseHeaders = responseHeaders; this.responseBody = responseBody; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiResponse.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiResponse.java index 9bb5cac17b41..6722a2be7c70 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiResponse.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ApiResponse.java @@ -3,16 +3,16 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client; + import java.util.List; import java.util.Map; @@ -22,9 +22,9 @@ import java.util.Map; * @param The type of data that is deserialized from response body */ public class ApiResponse { - final private int statusCode; - final private Map> headers; - final private T data; + private final int statusCode; + private final Map> headers; + private final T data; /** * @param statusCode The status code of HTTP response diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/Configuration.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/Configuration.java index 476456fd4ed6..451ce97dc86a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/Configuration.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/Configuration.java @@ -3,14 +3,13 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -18,8 +17,8 @@ public class Configuration { private static ApiClient defaultApiClient = new ApiClient(); /** - * Get the default API client, which would be used when creating API - * instances without providing an API client. + * Get the default API client, which would be used when creating API instances without providing + * an API client. * * @return Default API client */ @@ -28,8 +27,8 @@ public class Configuration { } /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. + * Set the default API client, which would be used when creating API instances without providing + * an API client. * * @param apiClient API client */ diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/JSON.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/JSON.java index 1ce1e47b4fb6..f8605e7350fd 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/JSON.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/JSON.java @@ -1,248 +1,245 @@ package org.openapitools.client; + import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; -import org.openapitools.jackson.nullable.JsonNullableModule; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import org.openapitools.client.model.*; - import java.text.DateFormat; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; +import org.openapitools.client.model.*; +import org.openapitools.jackson.nullable.JsonNullableModule; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class JSON { - private ObjectMapper mapper; + private ObjectMapper mapper; - public JSON() { - mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.setDateFormat(new RFC3339DateFormat()); - mapper.registerModule(new JavaTimeModule()); - JsonNullableModule jnm = new JsonNullableModule(); - mapper.registerModule(jnm); - } - - /** - * Set the date format for JSON (de)serialization with Date properties. - * - * @param dateFormat Date format - */ - public void setDateFormat(DateFormat dateFormat) { - mapper.setDateFormat(dateFormat); - } - - /** - * Get the object mapper - * - * @return object mapper - */ - public ObjectMapper getMapper() { return mapper; } - - /** - * Returns the target model class that should be used to deserialize the input data. - * The discriminator mappings are used to determine the target model class. - * - * @param node The input data. - * @param modelClass The class that contains the discriminator mappings. - * - * @return the target model class. - */ - public static Class getClassForElement(JsonNode node, Class modelClass) { - ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); - if (cdm != null) { - return cdm.getClassForElement(node, new HashSet>()); - } - return null; - } - - /** - * Helper class to register the discriminator mappings. - */ - private static class ClassDiscriminatorMapping { - // The model class name. - Class modelClass; - // The name of the discriminator property. - String discriminatorName; - // The discriminator mappings for a model class. - Map> discriminatorMappings; - - // Constructs a new class discriminator. - ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { - modelClass = cls; - discriminatorName = propertyName; - discriminatorMappings = new HashMap>(); - if (mappings != null) { - discriminatorMappings.putAll(mappings); - } - } - - // Return the name of the discriminator property for this model class. - String getDiscriminatorPropertyName() { - return discriminatorName; - } - - // Return the discriminator value or null if the discriminator is not - // present in the payload. - String getDiscriminatorValue(JsonNode node) { - // Determine the value of the discriminator property in the input data. - if (discriminatorName != null) { - // Get the value of the discriminator property, if present in the input payload. - node = node.get(discriminatorName); - if (node != null && node.isValueNode()) { - String discrValue = node.asText(); - if (discrValue != null) { - return discrValue; - } - } - } - return null; + public JSON() { + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, true); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.setDateFormat(new RFC3339DateFormat()); + mapper.registerModule(new JavaTimeModule()); + JsonNullableModule jnm = new JsonNullableModule(); + mapper.registerModule(jnm); } /** - * Returns the target model class that should be used to deserialize the input data. - * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. - * The discriminator mappings are used to determine the target model class. + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { + return mapper; + } + + /** + * Returns the target model class that should be used to deserialize the input data. The + * discriminator mappings are used to determine the target model class. * * @param node The input data. - * @param visitedClasses The set of classes that have already been visited. - * + * @param modelClass The class that contains the discriminator mappings. * @return the target model class. */ - Class getClassForElement(JsonNode node, Set> visitedClasses) { - if (visitedClasses.contains(modelClass)) { - // Class has already been visited. + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet>()); + } return null; - } - // Determine the value of the discriminator property in the input data. - String discrValue = getDiscriminatorValue(node); - if (discrValue == null) { - return null; - } - Class cls = discriminatorMappings.get(discrValue); - // It may not be sufficient to return this cls directly because that target class - // may itself be a composed schema, possibly with its own discriminator. - visitedClasses.add(modelClass); - for (Class childClass : discriminatorMappings.values()) { - ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); - if (childCdm == null) { - continue; - } - if (!discriminatorName.equals(childCdm.discriminatorName)) { - discrValue = getDiscriminatorValue(node); - if (discrValue == null) { - continue; - } - } - if (childCdm != null) { - // Recursively traverse the discriminator mappings. - Class childDiscr = childCdm.getClassForElement(node, visitedClasses); - if (childDiscr != null) { - return childDiscr; - } - } - } - return cls; } - } - /** - * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. - * - * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, - * so it's not possible to use the instanceof keyword. - * - * @param modelClass A OpenAPI model class. - * @param inst The instance object. - * @param visitedClasses The set of classes that have already been visited. - * - * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. - */ - public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { - if (modelClass.isInstance(inst)) { - // This handles the 'allOf' use case with single parent inheritance. - return true; - } - if (visitedClasses.contains(modelClass)) { - // This is to prevent infinite recursion when the composed schemas have - // a circular dependency. - return false; - } - visitedClasses.add(modelClass); + /** Helper class to register the discriminator mappings. */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; - // Traverse the oneOf/anyOf composed schemas. - Map> descendants = modelDescendants.get(modelClass); - if (descendants != null) { - for (Class childType : descendants.values()) { - if (isInstanceOf(childType, inst, visitedClasses)) { - return true; + // Constructs a new class discriminator. + ClassDiscriminatorMapping( + Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. This + * function can be invoked for anyOf/oneOf composed models with discriminator mappings. The + * discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + * @return the target model class. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; } - } } - return false; - } - /** - * A map of discriminators for all model classes. - */ - private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + *

The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + * @param visitedClasses The set of classes that have already been visited. + * @return true if inst is an instance of modelClass in the OpenAPI model hierarchy. + */ + public static boolean isInstanceOf( + Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); - /** - * A map of oneOf/anyOf descendants for each model class. - */ - private static Map, Map>> modelDescendants = new HashMap<>(); + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (Class childType : descendants.values()) { + if (isInstanceOf(childType, inst, visitedClasses)) { + return true; + } + } + } + return false; + } - /** - * Register a model class discriminator. - * - * @param modelClass the model class - * @param discriminatorPropertyName the name of the discriminator property - * @param mappings a map with the discriminator mappings. - */ - public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { - ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); - modelDiscriminators.put(modelClass, m); - } + /** A map of discriminators for all model classes. */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); - /** - * Register the oneOf/anyOf descendants of the modelClass. - * - * @param modelClass the model class - * @param descendants a map of oneOf/anyOf descendants. - */ - public static void registerDescendants(Class modelClass, Map> descendants) { - modelDescendants.put(modelClass, descendants); - } + /** A map of oneOf/anyOf descendants for each model class. */ + private static Map, Map>> modelDescendants = new HashMap<>(); - private static JSON json; + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator( + Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = + new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } - static { - json = new JSON(); - } + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } - /** - * Get the default JSON instance. - * - * @return the default JSON instance - */ - public static JSON getDefault() { - return json; - } + private static JSON json; - /** - * Set the default JSON instance. - * - * @param json JSON instance to be used - */ - public static void setDefault(JSON json) { - JSON.json = json; - } + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/Pair.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/Pair.java index 25b5a1b08792..b8774a5d95fe 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/Pair.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/Pair.java @@ -3,14 +3,13 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -18,7 +17,7 @@ public class Pair { private String name = ""; private String value = ""; - public Pair (String name, String value) { + public Pair(String name, String value) { setName(name); setValue(value); } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/RFC3339DateFormat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/RFC3339DateFormat.java index f94cba613ba4..0d37bd979855 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/RFC3339DateFormat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/RFC3339DateFormat.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,46 +12,45 @@ package org.openapitools.client; -import com.fasterxml.jackson.databind.util.StdDateFormat; +import com.fasterxml.jackson.databind.util.StdDateFormat; import java.text.DateFormat; +import java.text.DecimalFormat; import java.text.FieldPosition; import java.text.ParsePosition; import java.util.Date; -import java.text.DecimalFormat; import java.util.GregorianCalendar; import java.util.TimeZone; public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); + private static final long serialVersionUID = 1L; + private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); + private final StdDateFormat fmt = + new StdDateFormat().withTimeZone(TIMEZONE_Z).withColonInTimeZone(true); - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - this.numberFormat = new DecimalFormat(); - } + public RFC3339DateFormat() { + this.calendar = new GregorianCalendar(); + this.numberFormat = new DecimalFormat(); + } - @Override - public Date parse(String source) { - return parse(source, new ParsePosition(0)); - } + @Override + public Date parse(String source) { + return parse(source, new ParsePosition(0)); + } - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } + @Override + public Date parse(String source, ParsePosition pos) { + return fmt.parse(source, pos); + } - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } + @Override + public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { + return fmt.format(date, toAppendTo, fieldPosition); + } - @Override - public Object clone() { - return super.clone(); - } -} \ No newline at end of file + @Override + public Object clone() { + return super.clone(); + } +} diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerConfiguration.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerConfiguration.java index 59edc528a446..057ae1a2821e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerConfiguration.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerConfiguration.java @@ -1,10 +1,9 @@ package org.openapitools.client; + import java.util.Map; -/** - * Representing a Server configuration. - */ +/** Representing a Server configuration. */ public class ServerConfiguration { public String URL; public String description; @@ -13,9 +12,11 @@ public class ServerConfiguration { /** * @param URL A URL to the target host. * @param description A description of the host designated by the URL. - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + * @param variables A map between a variable name and its value. The value is used for + * substitution in the server's URL template. */ - public ServerConfiguration(String URL, String description, Map variables) { + public ServerConfiguration( + String URL, String description, Map variables) { this.URL = URL; this.description = description; this.variables = variables; @@ -31,15 +32,21 @@ public class ServerConfiguration { String url = this.URL; // go through variables and replace placeholders - for (Map.Entry variable: this.variables.entrySet()) { + for (Map.Entry variable : this.variables.entrySet()) { String name = variable.getKey(); ServerVariable serverVariable = variable.getValue(); String value = serverVariable.defaultValue; if (variables != null && variables.containsKey(name)) { value = variables.get(name); - if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + if (serverVariable.enumValues.size() > 0 + && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException( + "The variable " + + name + + " in the server URL has invalid value " + + value + + "."); } } url = url.replace("{" + name + "}", value); diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerVariable.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerVariable.java index c2f13e216662..b13ae3e3e719 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerVariable.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/ServerVariable.java @@ -1,10 +1,9 @@ package org.openapitools.client; + import java.util.HashSet; -/** - * Representing a Server Variable for server URL template substitution. - */ +/** Representing a Server Variable for server URL template substitution. */ public class ServerVariable { public String description; public String defaultValue; @@ -13,7 +12,8 @@ public class ServerVariable { /** * @param description A description for the server variable. * @param defaultValue The default value to use for substitution. - * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + * @param enumValues An enumeration of string values to be used if the substitution options are + * from a limited set. */ public ServerVariable(String description, String defaultValue, HashSet enumValues) { this.description = description; diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java index 6d67e626cc54..c0735ae861aa 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/AnotherFakeApi.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,155 +12,144 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Pair; - -import org.openapitools.client.model.Client; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; - -import java.io.InputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; import java.io.IOException; -import java.io.OutputStream; -import java.net.http.HttpRequest; -import java.nio.channels.Channels; -import java.nio.channels.Pipe; +import java.io.InputStream; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; - -import java.util.ArrayList; -import java.util.StringJoiner; -import java.util.List; -import java.util.Map; -import java.util.Set; import java.util.function.Consumer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.model.Client; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AnotherFakeApi { - private final HttpClient memberVarHttpClient; - private final ObjectMapper memberVarObjectMapper; - private final String memberVarBaseUri; - private final Consumer memberVarInterceptor; - private final Duration memberVarReadTimeout; - private final Consumer> memberVarResponseInterceptor; - private final Consumer> memberVarAsyncResponseInterceptor; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; - public AnotherFakeApi() { - this(new ApiClient()); - } - - public AnotherFakeApi(ApiClient apiClient) { - memberVarHttpClient = apiClient.getHttpClient(); - memberVarObjectMapper = apiClient.getObjectMapper(); - memberVarBaseUri = apiClient.getBaseUri(); - memberVarInterceptor = apiClient.getRequestInterceptor(); - memberVarReadTimeout = apiClient.getReadTimeout(); - memberVarResponseInterceptor = apiClient.getResponseInterceptor(); - memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); - } - - protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { - String body = response.body() == null ? null : new String(response.body().readAllBytes()); - String message = formatExceptionMessage(operationId, response.statusCode(), body); - return new ApiException(response.statusCode(), message, response.headers(), body); - } - - private String formatExceptionMessage(String operationId, int statusCode, String body) { - if (body == null || body.isEmpty()) { - body = "[no body]"; + public AnotherFakeApi() { + this(new ApiClient()); } - return operationId + " call failed with: " + statusCode + " - " + body; - } - /** - * To test special tags - * To test special tags and operation ID starting with number - * @param client client model (required) - * @return Client - * @throws ApiException if fails to make API call - */ - public Client call123testSpecialTags(Client client) throws ApiException { - ApiResponse localVarResponse = call123testSpecialTagsWithHttpInfo(client); - return localVarResponse.getData(); - } + public AnotherFakeApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } - /** - * To test special tags - * To test special tags and operation ID starting with number - * @param client client model (required) - * @return ApiResponse<Client> - * @throws ApiException if fails to make API call - */ - public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = call123testSpecialTagsRequestBuilder(client); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("call123testSpecialTags", localVarResponse); + protected ApiException getApiException(String operationId, HttpResponse response) + throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder call123testSpecialTagsRequestBuilder(Client client) throws ApiException { - // verify the required parameter 'client' is set - if (client == null) { - throw new ApiException(400, "Missing the required parameter 'client' when calling call123testSpecialTags"); + return operationId + " call failed with: " + statusCode + " - " + body; } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/another-fake/dummy"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client); - localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); + /** + * To test special tags To test special tags and operation ID starting with number + * + * @param client client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client call123testSpecialTags(Client client) throws ApiException { + ApiResponse localVarResponse = call123testSpecialTagsWithHttpInfo(client); + return localVarResponse.getData(); } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); + + /** + * To test special tags To test special tags and operation ID starting with number + * + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + */ + public ApiResponse call123testSpecialTagsWithHttpInfo(Client client) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = call123testSpecialTagsRequestBuilder(client); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("call123testSpecialTags", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); + + private HttpRequest.Builder call123testSpecialTagsRequestBuilder(Client client) + throws ApiException { + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException( + 400, + "Missing the required parameter 'client' when calling call123testSpecialTags"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/another-fake/dummy"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client); + localVarRequestBuilder.method( + "PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - return localVarRequestBuilder; - } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/DefaultApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/DefaultApi.java index 45054e60bf93..5cac295102ee 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/DefaultApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/DefaultApi.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,143 +12,124 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Pair; - -import org.openapitools.client.model.FooGetDefaultResponse; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; - -import java.io.InputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; import java.io.IOException; -import java.io.OutputStream; -import java.net.http.HttpRequest; -import java.nio.channels.Channels; -import java.nio.channels.Pipe; +import java.io.InputStream; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; - -import java.util.ArrayList; -import java.util.StringJoiner; -import java.util.List; -import java.util.Map; -import java.util.Set; import java.util.function.Consumer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.model.FooGetDefaultResponse; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DefaultApi { - private final HttpClient memberVarHttpClient; - private final ObjectMapper memberVarObjectMapper; - private final String memberVarBaseUri; - private final Consumer memberVarInterceptor; - private final Duration memberVarReadTimeout; - private final Consumer> memberVarResponseInterceptor; - private final Consumer> memberVarAsyncResponseInterceptor; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; - public DefaultApi() { - this(new ApiClient()); - } - - public DefaultApi(ApiClient apiClient) { - memberVarHttpClient = apiClient.getHttpClient(); - memberVarObjectMapper = apiClient.getObjectMapper(); - memberVarBaseUri = apiClient.getBaseUri(); - memberVarInterceptor = apiClient.getRequestInterceptor(); - memberVarReadTimeout = apiClient.getReadTimeout(); - memberVarResponseInterceptor = apiClient.getResponseInterceptor(); - memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); - } - - protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { - String body = response.body() == null ? null : new String(response.body().readAllBytes()); - String message = formatExceptionMessage(operationId, response.statusCode(), body); - return new ApiException(response.statusCode(), message, response.headers(), body); - } - - private String formatExceptionMessage(String operationId, int statusCode, String body) { - if (body == null || body.isEmpty()) { - body = "[no body]"; + public DefaultApi() { + this(new ApiClient()); } - return operationId + " call failed with: " + statusCode + " - " + body; - } - /** - * - * - * @return FooGetDefaultResponse - * @throws ApiException if fails to make API call - */ - public FooGetDefaultResponse fooGet() throws ApiException { - ApiResponse localVarResponse = fooGetWithHttpInfo(); - return localVarResponse.getData(); - } + public DefaultApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } - /** - * - * - * @return ApiResponse<FooGetDefaultResponse> - * @throws ApiException if fails to make API call - */ - public ApiResponse fooGetWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = fooGetRequestBuilder(); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("fooGet", localVarResponse); + protected ApiException getApiException(String operationId, HttpResponse response) + throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); + return operationId + " call failed with: " + statusCode + " - " + body; } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); + + /** + * @return FooGetDefaultResponse + * @throws ApiException if fails to make API call + */ + public FooGetDefaultResponse fooGet() throws ApiException { + ApiResponse localVarResponse = fooGetWithHttpInfo(); + return localVarResponse.getData(); } - } - private HttpRequest.Builder fooGetRequestBuilder() throws ApiException { - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/foo"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); + /** + * @return ApiResponse<FooGetDefaultResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse fooGetWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fooGetRequestBuilder(); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("fooGet", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the + // InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); + + private HttpRequest.Builder fooGetRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/foo"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - return localVarRequestBuilder; - } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java index 77eee894334a..44ae65cc8fa7 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeApi.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,1548 +12,1849 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Pair; - -import java.math.BigDecimal; -import org.openapitools.client.model.Client; -import java.io.File; -import org.openapitools.client.model.FileSchemaTestClass; -import org.openapitools.client.model.HealthCheckResult; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import org.openapitools.client.model.OuterComposite; -import org.openapitools.client.model.OuterEnum; -import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; - -import java.io.InputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; -import java.io.OutputStream; -import java.net.http.HttpRequest; -import java.nio.channels.Channels; -import java.nio.channels.Pipe; +import java.io.InputStream; +import java.math.BigDecimal; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; - +import java.time.LocalDate; +import java.time.OffsetDateTime; import java.util.ArrayList; -import java.util.StringJoiner; import java.util.List; import java.util.Map; -import java.util.Set; +import java.util.StringJoiner; import java.util.function.Consumer; +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.message.BasicNameValuePair; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Pair; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; +import org.openapitools.client.model.OuterComposite; +import org.openapitools.client.model.OuterEnum; +import org.openapitools.client.model.User; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FakeApi { - private final HttpClient memberVarHttpClient; - private final ObjectMapper memberVarObjectMapper; - private final String memberVarBaseUri; - private final Consumer memberVarInterceptor; - private final Duration memberVarReadTimeout; - private final Consumer> memberVarResponseInterceptor; - private final Consumer> memberVarAsyncResponseInterceptor; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; - public FakeApi() { - this(new ApiClient()); - } - - public FakeApi(ApiClient apiClient) { - memberVarHttpClient = apiClient.getHttpClient(); - memberVarObjectMapper = apiClient.getObjectMapper(); - memberVarBaseUri = apiClient.getBaseUri(); - memberVarInterceptor = apiClient.getRequestInterceptor(); - memberVarReadTimeout = apiClient.getReadTimeout(); - memberVarResponseInterceptor = apiClient.getResponseInterceptor(); - memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); - } - - protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { - String body = response.body() == null ? null : new String(response.body().readAllBytes()); - String message = formatExceptionMessage(operationId, response.statusCode(), body); - return new ApiException(response.statusCode(), message, response.headers(), body); - } - - private String formatExceptionMessage(String operationId, int statusCode, String body) { - if (body == null || body.isEmpty()) { - body = "[no body]"; + public FakeApi() { + this(new ApiClient()); } - return operationId + " call failed with: " + statusCode + " - " + body; - } - /** - * Health check endpoint - * - * @return HealthCheckResult - * @throws ApiException if fails to make API call - */ - public HealthCheckResult fakeHealthGet() throws ApiException { - ApiResponse localVarResponse = fakeHealthGetWithHttpInfo(); - return localVarResponse.getData(); - } + public FakeApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } - /** - * Health check endpoint - * - * @return ApiResponse<HealthCheckResult> - * @throws ApiException if fails to make API call - */ - public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = fakeHealthGetRequestBuilder(); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("fakeHealthGet", localVarResponse); + protected ApiException getApiException(String operationId, HttpResponse response) + throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); + return operationId + " call failed with: " + statusCode + " - " + body; } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); + + /** + * Health check endpoint + * + * @return HealthCheckResult + * @throws ApiException if fails to make API call + */ + public HealthCheckResult fakeHealthGet() throws ApiException { + ApiResponse localVarResponse = fakeHealthGetWithHttpInfo(); + return localVarResponse.getData(); } - } - private HttpRequest.Builder fakeHealthGetRequestBuilder() throws ApiException { - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake/health"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @return Boolean - * @throws ApiException if fails to make API call - */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { - ApiResponse localVarResponse = fakeOuterBooleanSerializeWithHttpInfo(body); - return localVarResponse.getData(); - } - - /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @return ApiResponse<Boolean> - * @throws ApiException if fails to make API call - */ - public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = fakeOuterBooleanSerializeRequestBuilder(body); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("fakeOuterBooleanSerialize", localVarResponse); + /** + * Health check endpoint + * + * @return ApiResponse<HealthCheckResult> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeHealthGetWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fakeHealthGetRequestBuilder(); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("fakeHealthGet", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference< + HealthCheckResult>() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - private HttpRequest.Builder fakeOuterBooleanSerializeRequestBuilder(Boolean body) throws ApiException { + private HttpRequest.Builder fakeHealthGetRequestBuilder() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/fake/outer/boolean"; + String localVarPath = "/fake/health"; - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "*/*"); + localVarRequestBuilder.header("Accept", "application/json"); - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * - * Test serialization of object with outer number type - * @param outerComposite Input composite as post body (optional) - * @return OuterComposite - * @throws ApiException if fails to make API call - */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) throws ApiException { - ApiResponse localVarResponse = fakeOuterCompositeSerializeWithHttpInfo(outerComposite); - return localVarResponse.getData(); - } - - /** - * - * Test serialization of object with outer number type - * @param outerComposite Input composite as post body (optional) - * @return ApiResponse<OuterComposite> - * @throws ApiException if fails to make API call - */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite outerComposite) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = fakeOuterCompositeSerializeRequestBuilder(outerComposite); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("fakeOuterCompositeSerialize", localVarResponse); + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder fakeOuterCompositeSerializeRequestBuilder(OuterComposite outerComposite) throws ApiException { - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake/outer/composite"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "*/*"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(outerComposite); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @return BigDecimal - * @throws ApiException if fails to make API call - */ - public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { - ApiResponse localVarResponse = fakeOuterNumberSerializeWithHttpInfo(body); - return localVarResponse.getData(); - } - - /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @return ApiResponse<BigDecimal> - * @throws ApiException if fails to make API call - */ - public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = fakeOuterNumberSerializeRequestBuilder(body); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("fakeOuterNumberSerialize", localVarResponse); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); + return localVarRequestBuilder; } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); + /** + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return Boolean + * @throws ApiException if fails to make API call + */ + public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { + ApiResponse localVarResponse = fakeOuterBooleanSerializeWithHttpInfo(body); + return localVarResponse.getData(); } - } - private HttpRequest.Builder fakeOuterNumberSerializeRequestBuilder(BigDecimal body) throws ApiException { - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake/outer/number"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "*/*"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @return String - * @throws ApiException if fails to make API call - */ - public String fakeOuterStringSerialize(String body) throws ApiException { - ApiResponse localVarResponse = fakeOuterStringSerializeWithHttpInfo(body); - return localVarResponse.getData(); - } - - /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = fakeOuterStringSerializeRequestBuilder(body); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("fakeOuterStringSerialize", localVarResponse); + /** + * Test serialization of outer boolean types + * + * @param body Input boolean as post body (optional) + * @return ApiResponse<Boolean> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fakeOuterBooleanSerializeRequestBuilder(body); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("fakeOuterBooleanSerialize", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - private HttpRequest.Builder fakeOuterStringSerializeRequestBuilder(String body) throws ApiException { + private HttpRequest.Builder fakeOuterBooleanSerializeRequestBuilder(Boolean body) + throws ApiException { - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - String localVarPath = "/fake/outer/string"; + String localVarPath = "/fake/outer/boolean"; - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "*/*"); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Array of Enums - * - * @return List<OuterEnum> - * @throws ApiException if fails to make API call - */ - public List getArrayOfEnums() throws ApiException { - ApiResponse> localVarResponse = getArrayOfEnumsWithHttpInfo(); - return localVarResponse.getData(); - } - - /** - * Array of Enums - * - * @return ApiResponse<List<OuterEnum>> - * @throws ApiException if fails to make API call - */ - public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getArrayOfEnumsRequestBuilder(); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getArrayOfEnums", localVarResponse); + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); } - return new ApiResponse>( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder getArrayOfEnumsRequestBuilder() throws ApiException { - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake/array-of-enums"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * - * For this test, the body for this request much reference a schema named `File`. - * @param fileSchemaTestClass (required) - * @throws ApiException if fails to make API call - */ - public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) throws ApiException { - testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); - } - - /** - * - * For this test, the body for this request much reference a schema named `File`. - * @param fileSchemaTestClass (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse testBodyWithFileSchemaWithHttpInfo(FileSchemaTestClass fileSchemaTestClass) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = testBodyWithFileSchemaRequestBuilder(fileSchemaTestClass); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testBodyWithFileSchema", localVarResponse); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); + return localVarRequestBuilder; } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder testBodyWithFileSchemaRequestBuilder(FileSchemaTestClass fileSchemaTestClass) throws ApiException { - // verify the required parameter 'fileSchemaTestClass' is set - if (fileSchemaTestClass == null) { - throw new ApiException(400, "Missing the required parameter 'fileSchemaTestClass' when calling testBodyWithFileSchema"); + /** + * Test serialization of object with outer number type + * + * @param outerComposite Input composite as post body (optional) + * @return OuterComposite + * @throws ApiException if fails to make API call + */ + public OuterComposite fakeOuterCompositeSerialize(OuterComposite outerComposite) + throws ApiException { + ApiResponse localVarResponse = + fakeOuterCompositeSerializeWithHttpInfo(outerComposite); + return localVarResponse.getData(); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake/body-with-file-schema"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(fileSchemaTestClass); - localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * - * - * @param query (required) - * @param user (required) - * @throws ApiException if fails to make API call - */ - public void testBodyWithQueryParams(String query, User user) throws ApiException { - testBodyWithQueryParamsWithHttpInfo(query, user); - } - - /** - * - * - * @param query (required) - * @param user (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = testBodyWithQueryParamsRequestBuilder(query, user); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testBodyWithQueryParams", localVarResponse); + /** + * Test serialization of object with outer number type + * + * @param outerComposite Input composite as post body (optional) + * @return ApiResponse<OuterComposite> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterCompositeSerializeWithHttpInfo( + OuterComposite outerComposite) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + fakeOuterCompositeSerializeRequestBuilder(outerComposite); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("fakeOuterCompositeSerialize", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference< + OuterComposite>() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + } + + private HttpRequest.Builder fakeOuterCompositeSerializeRequestBuilder( + OuterComposite outerComposite) throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/outer/composite"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(outerComposite); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder testBodyWithQueryParamsRequestBuilder(String query, User user) throws ApiException { - // verify the required parameter 'query' is set - if (query == null) { - throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); - } - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling testBodyWithQueryParams"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake/body-with-query-params"; - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "query"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("query", query)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); - localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * To test \"client\" model - * To test \"client\" model - * @param client client model (required) - * @return Client - * @throws ApiException if fails to make API call - */ - public Client testClientModel(Client client) throws ApiException { - ApiResponse localVarResponse = testClientModelWithHttpInfo(client); - return localVarResponse.getData(); - } - - /** - * To test \"client\" model - * To test \"client\" model - * @param client client model (required) - * @return ApiResponse<Client> - * @throws ApiException if fails to make API call - */ - public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = testClientModelRequestBuilder(client); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testClientModel", localVarResponse); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder testClientModelRequestBuilder(Client client) throws ApiException { - // verify the required parameter 'client' is set - if (client == null) { - throw new ApiException(400, "Missing the required parameter 'client' when calling testClientModel"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client); - localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) - * @param password None (optional) - * @param paramCallback None (optional) - * @throws ApiException if fails to make API call - */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - } - - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) - * @param password None (optional) - * @param paramCallback None (optional) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = testEndpointParametersRequestBuilder(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testEndpointParameters", localVarResponse); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + return localVarRequestBuilder; + } + /** + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return BigDecimal + * @throws ApiException if fails to make API call + */ + public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { + ApiResponse localVarResponse = fakeOuterNumberSerializeWithHttpInfo(body); + return localVarResponse.getData(); + } + + /** + * Test serialization of outer number types + * + * @param body Input number as post body (optional) + * @return ApiResponse<BigDecimal> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fakeOuterNumberSerializeRequestBuilder(body); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("fakeOuterNumberSerialize", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference< + BigDecimal>() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder testEndpointParametersRequestBuilder(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, File binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - // verify the required parameter 'number' is set - if (number == null) { - throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); - } - // verify the required parameter '_double' is set - if (_double == null) { - throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); - } - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); - } - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + private HttpRequest.Builder fakeOuterNumberSerializeRequestBuilder(BigDecimal body) + throws ApiException { - String localVarPath = "/fake"; + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + String localVarPath = "/fake/outer/number"; - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("integer", integer.toString())); - formValues.add(new BasicNameValuePair("int32", int32.toString())); - formValues.add(new BasicNameValuePair("int64", int64.toString())); - formValues.add(new BasicNameValuePair("number", number.toString())); - formValues.add(new BasicNameValuePair("float", _float.toString())); - formValues.add(new BasicNameValuePair("double", _double.toString())); - formValues.add(new BasicNameValuePair("string", string.toString())); - formValues.add(new BasicNameValuePair("pattern_without_delimiter", patternWithoutDelimiter.toString())); - formValues.add(new BasicNameValuePair("byte", _byte.toString())); - formValues.add(new BasicNameValuePair("binary", binary.toString())); - formValues.add(new BasicNameValuePair("date", date.toString())); - formValues.add(new BasicNameValuePair("dateTime", dateTime.toString())); - formValues.add(new BasicNameValuePair("password", password.toString())); - formValues.add(new BasicNameValuePair("callback", paramCallback.toString())); - HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); - ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); - try { - entity.writeTo(formOutputStream); - } catch (IOException e) { - throw new RuntimeException(e); - } - localVarRequestBuilder - .header("Content-Type", entity.getContentType().getValue()) - .method("POST", HttpRequest.BodyPublishers - .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray()))); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * To test enum parameters - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @throws ApiException if fails to make API call - */ - public void testEnumParameters(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - testEnumParametersWithHttpInfo(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - } + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); - /** - * To test enum parameters - * To test enum parameters - * @param enumHeaderStringArray Header parameter enum test (string array) (optional - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse testEnumParametersWithHttpInfo(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = testEnumParametersRequestBuilder(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testEnumParameters", localVarResponse); + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(body); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder testEnumParametersRequestBuilder(List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble, List enumFormStringArray, String enumFormString) throws ApiException { - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake"; - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "enum_query_string_array"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "enum_query_string_array", enumQueryStringArray)); - localVarQueryParameterBaseName = "enum_query_string"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("enum_query_string", enumQueryString)); - localVarQueryParameterBaseName = "enum_query_integer"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("enum_query_integer", enumQueryInteger)); - localVarQueryParameterBaseName = "enum_query_double"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("enum_query_double", enumQueryDouble)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - if (enumHeaderStringArray != null) { - localVarRequestBuilder.header("enum_header_string_array", enumHeaderStringArray.toString()); - } - if (enumHeaderString != null) { - localVarRequestBuilder.header("enum_header_string", enumHeaderString.toString()); - } - localVarRequestBuilder.header("Accept", "application/json"); - - List formValues = new ArrayList<>(); - for (int i=0; i < enumFormStringArray.size(); i++) { - formValues.add(new BasicNameValuePair("enum_form_string_array", enumFormStringArray.get(i).toString())); - } - formValues.add(new BasicNameValuePair("enum_form_string", enumFormString.toString())); - HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); - ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); - try { - entity.writeTo(formOutputStream); - } catch (IOException e) { - throw new RuntimeException(e); - } - localVarRequestBuilder - .header("Content-Type", entity.getContentType().getValue()) - .method("GET", HttpRequest.BodyPublishers - .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray()))); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param apiRequest {@link APItestGroupParametersRequest} - * @throws ApiException if fails to make API call - */ - public void testGroupParameters(APItestGroupParametersRequest apiRequest) throws ApiException { - Integer requiredStringGroup = apiRequest.requiredStringGroup(); - Boolean requiredBooleanGroup = apiRequest.requiredBooleanGroup(); - Long requiredInt64Group = apiRequest.requiredInt64Group(); - Integer stringGroup = apiRequest.stringGroup(); - Boolean booleanGroup = apiRequest.booleanGroup(); - Long int64Group = apiRequest.int64Group(); - testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - - /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param apiRequest {@link APItestGroupParametersRequest} - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse testGroupParametersWithHttpInfo(APItestGroupParametersRequest apiRequest) throws ApiException { - Integer requiredStringGroup = apiRequest.requiredStringGroup(); - Boolean requiredBooleanGroup = apiRequest.requiredBooleanGroup(); - Long requiredInt64Group = apiRequest.requiredInt64Group(); - Integer stringGroup = apiRequest.stringGroup(); - Boolean booleanGroup = apiRequest.booleanGroup(); - Long int64Group = apiRequest.int64Group(); - return testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - - /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @throws ApiException if fails to make API call - */ - public void testGroupParameters(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - testGroupParametersWithHttpInfo(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - } - - /** - * Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse testGroupParametersWithHttpInfo(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = testGroupParametersRequestBuilder(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testGroupParameters", localVarResponse); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + return localVarRequestBuilder; + } + /** + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return String + * @throws ApiException if fails to make API call + */ + public String fakeOuterStringSerialize(String body) throws ApiException { + ApiResponse localVarResponse = fakeOuterStringSerializeWithHttpInfo(body); + return localVarResponse.getData(); + } + + /** + * Test serialization of outer string types + * + * @param body Input string as post body (optional) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = fakeOuterStringSerializeRequestBuilder(body); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("fakeOuterStringSerialize", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder testGroupParametersRequestBuilder(Integer requiredStringGroup, Boolean requiredBooleanGroup, Long requiredInt64Group, Integer stringGroup, Boolean booleanGroup, Long int64Group) throws ApiException { - // verify the required parameter 'requiredStringGroup' is set - if (requiredStringGroup == null) { - throw new ApiException(400, "Missing the required parameter 'requiredStringGroup' when calling testGroupParameters"); - } - // verify the required parameter 'requiredBooleanGroup' is set - if (requiredBooleanGroup == null) { - throw new ApiException(400, "Missing the required parameter 'requiredBooleanGroup' when calling testGroupParameters"); - } - // verify the required parameter 'requiredInt64Group' is set - if (requiredInt64Group == null) { - throw new ApiException(400, "Missing the required parameter 'requiredInt64Group' when calling testGroupParameters"); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + private HttpRequest.Builder fakeOuterStringSerializeRequestBuilder(String body) + throws ApiException { - String localVarPath = "/fake"; + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "required_string_group"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("required_string_group", requiredStringGroup)); - localVarQueryParameterBaseName = "required_int64_group"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("required_int64_group", requiredInt64Group)); - localVarQueryParameterBaseName = "string_group"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("string_group", stringGroup)); - localVarQueryParameterBaseName = "int64_group"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("int64_group", int64Group)); + String localVarPath = "/fake/outer/string"; - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - if (requiredBooleanGroup != null) { - localVarRequestBuilder.header("required_boolean_group", requiredBooleanGroup.toString()); - } - if (booleanGroup != null) { - localVarRequestBuilder.header("boolean_group", booleanGroup.toString()); - } - localVarRequestBuilder.header("Accept", "application/json"); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "*/*"); - localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - - public static final class APItestGroupParametersRequest { - private Integer requiredStringGroup; // Required String in group parameters (required) - private Boolean requiredBooleanGroup; // Required Boolean in group parameters (required) - private Long requiredInt64Group; // Required Integer in group parameters (required) - private Integer stringGroup; // String in group parameters (optional) - private Boolean booleanGroup; // Boolean in group parameters (optional) - private Long int64Group; // Integer in group parameters (optional) - - private APItestGroupParametersRequest(Builder builder) { - this.requiredStringGroup = builder.requiredStringGroup; - this.requiredBooleanGroup = builder.requiredBooleanGroup; - this.requiredInt64Group = builder.requiredInt64Group; - this.stringGroup = builder.stringGroup; - this.booleanGroup = builder.booleanGroup; - this.int64Group = builder.int64Group; - } - public Integer requiredStringGroup() { - return requiredStringGroup; - } - public Boolean requiredBooleanGroup() { - return requiredBooleanGroup; - } - public Long requiredInt64Group() { - return requiredInt64Group; - } - public Integer stringGroup() { - return stringGroup; - } - public Boolean booleanGroup() { - return booleanGroup; - } - public Long int64Group() { - return int64Group; - } - public static Builder newBuilder() { - return new Builder(); - } - - public static class Builder { - private Integer requiredStringGroup; - private Boolean requiredBooleanGroup; - private Long requiredInt64Group; - private Integer stringGroup; - private Boolean booleanGroup; - private Long int64Group; - - public Builder requiredStringGroup(Integer requiredStringGroup) { - this.requiredStringGroup = requiredStringGroup; - return this; - } - public Builder requiredBooleanGroup(Boolean requiredBooleanGroup) { - this.requiredBooleanGroup = requiredBooleanGroup; - return this; - } - public Builder requiredInt64Group(Long requiredInt64Group) { - this.requiredInt64Group = requiredInt64Group; - return this; - } - public Builder stringGroup(Integer stringGroup) { - this.stringGroup = stringGroup; - return this; - } - public Builder booleanGroup(Boolean booleanGroup) { - this.booleanGroup = booleanGroup; - return this; - } - public Builder int64Group(Long int64Group) { - this.int64Group = int64Group; - return this; - } - public APItestGroupParametersRequest build() { - return new APItestGroupParametersRequest(this); - } - } - } - - /** - * test inline additionalProperties - * - * @param requestBody request body (required) - * @throws ApiException if fails to make API call - */ - public void testInlineAdditionalProperties(Map requestBody) throws ApiException { - testInlineAdditionalPropertiesWithHttpInfo(requestBody); - } - - /** - * test inline additionalProperties - * - * @param requestBody request body (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Map requestBody) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = testInlineAdditionalPropertiesRequestBuilder(requestBody); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testInlineAdditionalProperties", localVarResponse); + localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofString(body)); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); + return localVarRequestBuilder; } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder testInlineAdditionalPropertiesRequestBuilder(Map requestBody) throws ApiException { - // verify the required parameter 'requestBody' is set - if (requestBody == null) { - throw new ApiException(400, "Missing the required parameter 'requestBody' when calling testInlineAdditionalProperties"); + /** + * Array of Enums + * + * @return List<OuterEnum> + * @throws ApiException if fails to make API call + */ + public List getArrayOfEnums() throws ApiException { + ApiResponse> localVarResponse = getArrayOfEnumsWithHttpInfo(); + return localVarResponse.getData(); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake/inline-additionalProperties"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @throws ApiException if fails to make API call - */ - public void testJsonFormData(String param, String param2) throws ApiException { - testJsonFormDataWithHttpInfo(param, param2); - } - - /** - * test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = testJsonFormDataRequestBuilder(param, param2); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testJsonFormData", localVarResponse); + /** + * Array of Enums + * + * @return ApiResponse<List<OuterEnum>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getArrayOfEnumsWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getArrayOfEnumsRequestBuilder(); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getArrayOfEnums", localVarResponse); + } + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference< + List>() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + } + + private HttpRequest.Builder getArrayOfEnumsRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/array-of-enums"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder testJsonFormDataRequestBuilder(String param, String param2) throws ApiException { - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); - } - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake/jsonFormData"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/json"); - - List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("param", param.toString())); - formValues.add(new BasicNameValuePair("param2", param2.toString())); - HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); - ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); - try { - entity.writeTo(formOutputStream); - } catch (IOException e) { - throw new RuntimeException(e); - } - localVarRequestBuilder - .header("Content-Type", entity.getContentType().getValue()) - .method("GET", HttpRequest.BodyPublishers - .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray()))); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * - * To test the collection format in query parameters - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @throws ApiException if fails to make API call - */ - public void testQueryParameterCollectionFormat(List pipe, List ioutil, List http, List url, List context) throws ApiException { - testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); - } - - /** - * - * To test the collection format in query parameters - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse testQueryParameterCollectionFormatWithHttpInfo(List pipe, List ioutil, List http, List url, List context) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = testQueryParameterCollectionFormatRequestBuilder(pipe, ioutil, http, url, context); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testQueryParameterCollectionFormat", localVarResponse); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + return localVarRequestBuilder; + } + /** + * For this test, the body for this request much reference a schema named `File`. + * + * @param fileSchemaTestClass (required) + * @throws ApiException if fails to make API call + */ + public void testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) + throws ApiException { + testBodyWithFileSchemaWithHttpInfo(fileSchemaTestClass); + } + + /** + * For this test, the body for this request much reference a schema named `File`. + * + * @param fileSchemaTestClass (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testBodyWithFileSchemaWithHttpInfo( + FileSchemaTestClass fileSchemaTestClass) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + testBodyWithFileSchemaRequestBuilder(fileSchemaTestClass); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("testBodyWithFileSchema", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder testQueryParameterCollectionFormatRequestBuilder(List pipe, List ioutil, List http, List url, List context) throws ApiException { - // verify the required parameter 'pipe' is set - if (pipe == null) { - throw new ApiException(400, "Missing the required parameter 'pipe' when calling testQueryParameterCollectionFormat"); - } - // verify the required parameter 'ioutil' is set - if (ioutil == null) { - throw new ApiException(400, "Missing the required parameter 'ioutil' when calling testQueryParameterCollectionFormat"); - } - // verify the required parameter 'http' is set - if (http == null) { - throw new ApiException(400, "Missing the required parameter 'http' when calling testQueryParameterCollectionFormat"); - } - // verify the required parameter 'url' is set - if (url == null) { - throw new ApiException(400, "Missing the required parameter 'url' when calling testQueryParameterCollectionFormat"); - } - // verify the required parameter 'context' is set - if (context == null) { - throw new ApiException(400, "Missing the required parameter 'context' when calling testQueryParameterCollectionFormat"); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + private HttpRequest.Builder testBodyWithFileSchemaRequestBuilder( + FileSchemaTestClass fileSchemaTestClass) throws ApiException { + // verify the required parameter 'fileSchemaTestClass' is set + if (fileSchemaTestClass == null) { + throw new ApiException( + 400, + "Missing the required parameter 'fileSchemaTestClass' when calling" + + " testBodyWithFileSchema"); + } - String localVarPath = "/fake/test-query-parameters"; + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "pipe"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "pipe", pipe)); - localVarQueryParameterBaseName = "ioutil"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); - localVarQueryParameterBaseName = "http"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("ssv", "http", http)); - localVarQueryParameterBaseName = "url"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); - localVarQueryParameterBaseName = "context"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); + String localVarPath = "/fake/body-with-file-schema"; - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(fileSchemaTestClass); + localVarRequestBuilder.method( + "PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * @param query (required) + * @param user (required) + * @throws ApiException if fails to make API call + */ + public void testBodyWithQueryParams(String query, User user) throws ApiException { + testBodyWithQueryParamsWithHttpInfo(query, user); } - localVarRequestBuilder.header("Accept", "application/json"); + /** + * @param query (required) + * @param user (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testBodyWithQueryParamsWithHttpInfo(String query, User user) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + testBodyWithQueryParamsRequestBuilder(query, user); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("testBodyWithQueryParams", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } - localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); + private HttpRequest.Builder testBodyWithQueryParamsRequestBuilder(String query, User user) + throws ApiException { + // verify the required parameter 'query' is set + if (query == null) { + throw new ApiException( + 400, + "Missing the required parameter 'query' when calling testBodyWithQueryParams"); + } + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException( + 400, + "Missing the required parameter 'user' when calling testBodyWithQueryParams"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/body-with-query-params"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "query"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("query", query)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); + localVarRequestBuilder.method( + "PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); + /** + * To test \"client\" model To test \"client\" model + * + * @param client client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testClientModel(Client client) throws ApiException { + ApiResponse localVarResponse = testClientModelWithHttpInfo(client); + return localVarResponse.getData(); + } + + /** + * To test \"client\" model To test \"client\" model + * + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + */ + public ApiResponse testClientModelWithHttpInfo(Client client) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testClientModelRequestBuilder(client); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("testClientModel", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testClientModelRequestBuilder(Client client) throws ApiException { + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException( + 400, "Missing the required parameter 'client' when calling testClientModel"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client); + localVarRequestBuilder.method( + "PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for + * testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) + * @param password None (optional) + * @param paramCallback None (optional) + * @throws ApiException if fails to make API call + */ + public void testEndpointParameters( + BigDecimal number, + Double _double, + String patternWithoutDelimiter, + byte[] _byte, + Integer integer, + Integer int32, + Long int64, + Float _float, + String string, + File binary, + LocalDate date, + OffsetDateTime dateTime, + String password, + String paramCallback) + throws ApiException { + testEndpointParametersWithHttpInfo( + number, + _double, + patternWithoutDelimiter, + _byte, + integer, + int32, + int64, + _float, + string, + binary, + date, + dateTime, + password, + paramCallback); + } + + /** + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for + * testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * + * @param number None (required) + * @param _double None (required) + * @param patternWithoutDelimiter None (required) + * @param _byte None (required) + * @param integer None (optional) + * @param int32 None (optional) + * @param int64 None (optional) + * @param _float None (optional) + * @param string None (optional) + * @param binary None (optional) + * @param date None (optional) + * @param dateTime None (optional, default to 2010-02-01T10:20:10.111110+01:00) + * @param password None (optional) + * @param paramCallback None (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testEndpointParametersWithHttpInfo( + BigDecimal number, + Double _double, + String patternWithoutDelimiter, + byte[] _byte, + Integer integer, + Integer int32, + Long int64, + Float _float, + String string, + File binary, + LocalDate date, + OffsetDateTime dateTime, + String password, + String paramCallback) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + testEndpointParametersRequestBuilder( + number, + _double, + patternWithoutDelimiter, + _byte, + integer, + int32, + int64, + _float, + string, + binary, + date, + dateTime, + password, + paramCallback); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("testEndpointParameters", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testEndpointParametersRequestBuilder( + BigDecimal number, + Double _double, + String patternWithoutDelimiter, + byte[] _byte, + Integer integer, + Integer int32, + Long int64, + Float _float, + String string, + File binary, + LocalDate date, + OffsetDateTime dateTime, + String password, + String paramCallback) + throws ApiException { + // verify the required parameter 'number' is set + if (number == null) { + throw new ApiException( + 400, + "Missing the required parameter 'number' when calling testEndpointParameters"); + } + // verify the required parameter '_double' is set + if (_double == null) { + throw new ApiException( + 400, + "Missing the required parameter '_double' when calling testEndpointParameters"); + } + // verify the required parameter 'patternWithoutDelimiter' is set + if (patternWithoutDelimiter == null) { + throw new ApiException( + 400, + "Missing the required parameter 'patternWithoutDelimiter' when calling" + + " testEndpointParameters"); + } + // verify the required parameter '_byte' is set + if (_byte == null) { + throw new ApiException( + 400, + "Missing the required parameter '_byte' when calling testEndpointParameters"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + List formValues = new ArrayList<>(); + formValues.add(new BasicNameValuePair("integer", integer.toString())); + formValues.add(new BasicNameValuePair("int32", int32.toString())); + formValues.add(new BasicNameValuePair("int64", int64.toString())); + formValues.add(new BasicNameValuePair("number", number.toString())); + formValues.add(new BasicNameValuePair("float", _float.toString())); + formValues.add(new BasicNameValuePair("double", _double.toString())); + formValues.add(new BasicNameValuePair("string", string.toString())); + formValues.add( + new BasicNameValuePair( + "pattern_without_delimiter", patternWithoutDelimiter.toString())); + formValues.add(new BasicNameValuePair("byte", _byte.toString())); + formValues.add(new BasicNameValuePair("binary", binary.toString())); + formValues.add(new BasicNameValuePair("date", date.toString())); + formValues.add(new BasicNameValuePair("dateTime", dateTime.toString())); + formValues.add(new BasicNameValuePair("password", password.toString())); + formValues.add(new BasicNameValuePair("callback", paramCallback.toString())); + HttpEntity entity = + new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method( + "POST", + HttpRequest.BodyPublishers.ofInputStream( + () -> new ByteArrayInputStream(formOutputStream.toByteArray()))); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * To test enum parameters To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @throws ApiException if fails to make API call + */ + public void testEnumParameters( + List enumHeaderStringArray, + String enumHeaderString, + List enumQueryStringArray, + String enumQueryString, + Integer enumQueryInteger, + Double enumQueryDouble, + List enumFormStringArray, + String enumFormString) + throws ApiException { + testEnumParametersWithHttpInfo( + enumHeaderStringArray, + enumHeaderString, + enumQueryStringArray, + enumQueryString, + enumQueryInteger, + enumQueryDouble, + enumFormStringArray, + enumFormString); + } + + /** + * To test enum parameters To test enum parameters + * + * @param enumHeaderStringArray Header parameter enum test (string array) (optional + * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) + * @param enumQueryStringArray Query parameter enum test (string array) (optional + * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) + * @param enumQueryInteger Query parameter enum test (double) (optional) + * @param enumQueryDouble Query parameter enum test (double) (optional) + * @param enumFormStringArray Form parameter enum test (string array) (optional + * @param enumFormString Form parameter enum test (string) (optional, default to -efg) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testEnumParametersWithHttpInfo( + List enumHeaderStringArray, + String enumHeaderString, + List enumQueryStringArray, + String enumQueryString, + Integer enumQueryInteger, + Double enumQueryDouble, + List enumFormStringArray, + String enumFormString) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + testEnumParametersRequestBuilder( + enumHeaderStringArray, + enumHeaderString, + enumQueryStringArray, + enumQueryString, + enumQueryInteger, + enumQueryDouble, + enumFormStringArray, + enumFormString); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("testEnumParameters", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testEnumParametersRequestBuilder( + List enumHeaderStringArray, + String enumHeaderString, + List enumQueryStringArray, + String enumQueryString, + Integer enumQueryInteger, + Double enumQueryDouble, + List enumFormStringArray, + String enumFormString) + throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "enum_query_string_array"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs( + "multi", "enum_query_string_array", enumQueryStringArray)); + localVarQueryParameterBaseName = "enum_query_string"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("enum_query_string", enumQueryString)); + localVarQueryParameterBaseName = "enum_query_integer"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("enum_query_integer", enumQueryInteger)); + localVarQueryParameterBaseName = "enum_query_double"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("enum_query_double", enumQueryDouble)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + if (enumHeaderStringArray != null) { + localVarRequestBuilder.header( + "enum_header_string_array", enumHeaderStringArray.toString()); + } + if (enumHeaderString != null) { + localVarRequestBuilder.header("enum_header_string", enumHeaderString.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + + List formValues = new ArrayList<>(); + for (int i = 0; i < enumFormStringArray.size(); i++) { + formValues.add( + new BasicNameValuePair( + "enum_form_string_array", enumFormStringArray.get(i).toString())); + } + formValues.add(new BasicNameValuePair("enum_form_string", enumFormString.toString())); + HttpEntity entity = + new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method( + "GET", + HttpRequest.BodyPublishers.ofInputStream( + () -> new ByteArrayInputStream(formOutputStream.toByteArray()))); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters + * (optional) + * + * @param apiRequest {@link APItestGroupParametersRequest} + * @throws ApiException if fails to make API call + */ + public void testGroupParameters(APItestGroupParametersRequest apiRequest) throws ApiException { + Integer requiredStringGroup = apiRequest.requiredStringGroup(); + Boolean requiredBooleanGroup = apiRequest.requiredBooleanGroup(); + Long requiredInt64Group = apiRequest.requiredInt64Group(); + Integer stringGroup = apiRequest.stringGroup(); + Boolean booleanGroup = apiRequest.booleanGroup(); + Long int64Group = apiRequest.int64Group(); + testGroupParameters( + requiredStringGroup, + requiredBooleanGroup, + requiredInt64Group, + stringGroup, + booleanGroup, + int64Group); + } + + /** + * Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters + * (optional) + * + * @param apiRequest {@link APItestGroupParametersRequest} + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testGroupParametersWithHttpInfo( + APItestGroupParametersRequest apiRequest) throws ApiException { + Integer requiredStringGroup = apiRequest.requiredStringGroup(); + Boolean requiredBooleanGroup = apiRequest.requiredBooleanGroup(); + Long requiredInt64Group = apiRequest.requiredInt64Group(); + Integer stringGroup = apiRequest.stringGroup(); + Boolean booleanGroup = apiRequest.booleanGroup(); + Long int64Group = apiRequest.int64Group(); + return testGroupParametersWithHttpInfo( + requiredStringGroup, + requiredBooleanGroup, + requiredInt64Group, + stringGroup, + booleanGroup, + int64Group); + } + + /** + * Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters + * (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @throws ApiException if fails to make API call + */ + public void testGroupParameters( + Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Integer stringGroup, + Boolean booleanGroup, + Long int64Group) + throws ApiException { + testGroupParametersWithHttpInfo( + requiredStringGroup, + requiredBooleanGroup, + requiredInt64Group, + stringGroup, + booleanGroup, + int64Group); + } + + /** + * Fake endpoint to test group parameters (optional) Fake endpoint to test group parameters + * (optional) + * + * @param requiredStringGroup Required String in group parameters (required) + * @param requiredBooleanGroup Required Boolean in group parameters (required) + * @param requiredInt64Group Required Integer in group parameters (required) + * @param stringGroup String in group parameters (optional) + * @param booleanGroup Boolean in group parameters (optional) + * @param int64Group Integer in group parameters (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testGroupParametersWithHttpInfo( + Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Integer stringGroup, + Boolean booleanGroup, + Long int64Group) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + testGroupParametersRequestBuilder( + requiredStringGroup, + requiredBooleanGroup, + requiredInt64Group, + stringGroup, + booleanGroup, + int64Group); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("testGroupParameters", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testGroupParametersRequestBuilder( + Integer requiredStringGroup, + Boolean requiredBooleanGroup, + Long requiredInt64Group, + Integer stringGroup, + Boolean booleanGroup, + Long int64Group) + throws ApiException { + // verify the required parameter 'requiredStringGroup' is set + if (requiredStringGroup == null) { + throw new ApiException( + 400, + "Missing the required parameter 'requiredStringGroup' when calling" + + " testGroupParameters"); + } + // verify the required parameter 'requiredBooleanGroup' is set + if (requiredBooleanGroup == null) { + throw new ApiException( + 400, + "Missing the required parameter 'requiredBooleanGroup' when calling" + + " testGroupParameters"); + } + // verify the required parameter 'requiredInt64Group' is set + if (requiredInt64Group == null) { + throw new ApiException( + 400, + "Missing the required parameter 'requiredInt64Group' when calling" + + " testGroupParameters"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "required_string_group"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("required_string_group", requiredStringGroup)); + localVarQueryParameterBaseName = "required_int64_group"; + localVarQueryParams.addAll( + ApiClient.parameterToPairs("required_int64_group", requiredInt64Group)); + localVarQueryParameterBaseName = "string_group"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("string_group", stringGroup)); + localVarQueryParameterBaseName = "int64_group"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("int64_group", int64Group)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + if (requiredBooleanGroup != null) { + localVarRequestBuilder.header( + "required_boolean_group", requiredBooleanGroup.toString()); + } + if (booleanGroup != null) { + localVarRequestBuilder.header("boolean_group", booleanGroup.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + + public static final class APItestGroupParametersRequest { + private Integer requiredStringGroup; // Required String in group parameters (required) + private Boolean requiredBooleanGroup; // Required Boolean in group parameters (required) + private Long requiredInt64Group; // Required Integer in group parameters (required) + private Integer stringGroup; // String in group parameters (optional) + private Boolean booleanGroup; // Boolean in group parameters (optional) + private Long int64Group; // Integer in group parameters (optional) + + private APItestGroupParametersRequest(Builder builder) { + this.requiredStringGroup = builder.requiredStringGroup; + this.requiredBooleanGroup = builder.requiredBooleanGroup; + this.requiredInt64Group = builder.requiredInt64Group; + this.stringGroup = builder.stringGroup; + this.booleanGroup = builder.booleanGroup; + this.int64Group = builder.int64Group; + } + + public Integer requiredStringGroup() { + return requiredStringGroup; + } + + public Boolean requiredBooleanGroup() { + return requiredBooleanGroup; + } + + public Long requiredInt64Group() { + return requiredInt64Group; + } + + public Integer stringGroup() { + return stringGroup; + } + + public Boolean booleanGroup() { + return booleanGroup; + } + + public Long int64Group() { + return int64Group; + } + + public static Builder newBuilder() { + return new Builder(); + } + + public static class Builder { + private Integer requiredStringGroup; + private Boolean requiredBooleanGroup; + private Long requiredInt64Group; + private Integer stringGroup; + private Boolean booleanGroup; + private Long int64Group; + + public Builder requiredStringGroup(Integer requiredStringGroup) { + this.requiredStringGroup = requiredStringGroup; + return this; + } + + public Builder requiredBooleanGroup(Boolean requiredBooleanGroup) { + this.requiredBooleanGroup = requiredBooleanGroup; + return this; + } + + public Builder requiredInt64Group(Long requiredInt64Group) { + this.requiredInt64Group = requiredInt64Group; + return this; + } + + public Builder stringGroup(Integer stringGroup) { + this.stringGroup = stringGroup; + return this; + } + + public Builder booleanGroup(Boolean booleanGroup) { + this.booleanGroup = booleanGroup; + return this; + } + + public Builder int64Group(Long int64Group) { + this.int64Group = int64Group; + return this; + } + + public APItestGroupParametersRequest build() { + return new APItestGroupParametersRequest(this); + } + } + } + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @throws ApiException if fails to make API call + */ + public void testInlineAdditionalProperties(Map requestBody) + throws ApiException { + testInlineAdditionalPropertiesWithHttpInfo(requestBody); + } + + /** + * test inline additionalProperties + * + * @param requestBody request body (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testInlineAdditionalPropertiesWithHttpInfo( + Map requestBody) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + testInlineAdditionalPropertiesRequestBuilder(requestBody); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("testInlineAdditionalProperties", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testInlineAdditionalPropertiesRequestBuilder( + Map requestBody) throws ApiException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException( + 400, + "Missing the required parameter 'requestBody' when calling" + + " testInlineAdditionalProperties"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/inline-additionalProperties"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(requestBody); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @throws ApiException if fails to make API call + */ + public void testJsonFormData(String param, String param2) throws ApiException { + testJsonFormDataWithHttpInfo(param, param2); + } + + /** + * test json serialization of form data + * + * @param param field1 (required) + * @param param2 field2 (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testJsonFormDataRequestBuilder(param, param2); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("testJsonFormData", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testJsonFormDataRequestBuilder(String param, String param2) + throws ApiException { + // verify the required parameter 'param' is set + if (param == null) { + throw new ApiException( + 400, "Missing the required parameter 'param' when calling testJsonFormData"); + } + // verify the required parameter 'param2' is set + if (param2 == null) { + throw new ApiException( + 400, "Missing the required parameter 'param2' when calling testJsonFormData"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/jsonFormData"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + List formValues = new ArrayList<>(); + formValues.add(new BasicNameValuePair("param", param.toString())); + formValues.add(new BasicNameValuePair("param2", param2.toString())); + HttpEntity entity = + new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method( + "GET", + HttpRequest.BodyPublishers.ofInputStream( + () -> new ByteArrayInputStream(formOutputStream.toByteArray()))); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @throws ApiException if fails to make API call + */ + public void testQueryParameterCollectionFormat( + List pipe, + List ioutil, + List http, + List url, + List context) + throws ApiException { + testQueryParameterCollectionFormatWithHttpInfo(pipe, ioutil, http, url, context); + } + + /** + * To test the collection format in query parameters + * + * @param pipe (required) + * @param ioutil (required) + * @param http (required) + * @param url (required) + * @param context (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse testQueryParameterCollectionFormatWithHttpInfo( + List pipe, + List ioutil, + List http, + List url, + List context) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + testQueryParameterCollectionFormatRequestBuilder(pipe, ioutil, http, url, context); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("testQueryParameterCollectionFormat", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder testQueryParameterCollectionFormatRequestBuilder( + List pipe, + List ioutil, + List http, + List url, + List context) + throws ApiException { + // verify the required parameter 'pipe' is set + if (pipe == null) { + throw new ApiException( + 400, + "Missing the required parameter 'pipe' when calling" + + " testQueryParameterCollectionFormat"); + } + // verify the required parameter 'ioutil' is set + if (ioutil == null) { + throw new ApiException( + 400, + "Missing the required parameter 'ioutil' when calling" + + " testQueryParameterCollectionFormat"); + } + // verify the required parameter 'http' is set + if (http == null) { + throw new ApiException( + 400, + "Missing the required parameter 'http' when calling" + + " testQueryParameterCollectionFormat"); + } + // verify the required parameter 'url' is set + if (url == null) { + throw new ApiException( + 400, + "Missing the required parameter 'url' when calling" + + " testQueryParameterCollectionFormat"); + } + // verify the required parameter 'context' is set + if (context == null) { + throw new ApiException( + 400, + "Missing the required parameter 'context' when calling" + + " testQueryParameterCollectionFormat"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake/test-query-parameters"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "pipe"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "pipe", pipe)); + localVarQueryParameterBaseName = "ioutil"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "ioutil", ioutil)); + localVarQueryParameterBaseName = "http"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("ssv", "http", http)); + localVarQueryParameterBaseName = "url"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "url", url)); + localVarQueryParameterBaseName = "context"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("multi", "context", context)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - return localVarRequestBuilder; - } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java index e7b970d928a7..2b300958df7c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/FakeClassnameTags123Api.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,155 +12,141 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Pair; - -import org.openapitools.client.model.Client; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; - -import java.io.InputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; import java.io.IOException; -import java.io.OutputStream; -import java.net.http.HttpRequest; -import java.nio.channels.Channels; -import java.nio.channels.Pipe; +import java.io.InputStream; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; - -import java.util.ArrayList; -import java.util.StringJoiner; -import java.util.List; -import java.util.Map; -import java.util.Set; import java.util.function.Consumer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.model.Client; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FakeClassnameTags123Api { - private final HttpClient memberVarHttpClient; - private final ObjectMapper memberVarObjectMapper; - private final String memberVarBaseUri; - private final Consumer memberVarInterceptor; - private final Duration memberVarReadTimeout; - private final Consumer> memberVarResponseInterceptor; - private final Consumer> memberVarAsyncResponseInterceptor; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; - public FakeClassnameTags123Api() { - this(new ApiClient()); - } - - public FakeClassnameTags123Api(ApiClient apiClient) { - memberVarHttpClient = apiClient.getHttpClient(); - memberVarObjectMapper = apiClient.getObjectMapper(); - memberVarBaseUri = apiClient.getBaseUri(); - memberVarInterceptor = apiClient.getRequestInterceptor(); - memberVarReadTimeout = apiClient.getReadTimeout(); - memberVarResponseInterceptor = apiClient.getResponseInterceptor(); - memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); - } - - protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { - String body = response.body() == null ? null : new String(response.body().readAllBytes()); - String message = formatExceptionMessage(operationId, response.statusCode(), body); - return new ApiException(response.statusCode(), message, response.headers(), body); - } - - private String formatExceptionMessage(String operationId, int statusCode, String body) { - if (body == null || body.isEmpty()) { - body = "[no body]"; + public FakeClassnameTags123Api() { + this(new ApiClient()); } - return operationId + " call failed with: " + statusCode + " - " + body; - } - /** - * To test class name in snake case - * To test class name in snake case - * @param client client model (required) - * @return Client - * @throws ApiException if fails to make API call - */ - public Client testClassname(Client client) throws ApiException { - ApiResponse localVarResponse = testClassnameWithHttpInfo(client); - return localVarResponse.getData(); - } + public FakeClassnameTags123Api(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } - /** - * To test class name in snake case - * To test class name in snake case - * @param client client model (required) - * @return ApiResponse<Client> - * @throws ApiException if fails to make API call - */ - public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = testClassnameRequestBuilder(client); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("testClassname", localVarResponse); + protected ApiException getApiException(String operationId, HttpResponse response) + throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder testClassnameRequestBuilder(Client client) throws ApiException { - // verify the required parameter 'client' is set - if (client == null) { - throw new ApiException(400, "Missing the required parameter 'client' when calling testClassname"); + return operationId + " call failed with: " + statusCode + " - " + body; } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake_classname_test"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client); - localVarRequestBuilder.method("PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); + /** + * To test class name in snake case To test class name in snake case + * + * @param client client model (required) + * @return Client + * @throws ApiException if fails to make API call + */ + public Client testClassname(Client client) throws ApiException { + ApiResponse localVarResponse = testClassnameWithHttpInfo(client); + return localVarResponse.getData(); } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); + + /** + * To test class name in snake case To test class name in snake case + * + * @param client client model (required) + * @return ApiResponse<Client> + * @throws ApiException if fails to make API call + */ + public ApiResponse testClassnameWithHttpInfo(Client client) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = testClassnameRequestBuilder(client); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("testClassname", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); + + private HttpRequest.Builder testClassnameRequestBuilder(Client client) throws ApiException { + // verify the required parameter 'client' is set + if (client == null) { + throw new ApiException( + 400, "Missing the required parameter 'client' when calling testClassname"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/fake_classname_test"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(client); + localVarRequestBuilder.method( + "PATCH", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - return localVarRequestBuilder; - } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java index 5409a1afb87c..adadccbe364a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/PetApi.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,884 +12,942 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Pair; - -import java.io.File; -import org.openapitools.client.model.ModelApiResponse; -import org.openapitools.client.model.Pet; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; - -import java.io.InputStream; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.IOException; +import java.io.InputStream; import java.io.OutputStream; -import java.net.http.HttpRequest; -import java.nio.channels.Channels; -import java.nio.channels.Pipe; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; +import java.nio.channels.Channels; +import java.nio.channels.Pipe; import java.time.Duration; - import java.util.ArrayList; -import java.util.StringJoiner; import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.StringJoiner; import java.util.function.Consumer; +import org.apache.http.HttpEntity; +import org.apache.http.NameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.message.BasicNameValuePair; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Pair; +import org.openapitools.client.model.ModelApiResponse; +import org.openapitools.client.model.Pet; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class PetApi { - private final HttpClient memberVarHttpClient; - private final ObjectMapper memberVarObjectMapper; - private final String memberVarBaseUri; - private final Consumer memberVarInterceptor; - private final Duration memberVarReadTimeout; - private final Consumer> memberVarResponseInterceptor; - private final Consumer> memberVarAsyncResponseInterceptor; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; - public PetApi() { - this(new ApiClient()); - } - - public PetApi(ApiClient apiClient) { - memberVarHttpClient = apiClient.getHttpClient(); - memberVarObjectMapper = apiClient.getObjectMapper(); - memberVarBaseUri = apiClient.getBaseUri(); - memberVarInterceptor = apiClient.getRequestInterceptor(); - memberVarReadTimeout = apiClient.getReadTimeout(); - memberVarResponseInterceptor = apiClient.getResponseInterceptor(); - memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); - } - - protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { - String body = response.body() == null ? null : new String(response.body().readAllBytes()); - String message = formatExceptionMessage(operationId, response.statusCode(), body); - return new ApiException(response.statusCode(), message, response.headers(), body); - } - - private String formatExceptionMessage(String operationId, int statusCode, String body) { - if (body == null || body.isEmpty()) { - body = "[no body]"; + public PetApi() { + this(new ApiClient()); } - return operationId + " call failed with: " + statusCode + " - " + body; - } - /** - * Add a new pet to the store - * - * @param pet Pet object that needs to be added to the store (required) - * @throws ApiException if fails to make API call - */ - public void addPet(Pet pet) throws ApiException { - addPetWithHttpInfo(pet); - } + public PetApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } - /** - * Add a new pet to the store - * - * @param pet Pet object that needs to be added to the store (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = addPetRequestBuilder(pet); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("addPet", localVarResponse); + protected ApiException getApiException(String operationId, HttpResponse response) + throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore - } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder addPetRequestBuilder(Pet pet) throws ApiException { - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); + return operationId + " call failed with: " + statusCode + " - " + body; } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/pet"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @throws ApiException if fails to make API call - */ - public void deletePet(Long petId, String apiKey) throws ApiException { - deletePetWithHttpInfo(petId, apiKey); - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deletePetRequestBuilder(petId, apiKey); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("deletePet", localVarResponse); - } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore - } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder deletePetRequestBuilder(Long petId, String apiKey) throws ApiException { - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @throws ApiException if fails to make API call + */ + public void addPet(Pet pet) throws ApiException { + addPetWithHttpInfo(pet); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/pet/{petId}" - .replace("{petId}", ApiClient.urlEncode(petId.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - if (apiKey != null) { - localVarRequestBuilder.header("api_key", apiKey.toString()); - } - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @return List<Pet> - * @throws ApiException if fails to make API call - */ - public List findPetsByStatus(List status) throws ApiException { - ApiResponse> localVarResponse = findPetsByStatusWithHttpInfo(status); - return localVarResponse.getData(); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @return ApiResponse<List<Pet>> - * @throws ApiException if fails to make API call - */ - public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = findPetsByStatusRequestBuilder(status); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("findPetsByStatus", localVarResponse); - } - return new ApiResponse>( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder findPetsByStatusRequestBuilder(List status) throws ApiException { - // verify the required parameter 'status' is set - if (status == null) { - throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/pet/findByStatus"; - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "status"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "status", status)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", "application/xml, application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @return List<Pet> - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public List findPetsByTags(List tags) throws ApiException { - ApiResponse> localVarResponse = findPetsByTagsWithHttpInfo(tags); - return localVarResponse.getData(); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @return ApiResponse<List<Pet>> - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = findPetsByTagsRequestBuilder(tags); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("findPetsByTags", localVarResponse); - } - return new ApiResponse>( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder findPetsByTagsRequestBuilder(List tags) throws ApiException { - // verify the required parameter 'tags' is set - if (tags == null) { - throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/pet/findByTags"; - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "tags"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "tags", tags)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", "application/xml, application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) - * @return Pet - * @throws ApiException if fails to make API call - */ - public Pet getPetById(Long petId) throws ApiException { - ApiResponse localVarResponse = getPetByIdWithHttpInfo(petId); - return localVarResponse.getData(); - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) - * @return ApiResponse<Pet> - * @throws ApiException if fails to make API call - */ - public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getPetByIdRequestBuilder(petId); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getPetById", localVarResponse); - } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder getPetByIdRequestBuilder(Long petId) throws ApiException { - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/pet/{petId}" - .replace("{petId}", ApiClient.urlEncode(petId.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/xml, application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Update an existing pet - * - * @param pet Pet object that needs to be added to the store (required) - * @throws ApiException if fails to make API call - */ - public void updatePet(Pet pet) throws ApiException { - updatePetWithHttpInfo(pet); - } - - /** - * Update an existing pet - * - * @param pet Pet object that needs to be added to the store (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updatePetRequestBuilder(pet); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("updatePet", localVarResponse); - } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore - } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder updatePetRequestBuilder(Pet pet) throws ApiException { - // verify the required parameter 'pet' is set - if (pet == null) { - throw new ApiException(400, "Missing the required parameter 'pet' when calling updatePet"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/pet"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet); - localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @throws ApiException if fails to make API call - */ - public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - updatePetWithFormWithHttpInfo(petId, name, status); - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updatePetWithFormRequestBuilder(petId, name, status); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("updatePetWithForm", localVarResponse); - } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore - } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder updatePetWithFormRequestBuilder(Long petId, String name, String status) throws ApiException { - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/pet/{petId}" - .replace("{petId}", ApiClient.urlEncode(petId.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/json"); - - List formValues = new ArrayList<>(); - formValues.add(new BasicNameValuePair("name", name.toString())); - formValues.add(new BasicNameValuePair("status", status.toString())); - HttpEntity entity = new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); - ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); - try { - entity.writeTo(formOutputStream); - } catch (IOException e) { - throw new RuntimeException(e); - } - localVarRequestBuilder - .header("Content-Type", entity.getContentType().getValue()) - .method("POST", HttpRequest.BodyPublishers - .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray()))); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param _file file to upload (optional) - * @return ModelApiResponse - * @throws ApiException if fails to make API call - */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) throws ApiException { - ApiResponse localVarResponse = uploadFileWithHttpInfo(petId, additionalMetadata, _file); - return localVarResponse.getData(); - } - - /** - * uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param _file file to upload (optional) - * @return ApiResponse<ModelApiResponse> - * @throws ApiException if fails to make API call - */ - public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = uploadFileRequestBuilder(petId, additionalMetadata, _file); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("uploadFile", localVarResponse); - } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder uploadFileRequestBuilder(Long petId, String additionalMetadata, File _file) throws ApiException { - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/pet/{petId}/uploadImage" - .replace("{petId}", ApiClient.urlEncode(petId.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/json"); - - MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); - boolean hasFiles = false; - multiPartBuilder.addTextBody("additionalMetadata", additionalMetadata.toString()); - multiPartBuilder.addBinaryBody("file", _file); - hasFiles = true; - HttpEntity entity = multiPartBuilder.build(); - HttpRequest.BodyPublisher formDataPublisher; - if (hasFiles) { - Pipe pipe; + /** + * Add a new pet to the store + * + * @param pet Pet object that needs to be added to the store (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse addPetWithHttpInfo(Pet pet) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = addPetRequestBuilder(pet); try { - pipe = Pipe.open(); - } catch (IOException e) { - throw new RuntimeException(e); - } - new Thread(() -> { - try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { - entity.writeTo(outputStream); - } catch (IOException e) { - e.printStackTrace(); + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); } - }).start(); - formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); - } else { + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("addPet", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder addPetRequestBuilder(Pet pet) throws ApiException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException(400, "Missing the required parameter 'pet' when calling addPet"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @throws ApiException if fails to make API call + */ + public void deletePet(Long petId, String apiKey) throws ApiException { + deletePetWithHttpInfo(petId, apiKey); + } + + /** + * Deletes a pet + * + * @param petId Pet id to delete (required) + * @param apiKey (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deletePetRequestBuilder(petId, apiKey); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deletePet", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder deletePetRequestBuilder(Long petId, String apiKey) + throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException( + 400, "Missing the required parameter 'petId' when calling deletePet"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/pet/{petId}".replace("{petId}", ApiClient.urlEncode(petId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + if (apiKey != null) { + localVarRequestBuilder.header("api_key", apiKey.toString()); + } + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Finds Pets by status Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return List<Pet> + * @throws ApiException if fails to make API call + */ + public List findPetsByStatus(List status) throws ApiException { + ApiResponse> localVarResponse = findPetsByStatusWithHttpInfo(status); + return localVarResponse.getData(); + } + + /** + * Finds Pets by status Multiple status values can be provided with comma separated strings + * + * @param status Status values that need to be considered for filter (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> findPetsByStatusWithHttpInfo(List status) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = findPetsByStatusRequestBuilder(status); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("findPetsByStatus", localVarResponse); + } + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference>() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder findPetsByStatusRequestBuilder(List status) + throws ApiException { + // verify the required parameter 'status' is set + if (status == null) { + throw new ApiException( + 400, "Missing the required parameter 'status' when calling findPetsByStatus"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet/findByStatus"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "status"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "status", status)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, + * tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return List<Pet> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public List findPetsByTags(List tags) throws ApiException { + ApiResponse> localVarResponse = findPetsByTagsWithHttpInfo(tags); + return localVarResponse.getData(); + } + + /** + * Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, + * tag2, tag3 for testing. + * + * @param tags Tags to filter by (required) + * @return ApiResponse<List<Pet>> + * @throws ApiException if fails to make API call + * @deprecated + */ + @Deprecated + public ApiResponse> findPetsByTagsWithHttpInfo(List tags) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = findPetsByTagsRequestBuilder(tags); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("findPetsByTags", localVarResponse); + } + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference>() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder findPetsByTagsRequestBuilder(List tags) + throws ApiException { + // verify the required parameter 'tags' is set + if (tags == null) { + throw new ApiException( + 400, "Missing the required parameter 'tags' when calling findPetsByTags"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet/findByTags"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "tags"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("csv", "tags", tags)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Find pet by ID Returns a single pet + * + * @param petId ID of pet to return (required) + * @return Pet + * @throws ApiException if fails to make API call + */ + public Pet getPetById(Long petId) throws ApiException { + ApiResponse localVarResponse = getPetByIdWithHttpInfo(petId); + return localVarResponse.getData(); + } + + /** + * Find pet by ID Returns a single pet + * + * @param petId ID of pet to return (required) + * @return ApiResponse<Pet> + * @throws ApiException if fails to make API call + */ + public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getPetByIdRequestBuilder(petId); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getPetById", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getPetByIdRequestBuilder(Long petId) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException( + 400, "Missing the required parameter 'petId' when calling getPetById"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/pet/{petId}".replace("{petId}", ApiClient.urlEncode(petId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @throws ApiException if fails to make API call + */ + public void updatePet(Pet pet) throws ApiException { + updatePetWithHttpInfo(pet); + } + + /** + * Update an existing pet + * + * @param pet Pet object that needs to be added to the store (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePetWithHttpInfo(Pet pet) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updatePetRequestBuilder(pet); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updatePet", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updatePetRequestBuilder(Pet pet) throws ApiException { + // verify the required parameter 'pet' is set + if (pet == null) { + throw new ApiException( + 400, "Missing the required parameter 'pet' when calling updatePet"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/pet"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(pet); + localVarRequestBuilder.method( + "PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @throws ApiException if fails to make API call + */ + public void updatePetWithForm(Long petId, String name, String status) throws ApiException { + updatePetWithFormWithHttpInfo(petId, name, status); + } + + /** + * Updates a pet in the store with form data + * + * @param petId ID of pet that needs to be updated (required) + * @param name Updated name of the pet (optional) + * @param status Updated status of the pet (optional) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + updatePetWithFormRequestBuilder(petId, name, status); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updatePetWithForm", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updatePetWithFormRequestBuilder( + Long petId, String name, String status) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException( + 400, "Missing the required parameter 'petId' when calling updatePetWithForm"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/pet/{petId}".replace("{petId}", ApiClient.urlEncode(petId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + List formValues = new ArrayList<>(); + formValues.add(new BasicNameValuePair("name", name.toString())); + formValues.add(new BasicNameValuePair("status", status.toString())); + HttpEntity entity = + new UrlEncodedFormEntity(formValues, java.nio.charset.StandardCharsets.UTF_8); ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); try { entity.writeTo(formOutputStream); } catch (IOException e) { throw new RuntimeException(e); } - formDataPublisher = HttpRequest.BodyPublishers - .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); - } - localVarRequestBuilder - .header("Content-Type", entity.getContentType().getValue()) - .method("POST", formDataPublisher); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return ModelApiResponse - * @throws ApiException if fails to make API call - */ - public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - ApiResponse localVarResponse = uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); - return localVarResponse.getData(); - } - - /** - * uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return ApiResponse<ModelApiResponse> - * @throws ApiException if fails to make API call - */ - public ApiResponse uploadFileWithRequiredFileWithHttpInfo(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = uploadFileWithRequiredFileRequestBuilder(petId, requiredFile, additionalMetadata); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("uploadFileWithRequiredFile", localVarResponse); + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method( + "POST", + HttpRequest.BodyPublishers.ofInputStream( + () -> new ByteArrayInputStream(formOutputStream.toByteArray()))); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder uploadFileWithRequiredFileRequestBuilder(Long petId, File requiredFile, String additionalMetadata) throws ApiException { - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile"); - } - // verify the required parameter 'requiredFile' is set - if (requiredFile == null) { - throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile"); + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @return ModelApiResponse + * @throws ApiException if fails to make API call + */ + public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File _file) + throws ApiException { + ApiResponse localVarResponse = + uploadFileWithHttpInfo(petId, additionalMetadata, _file); + return localVarResponse.getData(); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile" - .replace("{petId}", ApiClient.urlEncode(petId.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/json"); - - MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); - boolean hasFiles = false; - multiPartBuilder.addTextBody("additionalMetadata", additionalMetadata.toString()); - multiPartBuilder.addBinaryBody("requiredFile", requiredFile); - hasFiles = true; - HttpEntity entity = multiPartBuilder.build(); - HttpRequest.BodyPublisher formDataPublisher; - if (hasFiles) { - Pipe pipe; + /** + * uploads an image + * + * @param petId ID of pet to update (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @param _file file to upload (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadFileWithHttpInfo( + Long petId, String additionalMetadata, File _file) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + uploadFileRequestBuilder(petId, additionalMetadata, _file); try { - pipe = Pipe.open(); - } catch (IOException e) { - throw new RuntimeException(e); - } - new Thread(() -> { - try (OutputStream outputStream = Channels.newOutputStream(pipe.sink())) { - entity.writeTo(outputStream); - } catch (IOException e) { - e.printStackTrace(); + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uploadFile", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference< + ModelApiResponse>() {}) // closes the InputStream + ); + } finally { } - }).start(); - formDataPublisher = HttpRequest.BodyPublishers.ofInputStream(() -> Channels.newInputStream(pipe.source())); - } else { - ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); - try { - entity.writeTo(formOutputStream); } catch (IOException e) { - throw new RuntimeException(e); + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - formDataPublisher = HttpRequest.BodyPublishers - .ofInputStream(() -> new ByteArrayInputStream(formOutputStream.toByteArray())); } - localVarRequestBuilder - .header("Content-Type", entity.getContentType().getValue()) - .method("POST", formDataPublisher); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); + + private HttpRequest.Builder uploadFileRequestBuilder( + Long petId, String additionalMetadata, File _file) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException( + 400, "Missing the required parameter 'petId' when calling uploadFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/pet/{petId}/uploadImage" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("additionalMetadata", additionalMetadata.toString()); + multiPartBuilder.addBinaryBody("file", _file); + hasFiles = true; + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread( + () -> { + try (OutputStream outputStream = + Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }) + .start(); + formDataPublisher = + HttpRequest.BodyPublishers.ofInputStream( + () -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = + HttpRequest.BodyPublishers.ofInputStream( + () -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ModelApiResponse + * @throws ApiException if fails to make API call + */ + public ModelApiResponse uploadFileWithRequiredFile( + Long petId, File requiredFile, String additionalMetadata) throws ApiException { + ApiResponse localVarResponse = + uploadFileWithRequiredFileWithHttpInfo(petId, requiredFile, additionalMetadata); + return localVarResponse.getData(); + } + + /** + * uploads an image (required) + * + * @param petId ID of pet to update (required) + * @param requiredFile file to upload (required) + * @param additionalMetadata Additional data to pass to server (optional) + * @return ApiResponse<ModelApiResponse> + * @throws ApiException if fails to make API call + */ + public ApiResponse uploadFileWithRequiredFileWithHttpInfo( + Long petId, File requiredFile, String additionalMetadata) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = + uploadFileWithRequiredFileRequestBuilder(petId, requiredFile, additionalMetadata); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("uploadFileWithRequiredFile", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference< + ModelApiResponse>() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder uploadFileWithRequiredFileRequestBuilder( + Long petId, File requiredFile, String additionalMetadata) throws ApiException { + // verify the required parameter 'petId' is set + if (petId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'petId' when calling" + + " uploadFileWithRequiredFile"); + } + // verify the required parameter 'requiredFile' is set + if (requiredFile == null) { + throw new ApiException( + 400, + "Missing the required parameter 'requiredFile' when calling" + + " uploadFileWithRequiredFile"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/fake/{petId}/uploadImageWithRequiredFile" + .replace("{petId}", ApiClient.urlEncode(petId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + MultipartEntityBuilder multiPartBuilder = MultipartEntityBuilder.create(); + boolean hasFiles = false; + multiPartBuilder.addTextBody("additionalMetadata", additionalMetadata.toString()); + multiPartBuilder.addBinaryBody("requiredFile", requiredFile); + hasFiles = true; + HttpEntity entity = multiPartBuilder.build(); + HttpRequest.BodyPublisher formDataPublisher; + if (hasFiles) { + Pipe pipe; + try { + pipe = Pipe.open(); + } catch (IOException e) { + throw new RuntimeException(e); + } + new Thread( + () -> { + try (OutputStream outputStream = + Channels.newOutputStream(pipe.sink())) { + entity.writeTo(outputStream); + } catch (IOException e) { + e.printStackTrace(); + } + }) + .start(); + formDataPublisher = + HttpRequest.BodyPublishers.ofInputStream( + () -> Channels.newInputStream(pipe.source())); + } else { + ByteArrayOutputStream formOutputStream = new ByteArrayOutputStream(); + try { + entity.writeTo(formOutputStream); + } catch (IOException e) { + throw new RuntimeException(e); + } + formDataPublisher = + HttpRequest.BodyPublishers.ofInputStream( + () -> new ByteArrayInputStream(formOutputStream.toByteArray())); + } + localVarRequestBuilder + .header("Content-Type", entity.getContentType().getValue()) + .method("POST", formDataPublisher); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - return localVarRequestBuilder; - } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java index 95f44c28072b..2b17f58d626e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/StoreApi.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,367 +12,370 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Pair; - -import org.openapitools.client.model.Order; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; - -import java.io.InputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; import java.io.IOException; -import java.io.OutputStream; -import java.net.http.HttpRequest; -import java.nio.channels.Channels; -import java.nio.channels.Pipe; +import java.io.InputStream; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; - -import java.util.ArrayList; -import java.util.StringJoiner; -import java.util.List; import java.util.Map; -import java.util.Set; import java.util.function.Consumer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.model.Order; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class StoreApi { - private final HttpClient memberVarHttpClient; - private final ObjectMapper memberVarObjectMapper; - private final String memberVarBaseUri; - private final Consumer memberVarInterceptor; - private final Duration memberVarReadTimeout; - private final Consumer> memberVarResponseInterceptor; - private final Consumer> memberVarAsyncResponseInterceptor; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; - public StoreApi() { - this(new ApiClient()); - } - - public StoreApi(ApiClient apiClient) { - memberVarHttpClient = apiClient.getHttpClient(); - memberVarObjectMapper = apiClient.getObjectMapper(); - memberVarBaseUri = apiClient.getBaseUri(); - memberVarInterceptor = apiClient.getRequestInterceptor(); - memberVarReadTimeout = apiClient.getReadTimeout(); - memberVarResponseInterceptor = apiClient.getResponseInterceptor(); - memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); - } - - protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { - String body = response.body() == null ? null : new String(response.body().readAllBytes()); - String message = formatExceptionMessage(operationId, response.statusCode(), body); - return new ApiException(response.statusCode(), message, response.headers(), body); - } - - private String formatExceptionMessage(String operationId, int statusCode, String body) { - if (body == null || body.isEmpty()) { - body = "[no body]"; + public StoreApi() { + this(new ApiClient()); } - return operationId + " call failed with: " + statusCode + " - " + body; - } - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @throws ApiException if fails to make API call - */ - public void deleteOrder(String orderId) throws ApiException { - deleteOrderWithHttpInfo(orderId); - } + public StoreApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteOrderRequestBuilder(orderId); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("deleteOrder", localVarResponse); + protected ApiException getApiException(String operationId, HttpResponse response) + throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything + * above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @throws ApiException if fails to make API call + */ + public void deleteOrder(String orderId) throws ApiException { + deleteOrderWithHttpInfo(orderId); + } + + /** + * Delete purchase order by ID For valid response try integer IDs with value < 1000. Anything + * above 1000 or nonintegers will generate API errors + * + * @param orderId ID of the order that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteOrderRequestBuilder(orderId); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteOrder", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder deleteOrderRequestBuilder(String orderId) throws ApiException { - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/store/order/{order_id}" - .replace("{order_id}", ApiClient.urlEncode(orderId.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map<String, Integer> - * @throws ApiException if fails to make API call - */ - public Map getInventory() throws ApiException { - ApiResponse> localVarResponse = getInventoryWithHttpInfo(); - return localVarResponse.getData(); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return ApiResponse<Map<String, Integer>> - * @throws ApiException if fails to make API call - */ - public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getInventoryRequestBuilder(); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getInventory", localVarResponse); + private HttpRequest.Builder deleteOrderRequestBuilder(String orderId) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException( + 400, "Missing the required parameter 'orderId' when calling deleteOrder"); } - return new ApiResponse>( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference>() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - private HttpRequest.Builder getInventoryRequestBuilder() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = + "/store/order/{order_id}" + .replace("{order_id}", ApiClient.urlEncode(orderId.toString())); - String localVarPath = "/store/inventory"; + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Accept", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @return Order - * @throws ApiException if fails to make API call - */ - public Order getOrderById(Long orderId) throws ApiException { - ApiResponse localVarResponse = getOrderByIdWithHttpInfo(orderId); - return localVarResponse.getData(); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @return ApiResponse<Order> - * @throws ApiException if fails to make API call - */ - public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getOrderByIdRequestBuilder(orderId); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getOrderById", localVarResponse); + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder getOrderByIdRequestBuilder(Long orderId) throws ApiException { - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/store/order/{order_id}" - .replace("{order_id}", ApiClient.urlEncode(orderId.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/xml, application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Place an order for a pet - * - * @param order order placed for purchasing the pet (required) - * @return Order - * @throws ApiException if fails to make API call - */ - public Order placeOrder(Order order) throws ApiException { - ApiResponse localVarResponse = placeOrderWithHttpInfo(order); - return localVarResponse.getData(); - } - - /** - * Place an order for a pet - * - * @param order order placed for purchasing the pet (required) - * @return ApiResponse<Order> - * @throws ApiException if fails to make API call - */ - public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = placeOrderRequestBuilder(order); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("placeOrder", localVarResponse); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); + return localVarRequestBuilder; } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder placeOrderRequestBuilder(Order order) throws ApiException { - // verify the required parameter 'order' is set - if (order == null) { - throw new ApiException(400, "Missing the required parameter 'order' when calling placeOrder"); + /** + * Returns pet inventories by status Returns a map of status codes to quantities + * + * @return Map<String, Integer> + * @throws ApiException if fails to make API call + */ + public Map getInventory() throws ApiException { + ApiResponse> localVarResponse = getInventoryWithHttpInfo(); + return localVarResponse.getData(); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/store/order"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/xml, application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(order); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); + /** + * Returns pet inventories by status Returns a map of status codes to quantities + * + * @return ApiResponse<Map<String, Integer>> + * @throws ApiException if fails to make API call + */ + public ApiResponse> getInventoryWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getInventoryRequestBuilder(); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getInventory", localVarResponse); + } + return new ApiResponse>( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference< + Map< + String, + Integer>>() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); + + private HttpRequest.Builder getInventoryRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/store/inventory"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); + /** + * Find purchase order by ID For valid response try integer IDs with value <= 5 or > + * 10. Other values will generate exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return Order + * @throws ApiException if fails to make API call + */ + public Order getOrderById(Long orderId) throws ApiException { + ApiResponse localVarResponse = getOrderByIdWithHttpInfo(orderId); + return localVarResponse.getData(); + } + + /** + * Find purchase order by ID For valid response try integer IDs with value <= 5 or > + * 10. Other values will generate exceptions + * + * @param orderId ID of pet that needs to be fetched (required) + * @return ApiResponse<Order> + * @throws ApiException if fails to make API call + */ + public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getOrderByIdRequestBuilder(orderId); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getOrderById", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getOrderByIdRequestBuilder(Long orderId) throws ApiException { + // verify the required parameter 'orderId' is set + if (orderId == null) { + throw new ApiException( + 400, "Missing the required parameter 'orderId' when calling getOrderById"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/store/order/{order_id}" + .replace("{order_id}", ApiClient.urlEncode(orderId.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return Order + * @throws ApiException if fails to make API call + */ + public Order placeOrder(Order order) throws ApiException { + ApiResponse localVarResponse = placeOrderWithHttpInfo(order); + return localVarResponse.getData(); + } + + /** + * Place an order for a pet + * + * @param order order placed for purchasing the pet (required) + * @return ApiResponse<Order> + * @throws ApiException if fails to make API call + */ + public ApiResponse placeOrderWithHttpInfo(Order order) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = placeOrderRequestBuilder(order); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("placeOrder", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder placeOrderRequestBuilder(Order order) throws ApiException { + // verify the required parameter 'order' is set + if (order == null) { + throw new ApiException( + 400, "Missing the required parameter 'order' when calling placeOrder"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/store/order"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(order); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - return localVarRequestBuilder; - } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java index e5c54f5a4404..8a12efff38f4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/api/UserApi.java @@ -3,7 +3,7 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -12,715 +12,712 @@ package org.openapitools.client.api; -import org.openapitools.client.ApiClient; -import org.openapitools.client.ApiException; -import org.openapitools.client.ApiResponse; -import org.openapitools.client.Pair; - -import java.time.OffsetDateTime; -import org.openapitools.client.model.User; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.http.HttpEntity; -import org.apache.http.NameValuePair; -import org.apache.http.entity.mime.MultipartEntityBuilder; -import org.apache.http.message.BasicNameValuePair; -import org.apache.http.client.entity.UrlEncodedFormEntity; - -import java.io.InputStream; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; import java.io.IOException; -import java.io.OutputStream; -import java.net.http.HttpRequest; -import java.nio.channels.Channels; -import java.nio.channels.Pipe; +import java.io.InputStream; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; import java.time.Duration; - import java.util.ArrayList; -import java.util.StringJoiner; import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.StringJoiner; import java.util.function.Consumer; +import org.openapitools.client.ApiClient; +import org.openapitools.client.ApiException; +import org.openapitools.client.ApiResponse; +import org.openapitools.client.Pair; +import org.openapitools.client.model.User; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class UserApi { - private final HttpClient memberVarHttpClient; - private final ObjectMapper memberVarObjectMapper; - private final String memberVarBaseUri; - private final Consumer memberVarInterceptor; - private final Duration memberVarReadTimeout; - private final Consumer> memberVarResponseInterceptor; - private final Consumer> memberVarAsyncResponseInterceptor; + private final HttpClient memberVarHttpClient; + private final ObjectMapper memberVarObjectMapper; + private final String memberVarBaseUri; + private final Consumer memberVarInterceptor; + private final Duration memberVarReadTimeout; + private final Consumer> memberVarResponseInterceptor; + private final Consumer> memberVarAsyncResponseInterceptor; - public UserApi() { - this(new ApiClient()); - } - - public UserApi(ApiClient apiClient) { - memberVarHttpClient = apiClient.getHttpClient(); - memberVarObjectMapper = apiClient.getObjectMapper(); - memberVarBaseUri = apiClient.getBaseUri(); - memberVarInterceptor = apiClient.getRequestInterceptor(); - memberVarReadTimeout = apiClient.getReadTimeout(); - memberVarResponseInterceptor = apiClient.getResponseInterceptor(); - memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); - } - - protected ApiException getApiException(String operationId, HttpResponse response) throws IOException { - String body = response.body() == null ? null : new String(response.body().readAllBytes()); - String message = formatExceptionMessage(operationId, response.statusCode(), body); - return new ApiException(response.statusCode(), message, response.headers(), body); - } - - private String formatExceptionMessage(String operationId, int statusCode, String body) { - if (body == null || body.isEmpty()) { - body = "[no body]"; + public UserApi() { + this(new ApiClient()); } - return operationId + " call failed with: " + statusCode + " - " + body; - } - /** - * Create user - * This can only be done by the logged in user. - * @param user Created user object (required) - * @throws ApiException if fails to make API call - */ - public void createUser(User user) throws ApiException { - createUserWithHttpInfo(user); - } + public UserApi(ApiClient apiClient) { + memberVarHttpClient = apiClient.getHttpClient(); + memberVarObjectMapper = apiClient.getObjectMapper(); + memberVarBaseUri = apiClient.getBaseUri(); + memberVarInterceptor = apiClient.getRequestInterceptor(); + memberVarReadTimeout = apiClient.getReadTimeout(); + memberVarResponseInterceptor = apiClient.getResponseInterceptor(); + memberVarAsyncResponseInterceptor = apiClient.getAsyncResponseInterceptor(); + } - /** - * Create user - * This can only be done by the logged in user. - * @param user Created user object (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse createUserWithHttpInfo(User user) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = createUserRequestBuilder(user); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("createUser", localVarResponse); + protected ApiException getApiException(String operationId, HttpResponse response) + throws IOException { + String body = response.body() == null ? null : new String(response.body().readAllBytes()); + String message = formatExceptionMessage(operationId, response.statusCode(), body); + return new ApiException(response.statusCode(), message, response.headers(), body); + } + + private String formatExceptionMessage(String operationId, int statusCode, String body) { + if (body == null || body.isEmpty()) { + body = "[no body]"; } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + return operationId + " call failed with: " + statusCode + " - " + body; + } + + /** + * Create user This can only be done by the logged in user. + * + * @param user Created user object (required) + * @throws ApiException if fails to make API call + */ + public void createUser(User user) throws ApiException { + createUserWithHttpInfo(user); + } + + /** + * Create user This can only be done by the logged in user. + * + * @param user Created user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUserWithHttpInfo(User user) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createUserRequestBuilder(user); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createUser", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder createUserRequestBuilder(User user) throws ApiException { - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUser"); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/user"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Creates list of users with given input array - * - * @param user List of user object (required) - * @throws ApiException if fails to make API call - */ - public void createUsersWithArrayInput(List user) throws ApiException { - createUsersWithArrayInputWithHttpInfo(user); - } - - /** - * Creates list of users with given input array - * - * @param user List of user object (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = createUsersWithArrayInputRequestBuilder(user); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("createUsersWithArrayInput", localVarResponse); + private HttpRequest.Builder createUserRequestBuilder(User user) throws ApiException { + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException( + 400, "Missing the required parameter 'user' when calling createUser"); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(List user) throws ApiException { - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithArrayInput"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/user/createWithArray"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Creates list of users with given input array - * - * @param user List of user object (required) - * @throws ApiException if fails to make API call - */ - public void createUsersWithListInput(List user) throws ApiException { - createUsersWithListInputWithHttpInfo(user); - } - - /** - * Creates list of users with given input array - * - * @param user List of user object (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse createUsersWithListInputWithHttpInfo(List user) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = createUsersWithListInputRequestBuilder(user); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("createUsersWithListInput", localVarResponse); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); + return localVarRequestBuilder; } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder createUsersWithListInputRequestBuilder(List user) throws ApiException { - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling createUsersWithListInput"); + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @throws ApiException if fails to make API call + */ + public void createUsersWithArrayInput(List user) throws ApiException { + createUsersWithArrayInputWithHttpInfo(user); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/user/createWithList"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); - localVarRequestBuilder.method("POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); - } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @throws ApiException if fails to make API call - */ - public void deleteUser(String username) throws ApiException { - deleteUserWithHttpInfo(username); - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(username); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("deleteUser", localVarResponse); + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUsersWithArrayInputWithHttpInfo(List user) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createUsersWithArrayInputRequestBuilder(user); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createUsersWithArrayInput", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + } + + private HttpRequest.Builder createUsersWithArrayInputRequestBuilder(List user) + throws ApiException { + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException( + 400, + "Missing the required parameter 'user' when calling createUsersWithArrayInput"); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - private HttpRequest.Builder deleteUserRequestBuilder(String username) throws ApiException { - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); - } + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + String localVarPath = "/user/createWithArray"; - String localVarPath = "/user/{username}" - .replace("{username}", ApiClient.urlEncode(username.toString())); + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return User - * @throws ApiException if fails to make API call - */ - public User getUserByName(String username) throws ApiException { - ApiResponse localVarResponse = getUserByNameWithHttpInfo(username); - return localVarResponse.getData(); - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return ApiResponse<User> - * @throws ApiException if fails to make API call - */ - public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = getUserByNameRequestBuilder(username); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("getUserByName", localVarResponse); + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder getUserByNameRequestBuilder(String username) throws ApiException { - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/user/{username}" - .replace("{username}", ApiClient.urlEncode(username.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/xml, application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return String - * @throws ApiException if fails to make API call - */ - public String loginUser(String username, String password) throws ApiException { - ApiResponse localVarResponse = loginUserWithHttpInfo(username, password); - return localVarResponse.getData(); - } - - /** - * Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = loginUserRequestBuilder(username, password); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("loginUser", localVarResponse); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - localVarResponse.body() == null ? null : memberVarObjectMapper.readValue(localVarResponse.body(), new TypeReference() {}) // closes the InputStream - ); - } finally { - } - } catch (IOException e) { - throw new ApiException(e); - } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder loginUserRequestBuilder(String username, String password) throws ApiException { - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); - } - // verify the required parameter 'password' is set - if (password == null) { - throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); - } - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/user/login"; - - List localVarQueryParams = new ArrayList<>(); - StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); - String localVarQueryParameterBaseName; - localVarQueryParameterBaseName = "username"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("username", username)); - localVarQueryParameterBaseName = "password"; - localVarQueryParams.addAll(ApiClient.parameterToPairs("password", password)); - - if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { - StringJoiner queryJoiner = new StringJoiner("&"); - localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); - if (localVarQueryStringJoiner.length() != 0) { - queryJoiner.add(localVarQueryStringJoiner.toString()); - } - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); - } else { - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - } - - localVarRequestBuilder.header("Accept", "application/xml, application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Logs out current logged in user session - * - * @throws ApiException if fails to make API call - */ - public void logoutUser() throws ApiException { - logoutUserWithHttpInfo(); - } - - /** - * Logs out current logged in user session - * - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse logoutUserWithHttpInfo() throws ApiException { - HttpRequest.Builder localVarRequestBuilder = logoutUserRequestBuilder(); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("logoutUser", localVarResponse); + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + return localVarRequestBuilder; + } + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @throws ApiException if fails to make API call + */ + public void createUsersWithListInput(List user) throws ApiException { + createUsersWithListInputWithHttpInfo(user); + } + + /** + * Creates list of users with given input array + * + * @param user List of user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse createUsersWithListInputWithHttpInfo(List user) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = createUsersWithListInputRequestBuilder(user); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("createUsersWithListInput", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - private HttpRequest.Builder logoutUserRequestBuilder() throws ApiException { - - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/user/logout"; - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Accept", "application/json"); - - localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); - } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); - } - return localVarRequestBuilder; - } - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param user Updated user object (required) - * @throws ApiException if fails to make API call - */ - public void updateUser(String username, User user) throws ApiException { - updateUserWithHttpInfo(username, user); - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param user Updated user object (required) - * @return ApiResponse<Void> - * @throws ApiException if fails to make API call - */ - public ApiResponse updateUserWithHttpInfo(String username, User user) throws ApiException { - HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(username, user); - try { - HttpResponse localVarResponse = memberVarHttpClient.send( - localVarRequestBuilder.build(), - HttpResponse.BodyHandlers.ofInputStream()); - if (memberVarResponseInterceptor != null) { - memberVarResponseInterceptor.accept(localVarResponse); - } - try { - if (localVarResponse.statusCode()/ 100 != 2) { - throw getApiException("updateUser", localVarResponse); + private HttpRequest.Builder createUsersWithListInputRequestBuilder(List user) + throws ApiException { + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException( + 400, + "Missing the required parameter 'user' when calling createUsersWithListInput"); } - return new ApiResponse( - localVarResponse.statusCode(), - localVarResponse.headers().map(), - null - ); - } finally { - // Drain the InputStream - while (localVarResponse.body().read() != -1) { - // Ignore + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user/createWithList"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); + localVarRequestBuilder.method( + "POST", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); } - localVarResponse.body().close(); - } - } catch (IOException e) { - throw new ApiException(e); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new ApiException(e); - } - } - - private HttpRequest.Builder updateUserRequestBuilder(String username, User user) throws ApiException { - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); - } - // verify the required parameter 'user' is set - if (user == null) { - throw new ApiException(400, "Missing the required parameter 'user' when calling updateUser"); + /** + * Delete user This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @throws ApiException if fails to make API call + */ + public void deleteUser(String username) throws ApiException { + deleteUserWithHttpInfo(username); } - HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); - - String localVarPath = "/user/{username}" - .replace("{username}", ApiClient.urlEncode(username.toString())); - - localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); - - localVarRequestBuilder.header("Content-Type", "application/json"); - localVarRequestBuilder.header("Accept", "application/json"); - - try { - byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); - localVarRequestBuilder.method("PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); - } catch (IOException e) { - throw new ApiException(e); + /** + * Delete user This can only be done by the logged in user. + * + * @param username The name that needs to be deleted (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = deleteUserRequestBuilder(username); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("deleteUser", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } } - if (memberVarReadTimeout != null) { - localVarRequestBuilder.timeout(memberVarReadTimeout); + + private HttpRequest.Builder deleteUserRequestBuilder(String username) throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException( + 400, "Missing the required parameter 'username' when calling deleteUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/user/{username}".replace("{username}", ApiClient.urlEncode(username.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("DELETE", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - if (memberVarInterceptor != null) { - memberVarInterceptor.accept(localVarRequestBuilder); + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return User + * @throws ApiException if fails to make API call + */ + public User getUserByName(String username) throws ApiException { + ApiResponse localVarResponse = getUserByNameWithHttpInfo(username); + return localVarResponse.getData(); + } + + /** + * Get user by user name + * + * @param username The name that needs to be fetched. Use user1 for testing. (required) + * @return ApiResponse<User> + * @throws ApiException if fails to make API call + */ + public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { + HttpRequest.Builder localVarRequestBuilder = getUserByNameRequestBuilder(username); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("getUserByName", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder getUserByNameRequestBuilder(String username) throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException( + 400, "Missing the required parameter 'username' when calling getUserByName"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/user/{username}".replace("{username}", ApiClient.urlEncode(username.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return String + * @throws ApiException if fails to make API call + */ + public String loginUser(String username, String password) throws ApiException { + ApiResponse localVarResponse = loginUserWithHttpInfo(username, password); + return localVarResponse.getData(); + } + + /** + * Logs user into the system + * + * @param username The user name for login (required) + * @param password The password for login in clear text (required) + * @return ApiResponse<String> + * @throws ApiException if fails to make API call + */ + public ApiResponse loginUserWithHttpInfo(String username, String password) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = loginUserRequestBuilder(username, password); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("loginUser", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), + localVarResponse.headers().map(), + localVarResponse.body() == null + ? null + : memberVarObjectMapper.readValue( + localVarResponse.body(), + new TypeReference() {}) // closes the InputStream + ); + } finally { + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder loginUserRequestBuilder(String username, String password) + throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException( + 400, "Missing the required parameter 'username' when calling loginUser"); + } + // verify the required parameter 'password' is set + if (password == null) { + throw new ApiException( + 400, "Missing the required parameter 'password' when calling loginUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user/login"; + + List localVarQueryParams = new ArrayList<>(); + StringJoiner localVarQueryStringJoiner = new StringJoiner("&"); + String localVarQueryParameterBaseName; + localVarQueryParameterBaseName = "username"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("username", username)); + localVarQueryParameterBaseName = "password"; + localVarQueryParams.addAll(ApiClient.parameterToPairs("password", password)); + + if (!localVarQueryParams.isEmpty() || localVarQueryStringJoiner.length() != 0) { + StringJoiner queryJoiner = new StringJoiner("&"); + localVarQueryParams.forEach(p -> queryJoiner.add(p.getName() + '=' + p.getValue())); + if (localVarQueryStringJoiner.length() != 0) { + queryJoiner.add(localVarQueryStringJoiner.toString()); + } + localVarRequestBuilder.uri( + URI.create(memberVarBaseUri + localVarPath + '?' + queryJoiner.toString())); + } else { + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + } + + localVarRequestBuilder.header("Accept", "application/xml, application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Logs out current logged in user session + * + * @throws ApiException if fails to make API call + */ + public void logoutUser() throws ApiException { + logoutUserWithHttpInfo(); + } + + /** + * Logs out current logged in user session + * + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse logoutUserWithHttpInfo() throws ApiException { + HttpRequest.Builder localVarRequestBuilder = logoutUserRequestBuilder(); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("logoutUser", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder logoutUserRequestBuilder() throws ApiException { + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = "/user/logout"; + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Accept", "application/json"); + + localVarRequestBuilder.method("GET", HttpRequest.BodyPublishers.noBody()); + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; + } + /** + * Updated user This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @throws ApiException if fails to make API call + */ + public void updateUser(String username, User user) throws ApiException { + updateUserWithHttpInfo(username, user); + } + + /** + * Updated user This can only be done by the logged in user. + * + * @param username name that need to be deleted (required) + * @param user Updated user object (required) + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + */ + public ApiResponse updateUserWithHttpInfo(String username, User user) + throws ApiException { + HttpRequest.Builder localVarRequestBuilder = updateUserRequestBuilder(username, user); + try { + HttpResponse localVarResponse = + memberVarHttpClient.send( + localVarRequestBuilder.build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (memberVarResponseInterceptor != null) { + memberVarResponseInterceptor.accept(localVarResponse); + } + try { + if (localVarResponse.statusCode() / 100 != 2) { + throw getApiException("updateUser", localVarResponse); + } + return new ApiResponse( + localVarResponse.statusCode(), localVarResponse.headers().map(), null); + } finally { + // Drain the InputStream + while (localVarResponse.body().read() != -1) { + // Ignore + } + localVarResponse.body().close(); + } + } catch (IOException e) { + throw new ApiException(e); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new ApiException(e); + } + } + + private HttpRequest.Builder updateUserRequestBuilder(String username, User user) + throws ApiException { + // verify the required parameter 'username' is set + if (username == null) { + throw new ApiException( + 400, "Missing the required parameter 'username' when calling updateUser"); + } + // verify the required parameter 'user' is set + if (user == null) { + throw new ApiException( + 400, "Missing the required parameter 'user' when calling updateUser"); + } + + HttpRequest.Builder localVarRequestBuilder = HttpRequest.newBuilder(); + + String localVarPath = + "/user/{username}".replace("{username}", ApiClient.urlEncode(username.toString())); + + localVarRequestBuilder.uri(URI.create(memberVarBaseUri + localVarPath)); + + localVarRequestBuilder.header("Content-Type", "application/json"); + localVarRequestBuilder.header("Accept", "application/json"); + + try { + byte[] localVarPostBody = memberVarObjectMapper.writeValueAsBytes(user); + localVarRequestBuilder.method( + "PUT", HttpRequest.BodyPublishers.ofByteArray(localVarPostBody)); + } catch (IOException e) { + throw new ApiException(e); + } + if (memberVarReadTimeout != null) { + localVarRequestBuilder.timeout(memberVarReadTimeout); + } + if (memberVarInterceptor != null) { + memberVarInterceptor.accept(localVarRequestBuilder); + } + return localVarRequestBuilder; } - return localVarRequestBuilder; - } } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java index ac67e7ff0bc3..b305004e327c 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AbstractOpenApiSchema.java @@ -3,25 +3,21 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.lang.reflect.Type; -import java.util.Map; import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Map; +import java.util.Objects; -/** - * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec - */ +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public abstract class AbstractOpenApiSchema { @@ -52,17 +48,22 @@ public abstract class AbstractOpenApiSchema { * @return an instance of the actual schema/object */ @JsonValue - public Object getActualInstance() {return instance;} + public Object getActualInstance() { + return instance; + } /** * Set the actual instance * * @param instance the actual instance of the schema/object */ - public void setActualInstance(Object instance) {this.instance = instance;} + public void setActualInstance(Object instance) { + this.instance = instance; + } /** - * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf + * schema as well * * @return an instance of the actual schema/object */ @@ -74,7 +75,7 @@ public abstract class AbstractOpenApiSchema { if (object.getActualInstance() == null) { return null; } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { - return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); } else { return object.getActualInstance(); } @@ -101,8 +102,8 @@ public abstract class AbstractOpenApiSchema { } /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). */ private String toIndentedString(Object o) { if (o == null) { @@ -119,9 +120,9 @@ public abstract class AbstractOpenApiSchema { return false; } AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; - return Objects.equals(this.instance, a.instance) && - Objects.equals(this.isNullable, a.isNullable) && - Objects.equals(this.schemaType, a.schemaType); + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); } @Override @@ -141,7 +142,4 @@ public abstract class AbstractOpenApiSchema { return Boolean.FALSE; } } - - - } diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java index 698b5bb31e6e..5ad0773a4ec1 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesAnyType.java @@ -3,159 +3,146 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.HashMap; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * AdditionalPropertiesAnyType - */ -@JsonPropertyOrder({ - AdditionalPropertiesAnyType.JSON_PROPERTY_NAME -}) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +/** AdditionalPropertiesAnyType */ +@JsonPropertyOrder({AdditionalPropertiesAnyType.JSON_PROPERTY_NAME}) +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesAnyType extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesAnyType() { - } + public AdditionalPropertiesAnyType() {} - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * @param key the name of the property - * @param value the value of the property - * @return self reference - */ - @JsonAnySetter - public AdditionalPropertiesAnyType putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + public AdditionalPropertiesAnyType name(String name) { + this.name = name; + return this; } - this.additionalProperties.put(key, value); - return this; - } - /** - * Return the additional (undeclared) properties. - * @return the additional (undeclared) properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * @param key the name of the property - * @return the additional (undeclared) property with the specified name - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - return this.additionalProperties.get(key); - } - /** - * Return true if this AdditionalPropertiesAnyType object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public AdditionalPropertiesAnyType putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name)&& - Objects.equals(this.additionalProperties, additionalPropertiesAnyType.additionalProperties) && - super.equals(o); - } - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode(), additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; } - return o.toString().replace("\n", "\n "); - } + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AdditionalPropertiesAnyType object is equal to o. */ + @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) + && Objects.equals( + this.additionalProperties, additionalPropertiesAnyType.additionalProperties) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode(), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesAnyType {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java index 5a3625f25067..2310b9f4f8cf 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesArray.java @@ -3,160 +3,147 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.HashMap; import java.util.List; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * AdditionalPropertiesArray - */ -@JsonPropertyOrder({ - AdditionalPropertiesArray.JSON_PROPERTY_NAME -}) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +/** AdditionalPropertiesArray */ +@JsonPropertyOrder({AdditionalPropertiesArray.JSON_PROPERTY_NAME}) +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesArray extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesArray() { - } + public AdditionalPropertiesArray() {} - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * @param key the name of the property - * @param value the value of the property - * @return self reference - */ - @JsonAnySetter - public AdditionalPropertiesArray putAdditionalProperty(String key, List value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + public AdditionalPropertiesArray name(String name) { + this.name = name; + return this; } - this.additionalProperties.put(key, value); - return this; - } - /** - * Return the additional (undeclared) properties. - * @return the additional (undeclared) properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * @param key the name of the property - * @return the additional (undeclared) property with the specified name - */ - public List getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - return this.additionalProperties.get(key); - } - /** - * Return true if this AdditionalPropertiesArray object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public AdditionalPropertiesArray putAdditionalProperty(String key, List value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name)&& - Objects.equals(this.additionalProperties, additionalPropertiesArray.additionalProperties) && - super.equals(o); - } - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode(), additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; } - return o.toString().replace("\n", "\n "); - } + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public List getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AdditionalPropertiesArray object is equal to o. */ + @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) + && Objects.equals( + this.additionalProperties, additionalPropertiesArray.additionalProperties) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode(), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java index 72638f3e4839..d9b60b19df7a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesBoolean.java @@ -3,159 +3,146 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.HashMap; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * AdditionalPropertiesBoolean - */ -@JsonPropertyOrder({ - AdditionalPropertiesBoolean.JSON_PROPERTY_NAME -}) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +/** AdditionalPropertiesBoolean */ +@JsonPropertyOrder({AdditionalPropertiesBoolean.JSON_PROPERTY_NAME}) +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesBoolean extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesBoolean() { - } + public AdditionalPropertiesBoolean() {} - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * @param key the name of the property - * @param value the value of the property - * @return self reference - */ - @JsonAnySetter - public AdditionalPropertiesBoolean putAdditionalProperty(String key, Boolean value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + public AdditionalPropertiesBoolean name(String name) { + this.name = name; + return this; } - this.additionalProperties.put(key, value); - return this; - } - /** - * Return the additional (undeclared) properties. - * @return the additional (undeclared) properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * @param key the name of the property - * @return the additional (undeclared) property with the specified name - */ - public Boolean getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - return this.additionalProperties.get(key); - } - /** - * Return true if this AdditionalPropertiesBoolean object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public AdditionalPropertiesBoolean putAdditionalProperty(String key, Boolean value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name)&& - Objects.equals(this.additionalProperties, additionalPropertiesBoolean.additionalProperties) && - super.equals(o); - } - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode(), additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesBoolean {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; } - return o.toString().replace("\n", "\n "); - } + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Boolean getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AdditionalPropertiesBoolean object is equal to o. */ + @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) + && Objects.equals( + this.additionalProperties, additionalPropertiesBoolean.additionalProperties) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode(), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesBoolean {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } } - 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 60ce9ac318e2..f55a231eb486 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 @@ -3,473 +3,565 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * AdditionalPropertiesClass - */ +/** AdditionalPropertiesClass */ @JsonPropertyOrder({ - AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY, - AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, - AdditionalPropertiesClass.JSON_PROPERTY_EMPTY_MAP, - AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING + AdditionalPropertiesClass.JSON_PROPERTY_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_OF_MAP_PROPERTY, + AdditionalPropertiesClass.JSON_PROPERTY_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3, + AdditionalPropertiesClass.JSON_PROPERTY_EMPTY_MAP, + AdditionalPropertiesClass.JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesClass { - public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; - private Map mapProperty = new HashMap<>(); + public static final String JSON_PROPERTY_MAP_PROPERTY = "map_property"; + private Map mapProperty = new HashMap<>(); - public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; - private Map> mapOfMapProperty = new HashMap<>(); + public static final String JSON_PROPERTY_MAP_OF_MAP_PROPERTY = "map_of_map_property"; + private Map> mapOfMapProperty = new HashMap<>(); - public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; - private JsonNullable anytype1 = JsonNullable.of(null); + public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1"; + private JsonNullable anytype1 = JsonNullable.of(null); - public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = "map_with_undeclared_properties_anytype_1"; - private Object mapWithUndeclaredPropertiesAnytype1; + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1 = + "map_with_undeclared_properties_anytype_1"; + private Object mapWithUndeclaredPropertiesAnytype1; - public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = "map_with_undeclared_properties_anytype_2"; - private Object mapWithUndeclaredPropertiesAnytype2; + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2 = + "map_with_undeclared_properties_anytype_2"; + private Object mapWithUndeclaredPropertiesAnytype2; - public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = "map_with_undeclared_properties_anytype_3"; - private Map mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3 = + "map_with_undeclared_properties_anytype_3"; + private Map mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); - public static final String JSON_PROPERTY_EMPTY_MAP = "empty_map"; - private Object emptyMap; + public static final String JSON_PROPERTY_EMPTY_MAP = "empty_map"; + private Object emptyMap; - public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING = "map_with_undeclared_properties_string"; - private Map mapWithUndeclaredPropertiesString = new HashMap<>(); + public static final String JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING = + "map_with_undeclared_properties_string"; + private Map mapWithUndeclaredPropertiesString = new HashMap<>(); - public AdditionalPropertiesClass() { - } + public AdditionalPropertiesClass() {} - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; - return this; - } - - public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { - if (this.mapProperty == null) { - this.mapProperty = new HashMap<>(); + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + return this; } - this.mapProperty.put(key, mapPropertyItem); - return this; - } - /** - * Get mapProperty - * @return mapProperty - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMapProperty() { - return mapProperty; - } - - - @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; - } - - - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; - return this; - } - - public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { - if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap<>(); + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); + } + this.mapProperty.put(key, mapPropertyItem); + return this; } - this.mapOfMapProperty.put(key, mapOfMapPropertyItem); - return this; - } - /** - * Get mapOfMapProperty - * @return mapOfMapProperty - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Get mapProperty + * + * @return mapProperty + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapProperty() { + return mapProperty; + } - public Map> getMapOfMapProperty() { - return mapOfMapProperty; - } + @JsonProperty(JSON_PROPERTY_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; + } + public AdditionalPropertiesClass mapOfMapProperty( + Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + return this; + } - @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; - } + public AdditionalPropertiesClass putMapOfMapPropertyItem( + String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); + } + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); + return this; + } + /** + * Get mapOfMapProperty + * + * @return mapOfMapProperty + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapOfMapProperty() { + return mapOfMapProperty; + } - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = JsonNullable.of(anytype1); - return this; - } + @JsonProperty(JSON_PROPERTY_MAP_OF_MAP_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; + } - /** - * Get anytype1 - * @return anytype1 - **/ - @javax.annotation.Nullable - @JsonIgnore + public AdditionalPropertiesClass anytype1(Object anytype1) { + this.anytype1 = JsonNullable.of(anytype1); + return this; + } - public Object getAnytype1() { + /** + * Get anytype1 + * + * @return anytype1 + */ + @javax.annotation.Nullable + @JsonIgnore + public Object getAnytype1() { return anytype1.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable getAnytype1_JsonNullable() { - return anytype1; - } - - @JsonProperty(JSON_PROPERTY_ANYTYPE1) - public void setAnytype1_JsonNullable(JsonNullable anytype1) { - this.anytype1 = anytype1; - } - - public void setAnytype1(Object anytype1) { - this.anytype1 = JsonNullable.of(anytype1); - } - - - public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { - this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; - return this; - } - - /** - * Get mapWithUndeclaredPropertiesAnytype1 - * @return mapWithUndeclaredPropertiesAnytype1 - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getMapWithUndeclaredPropertiesAnytype1() { - return mapWithUndeclaredPropertiesAnytype1; - } - - - @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { - this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; - } - - - public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { - this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; - return this; - } - - /** - * Get mapWithUndeclaredPropertiesAnytype2 - * @return mapWithUndeclaredPropertiesAnytype2 - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getMapWithUndeclaredPropertiesAnytype2() { - return mapWithUndeclaredPropertiesAnytype2; - } - - - @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { - this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; - } - - - public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { - this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; - return this; - } - - public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item(String key, Object mapWithUndeclaredPropertiesAnytype3Item) { - if (this.mapWithUndeclaredPropertiesAnytype3 == null) { - this.mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); - } - this.mapWithUndeclaredPropertiesAnytype3.put(key, mapWithUndeclaredPropertiesAnytype3Item); - return this; - } - - /** - * Get mapWithUndeclaredPropertiesAnytype3 - * @return mapWithUndeclaredPropertiesAnytype3 - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMapWithUndeclaredPropertiesAnytype3() { - return mapWithUndeclaredPropertiesAnytype3; - } - - - @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setMapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) { - this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; - } - - - public AdditionalPropertiesClass emptyMap(Object emptyMap) { - this.emptyMap = emptyMap; - return this; - } - - /** - * an object with no declared properties and no undeclared properties, hence it's an empty map. - * @return emptyMap - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EMPTY_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getEmptyMap() { - return emptyMap; - } - - - @JsonProperty(JSON_PROPERTY_EMPTY_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmptyMap(Object emptyMap) { - this.emptyMap = emptyMap; - } - - - public AdditionalPropertiesClass mapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { - this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; - return this; - } - - public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem(String key, String mapWithUndeclaredPropertiesStringItem) { - if (this.mapWithUndeclaredPropertiesString == null) { - this.mapWithUndeclaredPropertiesString = new HashMap<>(); - } - this.mapWithUndeclaredPropertiesString.put(key, mapWithUndeclaredPropertiesStringItem); - return this; - } - - /** - * Get mapWithUndeclaredPropertiesString - * @return mapWithUndeclaredPropertiesString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMapWithUndeclaredPropertiesString() { - return mapWithUndeclaredPropertiesString; - } - - - @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) { - this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; - } - - - /** - * Return true if this AdditionalPropertiesClass object is equal to o. - */ - @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); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(mapProperty, mapOfMapProperty, hashCodeNullable(anytype1), mapWithUndeclaredPropertiesAnytype1, mapWithUndeclaredPropertiesAnytype2, mapWithUndeclaredPropertiesAnytype3, emptyMap, mapWithUndeclaredPropertiesString); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" mapWithUndeclaredPropertiesAnytype1: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype1)).append("\n"); - sb.append(" mapWithUndeclaredPropertiesAnytype2: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype2)).append("\n"); - sb.append(" mapWithUndeclaredPropertiesAnytype3: ").append(toIndentedString(mapWithUndeclaredPropertiesAnytype3)).append("\n"); - sb.append(" emptyMap: ").append(toIndentedString(emptyMap)).append("\n"); - sb.append(" mapWithUndeclaredPropertiesString: ").append(toIndentedString(mapWithUndeclaredPropertiesString)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; } - StringJoiner joiner = new StringJoiner("&"); - - // add `map_property` to the URL query string - if (getMapProperty() != null) { - for (String _key : getMapProperty().keySet()) { - joiner.add(String.format("%smap_property%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAnytype1_JsonNullable() { + return anytype1; } - // add `map_of_map_property` to the URL query string - if (getMapOfMapProperty() != null) { - for (String _key : getMapOfMapProperty().keySet()) { - joiner.add(String.format("%smap_of_map_property%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapOfMapProperty().get(_key), URLEncoder.encode(String.valueOf(getMapOfMapProperty().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + @JsonProperty(JSON_PROPERTY_ANYTYPE1) + public void setAnytype1_JsonNullable(JsonNullable anytype1) { + this.anytype1 = anytype1; } - // add `anytype_1` to the URL query string - if (getAnytype1() != null) { - joiner.add(String.format("%sanytype_1%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAnytype1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public void setAnytype1(Object anytype1) { + this.anytype1 = JsonNullable.of(anytype1); } - // add `map_with_undeclared_properties_anytype_1` to the URL query string - if (getMapWithUndeclaredPropertiesAnytype1() != null) { - joiner.add(String.format("%smap_with_undeclared_properties_anytype_1%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesAnytype1()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype1( + Object mapWithUndeclaredPropertiesAnytype1) { + this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; + return this; } - // add `map_with_undeclared_properties_anytype_2` to the URL query string - if (getMapWithUndeclaredPropertiesAnytype2() != null) { - joiner.add(String.format("%smap_with_undeclared_properties_anytype_2%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesAnytype2()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get mapWithUndeclaredPropertiesAnytype1 + * + * @return mapWithUndeclaredPropertiesAnytype1 + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getMapWithUndeclaredPropertiesAnytype1() { + return mapWithUndeclaredPropertiesAnytype1; } - // add `map_with_undeclared_properties_anytype_3` to the URL query string - if (getMapWithUndeclaredPropertiesAnytype3() != null) { - for (String _key : getMapWithUndeclaredPropertiesAnytype3().keySet()) { - joiner.add(String.format("%smap_with_undeclared_properties_anytype_3%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapWithUndeclaredPropertiesAnytype3().get(_key), URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesAnytype3().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE1) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) { + this.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1; } - // add `empty_map` to the URL query string - if (getEmptyMap() != null) { - joiner.add(String.format("%sempty_map%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmptyMap()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype2( + Object mapWithUndeclaredPropertiesAnytype2) { + this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + return this; } - // add `map_with_undeclared_properties_string` to the URL query string - if (getMapWithUndeclaredPropertiesString() != null) { - for (String _key : getMapWithUndeclaredPropertiesString().keySet()) { - joiner.add(String.format("%smap_with_undeclared_properties_string%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapWithUndeclaredPropertiesString().get(_key), URLEncoder.encode(String.valueOf(getMapWithUndeclaredPropertiesString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + /** + * Get mapWithUndeclaredPropertiesAnytype2 + * + * @return mapWithUndeclaredPropertiesAnytype2 + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getMapWithUndeclaredPropertiesAnytype2() { + return mapWithUndeclaredPropertiesAnytype2; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE2) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) { + this.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2; + } + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesAnytype3( + Map mapWithUndeclaredPropertiesAnytype3) { + this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + return this; + } + + public AdditionalPropertiesClass putMapWithUndeclaredPropertiesAnytype3Item( + String key, Object mapWithUndeclaredPropertiesAnytype3Item) { + if (this.mapWithUndeclaredPropertiesAnytype3 == null) { + this.mapWithUndeclaredPropertiesAnytype3 = new HashMap<>(); + } + this.mapWithUndeclaredPropertiesAnytype3.put(key, mapWithUndeclaredPropertiesAnytype3Item); + return this; + } + + /** + * Get mapWithUndeclaredPropertiesAnytype3 + * + * @return mapWithUndeclaredPropertiesAnytype3 + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapWithUndeclaredPropertiesAnytype3() { + return mapWithUndeclaredPropertiesAnytype3; + } + + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_ANYTYPE3) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setMapWithUndeclaredPropertiesAnytype3( + Map mapWithUndeclaredPropertiesAnytype3) { + this.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3; + } + + public AdditionalPropertiesClass emptyMap(Object emptyMap) { + this.emptyMap = emptyMap; + return this; + } + + /** + * an object with no declared properties and no undeclared properties, hence it's an empty + * map. + * + * @return emptyMap + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMPTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getEmptyMap() { + return emptyMap; + } + + @JsonProperty(JSON_PROPERTY_EMPTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmptyMap(Object emptyMap) { + this.emptyMap = emptyMap; + } + + public AdditionalPropertiesClass mapWithUndeclaredPropertiesString( + Map mapWithUndeclaredPropertiesString) { + this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + return this; + } + + public AdditionalPropertiesClass putMapWithUndeclaredPropertiesStringItem( + String key, String mapWithUndeclaredPropertiesStringItem) { + if (this.mapWithUndeclaredPropertiesString == null) { + this.mapWithUndeclaredPropertiesString = new HashMap<>(); + } + this.mapWithUndeclaredPropertiesString.put(key, mapWithUndeclaredPropertiesStringItem); + return this; + } + + /** + * Get mapWithUndeclaredPropertiesString + * + * @return mapWithUndeclaredPropertiesString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapWithUndeclaredPropertiesString() { + return mapWithUndeclaredPropertiesString; + } + + @JsonProperty(JSON_PROPERTY_MAP_WITH_UNDECLARED_PROPERTIES_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapWithUndeclaredPropertiesString( + Map mapWithUndeclaredPropertiesString) { + this.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString; + } + + /** Return true if this AdditionalPropertiesClass object is equal to o. */ + @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); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + mapProperty, + mapOfMapProperty, + hashCodeNullable(anytype1), + mapWithUndeclaredPropertiesAnytype1, + mapWithUndeclaredPropertiesAnytype2, + mapWithUndeclaredPropertiesAnytype3, + emptyMap, + mapWithUndeclaredPropertiesString); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesClass {\n"); + sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); + sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype1: ") + .append(toIndentedString(mapWithUndeclaredPropertiesAnytype1)) + .append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype2: ") + .append(toIndentedString(mapWithUndeclaredPropertiesAnytype2)) + .append("\n"); + sb.append(" mapWithUndeclaredPropertiesAnytype3: ") + .append(toIndentedString(mapWithUndeclaredPropertiesAnytype3)) + .append("\n"); + sb.append(" emptyMap: ").append(toIndentedString(emptyMap)).append("\n"); + sb.append(" mapWithUndeclaredPropertiesString: ") + .append(toIndentedString(mapWithUndeclaredPropertiesString)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `map_property` to the URL query string + if (getMapProperty() != null) { + for (String _key : getMapProperty().keySet()) { + joiner.add( + String.format( + "%smap_property%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getMapProperty().get(_key), + URLEncoder.encode( + String.valueOf(getMapProperty().get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `map_of_map_property` to the URL query string + if (getMapOfMapProperty() != null) { + for (String _key : getMapOfMapProperty().keySet()) { + joiner.add( + String.format( + "%smap_of_map_property%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getMapOfMapProperty().get(_key), + URLEncoder.encode( + String.valueOf(getMapOfMapProperty().get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `anytype_1` to the URL query string + if (getAnytype1() != null) { + joiner.add( + String.format( + "%sanytype_1%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getAnytype1()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `map_with_undeclared_properties_anytype_1` to the URL query string + if (getMapWithUndeclaredPropertiesAnytype1() != null) { + joiner.add( + String.format( + "%smap_with_undeclared_properties_anytype_1%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf( + getMapWithUndeclaredPropertiesAnytype1()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `map_with_undeclared_properties_anytype_2` to the URL query string + if (getMapWithUndeclaredPropertiesAnytype2() != null) { + joiner.add( + String.format( + "%smap_with_undeclared_properties_anytype_2%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf( + getMapWithUndeclaredPropertiesAnytype2()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `map_with_undeclared_properties_anytype_3` to the URL query string + if (getMapWithUndeclaredPropertiesAnytype3() != null) { + for (String _key : getMapWithUndeclaredPropertiesAnytype3().keySet()) { + joiner.add( + String.format( + "%smap_with_undeclared_properties_anytype_3%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getMapWithUndeclaredPropertiesAnytype3().get(_key), + URLEncoder.encode( + String.valueOf( + getMapWithUndeclaredPropertiesAnytype3() + .get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `empty_map` to the URL query string + if (getEmptyMap() != null) { + joiner.add( + String.format( + "%sempty_map%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getEmptyMap()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `map_with_undeclared_properties_string` to the URL query string + if (getMapWithUndeclaredPropertiesString() != null) { + for (String _key : getMapWithUndeclaredPropertiesString().keySet()) { + joiner.add( + String.format( + "%smap_with_undeclared_properties_string%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getMapWithUndeclaredPropertiesString().get(_key), + URLEncoder.encode( + String.valueOf( + getMapWithUndeclaredPropertiesString() + .get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java index 42c9d36e7421..913495717395 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesInteger.java @@ -3,159 +3,146 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.HashMap; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * AdditionalPropertiesInteger - */ -@JsonPropertyOrder({ - AdditionalPropertiesInteger.JSON_PROPERTY_NAME -}) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +/** AdditionalPropertiesInteger */ +@JsonPropertyOrder({AdditionalPropertiesInteger.JSON_PROPERTY_NAME}) +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesInteger extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesInteger() { - } + public AdditionalPropertiesInteger() {} - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * @param key the name of the property - * @param value the value of the property - * @return self reference - */ - @JsonAnySetter - public AdditionalPropertiesInteger putAdditionalProperty(String key, Integer value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + public AdditionalPropertiesInteger name(String name) { + this.name = name; + return this; } - this.additionalProperties.put(key, value); - return this; - } - /** - * Return the additional (undeclared) properties. - * @return the additional (undeclared) properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * @param key the name of the property - * @return the additional (undeclared) property with the specified name - */ - public Integer getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - return this.additionalProperties.get(key); - } - /** - * Return true if this AdditionalPropertiesInteger object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public AdditionalPropertiesInteger putAdditionalProperty(String key, Integer value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name)&& - Objects.equals(this.additionalProperties, additionalPropertiesInteger.additionalProperties) && - super.equals(o); - } - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode(), additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesInteger {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; } - return o.toString().replace("\n", "\n "); - } + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Integer getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AdditionalPropertiesInteger object is equal to o. */ + @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) + && Objects.equals( + this.additionalProperties, additionalPropertiesInteger.additionalProperties) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode(), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesInteger {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java index 337f6634520b..27ba1e5952bb 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesNumber.java @@ -3,160 +3,147 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.HashMap; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * AdditionalPropertiesNumber - */ -@JsonPropertyOrder({ - AdditionalPropertiesNumber.JSON_PROPERTY_NAME -}) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +/** AdditionalPropertiesNumber */ +@JsonPropertyOrder({AdditionalPropertiesNumber.JSON_PROPERTY_NAME}) +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesNumber extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesNumber() { - } + public AdditionalPropertiesNumber() {} - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * @param key the name of the property - * @param value the value of the property - * @return self reference - */ - @JsonAnySetter - public AdditionalPropertiesNumber putAdditionalProperty(String key, BigDecimal value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + public AdditionalPropertiesNumber name(String name) { + this.name = name; + return this; } - this.additionalProperties.put(key, value); - return this; - } - /** - * Return the additional (undeclared) properties. - * @return the additional (undeclared) properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * @param key the name of the property - * @return the additional (undeclared) property with the specified name - */ - public BigDecimal getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - return this.additionalProperties.get(key); - } - /** - * Return true if this AdditionalPropertiesNumber object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public AdditionalPropertiesNumber putAdditionalProperty(String key, BigDecimal value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name)&& - Objects.equals(this.additionalProperties, additionalPropertiesNumber.additionalProperties) && - super.equals(o); - } - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode(), additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesNumber {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; } - return o.toString().replace("\n", "\n "); - } + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public BigDecimal getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AdditionalPropertiesNumber object is equal to o. */ + @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) + && Objects.equals( + this.additionalProperties, additionalPropertiesNumber.additionalProperties) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode(), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesNumber {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java index fece9479eafe..5dd94530cb5b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesObject.java @@ -3,159 +3,146 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.HashMap; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * AdditionalPropertiesObject - */ -@JsonPropertyOrder({ - AdditionalPropertiesObject.JSON_PROPERTY_NAME -}) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +/** AdditionalPropertiesObject */ +@JsonPropertyOrder({AdditionalPropertiesObject.JSON_PROPERTY_NAME}) +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesObject extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesObject() { - } + public AdditionalPropertiesObject() {} - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * @param key the name of the property - * @param value the value of the property - * @return self reference - */ - @JsonAnySetter - public AdditionalPropertiesObject putAdditionalProperty(String key, Map value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + public AdditionalPropertiesObject name(String name) { + this.name = name; + return this; } - this.additionalProperties.put(key, value); - return this; - } - /** - * Return the additional (undeclared) properties. - * @return the additional (undeclared) properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * @param key the name of the property - * @return the additional (undeclared) property with the specified name - */ - public Map getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - return this.additionalProperties.get(key); - } - /** - * Return true if this AdditionalPropertiesObject object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public AdditionalPropertiesObject putAdditionalProperty(String key, Map value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name)&& - Objects.equals(this.additionalProperties, additionalPropertiesObject.additionalProperties) && - super.equals(o); - } - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode(), additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesObject {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; } - return o.toString().replace("\n", "\n "); - } + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Map getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AdditionalPropertiesObject object is equal to o. */ + @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) + && Objects.equals( + this.additionalProperties, additionalPropertiesObject.additionalProperties) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode(), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesObject {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java index 5be6aabb7d2b..2a4d139ebd34 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AdditionalPropertiesString.java @@ -3,159 +3,146 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.HashMap; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * AdditionalPropertiesString - */ -@JsonPropertyOrder({ - AdditionalPropertiesString.JSON_PROPERTY_NAME -}) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +/** AdditionalPropertiesString */ +@JsonPropertyOrder({AdditionalPropertiesString.JSON_PROPERTY_NAME}) +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AdditionalPropertiesString extends HashMap { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public AdditionalPropertiesString() { - } + public AdditionalPropertiesString() {} - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * @param key the name of the property - * @param value the value of the property - * @return self reference - */ - @JsonAnySetter - public AdditionalPropertiesString putAdditionalProperty(String key, String value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); + public AdditionalPropertiesString name(String name) { + this.name = name; + return this; } - this.additionalProperties.put(key, value); - return this; - } - /** - * Return the additional (undeclared) properties. - * @return the additional (undeclared) properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * @param key the name of the property - * @return the additional (undeclared) property with the specified name - */ - public String getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - return this.additionalProperties.get(key); - } - /** - * Return true if this AdditionalPropertiesString object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public AdditionalPropertiesString putAdditionalProperty(String key, String value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name)&& - Objects.equals(this.additionalProperties, additionalPropertiesString.additionalProperties) && - super.equals(o); - } - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode(), additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesString {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; } - return o.toString().replace("\n", "\n "); - } + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public String getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this AdditionalPropertiesString object is equal to o. */ + @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) + && Objects.equals( + this.additionalProperties, additionalPropertiesString.additionalProperties) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, super.hashCode(), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AdditionalPropertiesString {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java index 106abac0919c..b49cb8ea510b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java @@ -3,185 +3,173 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.SingleRefType; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * AllOfWithSingleRef - */ +/** AllOfWithSingleRef */ @JsonPropertyOrder({ - AllOfWithSingleRef.JSON_PROPERTY_USERNAME, - AllOfWithSingleRef.JSON_PROPERTY_SINGLE_REF_TYPE + AllOfWithSingleRef.JSON_PROPERTY_USERNAME, + AllOfWithSingleRef.JSON_PROPERTY_SINGLE_REF_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AllOfWithSingleRef { - public static final String JSON_PROPERTY_USERNAME = "username"; - private String username; + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; - public static final String JSON_PROPERTY_SINGLE_REF_TYPE = "SingleRefType"; - private SingleRefType singleRefType; + public static final String JSON_PROPERTY_SINGLE_REF_TYPE = "SingleRefType"; + private SingleRefType singleRefType; - public AllOfWithSingleRef() { - } + public AllOfWithSingleRef() {} - public AllOfWithSingleRef username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getUsername() { - return username; - } - - - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsername(String username) { - this.username = username; - } - - - public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { - this.singleRefType = singleRefType; - return this; - } - - /** - * Get singleRefType - * @return singleRefType - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public SingleRefType getSingleRefType() { - return singleRefType; - } - - - @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSingleRefType(SingleRefType singleRefType) { - this.singleRefType = singleRefType; - } - - - /** - * Return true if this AllOfWithSingleRef object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o; - return Objects.equals(this.username, allOfWithSingleRef.username) && - Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType); - } - - @Override - public int hashCode() { - return Objects.hash(username, singleRefType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AllOfWithSingleRef {\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `username` to the URL query string - if (getUsername() != null) { - joiner.add(String.format("%susername%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsername()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get username + * + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; } - // add `SingleRefType` to the URL query string - if (getSingleRefType() != null) { - joiner.add(getSingleRefType().toUrlQueryString(prefix + "SingleRefType" + suffix)); + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; } - return joiner.toString(); - } + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + /** + * Get singleRefType + * + * @return singleRefType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SingleRefType getSingleRefType() { + return singleRefType; + } + + @JsonProperty(JSON_PROPERTY_SINGLE_REF_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + /** Return true if this AllOfWithSingleRef object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o; + return Objects.equals(this.username, allOfWithSingleRef.username) + && Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType); + } + + @Override + public int hashCode() { + return Objects.hash(username, singleRefType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `username` to the URL query string + if (getUsername() != null) { + joiner.add( + String.format( + "%susername%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getUsername()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `SingleRefType` to the URL query string + if (getSingleRefType() != null) { + joiner.add(getSingleRefType().toUrlQueryString(prefix + "SingleRefType" + suffix)); + } + + return joiner.toString(); + } } - 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 cffa1c6286ac..a32cd70f4f71 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 @@ -3,208 +3,206 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; import org.openapitools.client.JSON; -/** - * Animal - */ -@JsonPropertyOrder({ - Animal.JSON_PROPERTY_CLASS_NAME, - Animal.JSON_PROPERTY_COLOR -}) + +/** Animal */ +@JsonPropertyOrder({Animal.JSON_PROPERTY_CLASS_NAME, Animal.JSON_PROPERTY_COLOR}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) + value = "className", // ignore manually set className, it will be automatically generated by + // Jackson during serialization + allowSetters = true // allows the className to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "className", + visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), + @JsonSubTypes.Type(value = Cat.class, name = "Cat"), + @JsonSubTypes.Type(value = Dog.class, name = "Dog"), }) - public class Animal { - public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; - public static final String JSON_PROPERTY_COLOR = "color"; - private String color = "red"; + public static final String JSON_PROPERTY_COLOR = "color"; + private String color = "red"; - public Animal() { - } + public Animal() {} - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getClassName() { - return className; - } - - - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(String className) { - this.className = className; - } - - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getColor() { - return color; - } - - - @JsonProperty(JSON_PROPERTY_COLOR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setColor(String color) { - this.color = color; - } - - - /** - * Return true if this Animal object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Animal className(String className) { + this.className = className; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `className` to the URL query string - if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get className + * + * @return className + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; } - // add `color` to the URL query string - if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(String className) { + this.className = className; } - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Cat", Cat.class); - mappings.put("Dog", Dog.class); - mappings.put("Animal", Animal.class); - JSON.registerDiscriminator(Animal.class, "className", mappings); + public Animal color(String color) { + this.color = color; + return this; + } + + /** + * Get color + * + * @return color + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getColor() { + return color; + } + + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setColor(String color) { + this.color = color; + } + + /** Return true if this Animal object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(className, color); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Animal {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add( + String.format( + "%sclassName%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getClassName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `color` to the URL query string + if (getColor() != null) { + joiner.add( + String.format( + "%scolor%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Cat", Cat.class); + mappings.put("Dog", Dog.class); + mappings.put("Animal", Animal.class); + JSON.registerDiscriminator(Animal.class, "className", mappings); + } } -} - 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 0f2ba7c504c1..925bd194257b 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 @@ -3,184 +3,176 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Apple - */ -@JsonPropertyOrder({ - Apple.JSON_PROPERTY_CULTIVAR, - Apple.JSON_PROPERTY_ORIGIN -}) +/** Apple */ +@JsonPropertyOrder({Apple.JSON_PROPERTY_CULTIVAR, Apple.JSON_PROPERTY_ORIGIN}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Apple { - public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; - private String cultivar; + public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; + private String cultivar; - public static final String JSON_PROPERTY_ORIGIN = "origin"; - private String origin; + public static final String JSON_PROPERTY_ORIGIN = "origin"; + private String origin; - public Apple() { - } + public Apple() {} - public Apple cultivar(String cultivar) { - this.cultivar = cultivar; - return this; - } - - /** - * Get cultivar - * @return cultivar - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CULTIVAR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCultivar() { - return cultivar; - } - - - @JsonProperty(JSON_PROPERTY_CULTIVAR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCultivar(String cultivar) { - this.cultivar = cultivar; - } - - - public Apple origin(String origin) { - this.origin = origin; - return this; - } - - /** - * Get origin - * @return origin - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ORIGIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getOrigin() { - return origin; - } - - - @JsonProperty(JSON_PROPERTY_ORIGIN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOrigin(String origin) { - this.origin = origin; - } - - - /** - * Return true if this apple object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(cultivar, origin); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Apple {\n"); - sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n"); - sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Apple cultivar(String cultivar) { + this.cultivar = cultivar; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `cultivar` to the URL query string - if (getCultivar() != null) { - joiner.add(String.format("%scultivar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCultivar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get cultivar + * + * @return cultivar + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CULTIVAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCultivar() { + return cultivar; } - // add `origin` to the URL query string - if (getOrigin() != null) { - joiner.add(String.format("%sorigin%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOrigin()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_CULTIVAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCultivar(String cultivar) { + this.cultivar = cultivar; } - return joiner.toString(); - } + public Apple origin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get origin + * + * @return origin + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORIGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getOrigin() { + return origin; + } + + @JsonProperty(JSON_PROPERTY_ORIGIN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOrigin(String origin) { + this.origin = origin; + } + + /** Return true if this apple object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(cultivar, origin); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Apple {\n"); + sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n"); + sb.append(" origin: ").append(toIndentedString(origin)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `cultivar` to the URL query string + if (getCultivar() != null) { + joiner.add( + String.format( + "%scultivar%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getCultivar()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `origin` to the URL query string + if (getOrigin() != null) { + joiner.add( + String.format( + "%sorigin%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getOrigin()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 c514a9a4e84e..9a1c91cb6692 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 @@ -3,184 +3,176 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * AppleReq - */ -@JsonPropertyOrder({ - AppleReq.JSON_PROPERTY_CULTIVAR, - AppleReq.JSON_PROPERTY_MEALY -}) +/** AppleReq */ +@JsonPropertyOrder({AppleReq.JSON_PROPERTY_CULTIVAR, AppleReq.JSON_PROPERTY_MEALY}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class AppleReq { - public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; - private String cultivar; + public static final String JSON_PROPERTY_CULTIVAR = "cultivar"; + private String cultivar; - public static final String JSON_PROPERTY_MEALY = "mealy"; - private Boolean mealy; + public static final String JSON_PROPERTY_MEALY = "mealy"; + private Boolean mealy; - public AppleReq() { - } + public AppleReq() {} - public AppleReq cultivar(String cultivar) { - this.cultivar = cultivar; - return this; - } - - /** - * Get cultivar - * @return cultivar - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CULTIVAR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getCultivar() { - return cultivar; - } - - - @JsonProperty(JSON_PROPERTY_CULTIVAR) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setCultivar(String cultivar) { - this.cultivar = cultivar; - } - - - public AppleReq mealy(Boolean mealy) { - this.mealy = mealy; - return this; - } - - /** - * Get mealy - * @return mealy - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MEALY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getMealy() { - return mealy; - } - - - @JsonProperty(JSON_PROPERTY_MEALY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMealy(Boolean mealy) { - this.mealy = mealy; - } - - - /** - * Return true if this appleReq object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(cultivar, mealy); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AppleReq {\n"); - sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n"); - sb.append(" mealy: ").append(toIndentedString(mealy)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public AppleReq cultivar(String cultivar) { + this.cultivar = cultivar; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `cultivar` to the URL query string - if (getCultivar() != null) { - joiner.add(String.format("%scultivar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCultivar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get cultivar + * + * @return cultivar + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CULTIVAR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getCultivar() { + return cultivar; } - // add `mealy` to the URL query string - if (getMealy() != null) { - joiner.add(String.format("%smealy%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMealy()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_CULTIVAR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setCultivar(String cultivar) { + this.cultivar = cultivar; } - return joiner.toString(); - } + public AppleReq mealy(Boolean mealy) { + this.mealy = mealy; + return this; + } + + /** + * Get mealy + * + * @return mealy + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MEALY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMealy() { + return mealy; + } + + @JsonProperty(JSON_PROPERTY_MEALY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMealy(Boolean mealy) { + this.mealy = mealy; + } + + /** Return true if this appleReq object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(cultivar, mealy); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppleReq {\n"); + sb.append(" cultivar: ").append(toIndentedString(cultivar)).append("\n"); + sb.append(" mealy: ").append(toIndentedString(mealy)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `cultivar` to the URL query string + if (getCultivar() != null) { + joiner.add( + String.format( + "%scultivar%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getCultivar()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `mealy` to the URL query string + if (getMealy() != null) { + joiner.add( + String.format( + "%smealy%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getMealy()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayDefaultValue.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayDefaultValue.java index 18c17dc26072..9974d3182f9a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayDefaultValue.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ArrayDefaultValue.java @@ -3,184 +3,164 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * ArrayDefaultValue - */ -@JsonPropertyOrder({ - ArrayDefaultValue.JSON_PROPERTY_ID, - ArrayDefaultValue.JSON_PROPERTY_OUTCOMES -}) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +/** ArrayDefaultValue */ +@JsonPropertyOrder({ArrayDefaultValue.JSON_PROPERTY_ID, ArrayDefaultValue.JSON_PROPERTY_OUTCOMES}) +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayDefaultValue { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - /** - * Gets or Sets outcomes - */ - public enum OutcomesEnum { - SUCCESS("SUCCESS"), - - FAILURE("FAILURE"), - - SKIPPED("SKIPPED"); + /** Gets or Sets outcomes */ + public enum OutcomesEnum { + SUCCESS("SUCCESS"), - private String value; + FAILURE("FAILURE"), - OutcomesEnum(String value) { - this.value = value; + SKIPPED("SKIPPED"); + + private String value; + + OutcomesEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OutcomesEnum fromValue(String value) { + for (OutcomesEnum b : OutcomesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_OUTCOMES = "outcomes"; + private List outcomes = null; + + public ArrayDefaultValue() {} + + public ArrayDefaultValue id(Long id) { + this.id = id; + return this; + } + + /** + * id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public ArrayDefaultValue outcomes(List outcomes) { + this.outcomes = outcomes; + return this; + } + + public ArrayDefaultValue addOutcomesItem(OutcomesEnum outcomesItem) { + if (this.outcomes == null) { + this.outcomes = new ArrayList<>(); + } + this.outcomes.add(outcomesItem); + return this; + } + + /** + * Get outcomes + * + * @return outcomes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTCOMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getOutcomes() { + return outcomes; + } + + @JsonProperty(JSON_PROPERTY_OUTCOMES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOutcomes(List outcomes) { + this.outcomes = outcomes; + } + + /** Return true if this ArrayDefaultValue object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayDefaultValue arrayDefaultValue = (ArrayDefaultValue) o; + return Objects.equals(this.id, arrayDefaultValue.id) + && Objects.equals(this.outcomes, arrayDefaultValue.outcomes); + } + + @Override + public int hashCode() { + return Objects.hash(id, outcomes); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayDefaultValue {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" outcomes: ").append(toIndentedString(outcomes)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static OutcomesEnum fromValue(String value) { - for (OutcomesEnum b : OutcomesEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - - public static final String JSON_PROPERTY_OUTCOMES = "outcomes"; - private List outcomes = null; - - public ArrayDefaultValue() { - } - - public ArrayDefaultValue id(Long id) { - this.id = id; - return this; - } - - /** - * id - * @return id - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Long getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - - public ArrayDefaultValue outcomes(List outcomes) { - this.outcomes = outcomes; - return this; - } - - public ArrayDefaultValue addOutcomesItem(OutcomesEnum outcomesItem) { - if (this.outcomes == null) { - this.outcomes = new ArrayList<>(); - } - this.outcomes.add(outcomesItem); - return this; - } - - /** - * Get outcomes - * @return outcomes - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OUTCOMES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getOutcomes() { - return outcomes; - } - - - @JsonProperty(JSON_PROPERTY_OUTCOMES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOutcomes(List outcomes) { - this.outcomes = outcomes; - } - - - /** - * Return true if this ArrayDefaultValue object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayDefaultValue arrayDefaultValue = (ArrayDefaultValue) o; - return Objects.equals(this.id, arrayDefaultValue.id) && - Objects.equals(this.outcomes, arrayDefaultValue.outcomes); - } - - @Override - public int hashCode() { - return Objects.hash(id, outcomes); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayDefaultValue {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" outcomes: ").append(toIndentedString(outcomes)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - } - 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 06e670c331ed..6a2fff7bbee0 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 @@ -3,165 +3,158 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * ArrayOfArrayOfNumberOnly - */ -@JsonPropertyOrder({ - ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER -}) +/** ArrayOfArrayOfNumberOnly */ +@JsonPropertyOrder({ArrayOfArrayOfNumberOnly.JSON_PROPERTY_ARRAY_ARRAY_NUMBER}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfArrayOfNumberOnly { - public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; - private List> arrayArrayNumber = new ArrayList<>(); + public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber"; + private List> arrayArrayNumber = new ArrayList<>(); - public ArrayOfArrayOfNumberOnly() { - } + public ArrayOfArrayOfNumberOnly() {} - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - - /** - * Return true if this ArrayOfArrayOfNumberOnly object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `ArrayArrayNumber` to the URL query string - if (getArrayArrayNumber() != null) { - for (int i = 0; i < getArrayArrayNumber().size(); i++) { - if (getArrayArrayNumber().get(i) != null) { - joiner.add(String.format("%sArrayArrayNumber%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { + if (this.arrayArrayNumber == null) { + this.arrayArrayNumber = new ArrayList<>(); } - } + this.arrayArrayNumber.add(arrayArrayNumberItem); + return this; } - return joiner.toString(); - } -} + /** + * Get arrayArrayNumber + * + * @return arrayArrayNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayNumber() { + return arrayArrayNumber; + } + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayNumber(List> arrayArrayNumber) { + this.arrayArrayNumber = arrayArrayNumber; + } + + /** Return true if this ArrayOfArrayOfNumberOnly object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(arrayArrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfArrayOfNumberOnly {\n"); + sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ArrayArrayNumber` to the URL query string + if (getArrayArrayNumber() != null) { + for (int i = 0; i < getArrayArrayNumber().size(); i++) { + if (getArrayArrayNumber().get(i) != null) { + joiner.add( + String.format( + "%sArrayArrayNumber%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getArrayArrayNumber().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + } + + return joiner.toString(); + } +} 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 0acb932ad368..950c33393bd8 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 @@ -3,165 +3,158 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * ArrayOfNumberOnly - */ -@JsonPropertyOrder({ - ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER -}) +/** ArrayOfNumberOnly */ +@JsonPropertyOrder({ArrayOfNumberOnly.JSON_PROPERTY_ARRAY_NUMBER}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayOfNumberOnly { - public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; - private List arrayNumber = new ArrayList<>(); + public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber"; + private List arrayNumber = new ArrayList<>(); - public ArrayOfNumberOnly() { - } + public ArrayOfNumberOnly() {} - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getArrayNumber() { - return arrayNumber; - } - - - @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - - /** - * Return true if this ArrayOfNumberOnly object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ArrayOfNumberOnly arrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `ArrayNumber` to the URL query string - if (getArrayNumber() != null) { - for (int i = 0; i < getArrayNumber().size(); i++) { - if (getArrayNumber().get(i) != null) { - joiner.add(String.format("%sArrayNumber%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayNumber().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { + if (this.arrayNumber == null) { + this.arrayNumber = new ArrayList<>(); } - } + this.arrayNumber.add(arrayNumberItem); + return this; } - return joiner.toString(); - } -} + /** + * Get arrayNumber + * + * @return arrayNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayNumber() { + return arrayNumber; + } + @JsonProperty(JSON_PROPERTY_ARRAY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayNumber(List arrayNumber) { + this.arrayNumber = arrayNumber; + } + + /** Return true if this ArrayOfNumberOnly object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(arrayNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayOfNumberOnly {\n"); + sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `ArrayNumber` to the URL query string + if (getArrayNumber() != null) { + for (int i = 0; i < getArrayNumber().size(); i++) { + if (getArrayNumber().get(i) != null) { + joiner.add( + String.format( + "%sArrayNumber%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getArrayNumber().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + } + + return joiner.toString(); + } +} 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 a43acb13b57c..1d095a3831ac 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 @@ -3,261 +3,275 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import org.openapitools.client.model.ReadOnlyFirst; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * ArrayTest - */ +/** ArrayTest */ @JsonPropertyOrder({ - ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, - ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, - ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL + ArrayTest.JSON_PROPERTY_ARRAY_OF_STRING, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER, + ArrayTest.JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ArrayTest { - public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; - private List arrayOfString = new ArrayList<>(); + public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string"; + private List arrayOfString = new ArrayList<>(); - public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; - private List> arrayArrayOfInteger = new ArrayList<>(); + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer"; + private List> arrayArrayOfInteger = new ArrayList<>(); - public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; - private List> arrayArrayOfModel = new ArrayList<>(); + public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model"; + private List> arrayArrayOfModel = new ArrayList<>(); - public ArrayTest() { - } + public ArrayTest() {} - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getArrayOfString() { - return arrayOfString; - } - - - @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - - @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - - /** - * Return true if this ArrayTest object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ArrayTest arrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `array_of_string` to the URL query string - if (getArrayOfString() != null) { - for (int i = 0; i < getArrayOfString().size(); i++) { - joiner.add(String.format("%sarray_of_string%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayOfString().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } - } - - // add `array_array_of_integer` to the URL query string - if (getArrayArrayOfInteger() != null) { - for (int i = 0; i < getArrayArrayOfInteger().size(); i++) { - joiner.add(String.format("%sarray_array_of_integer%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayArrayOfInteger().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } - } - - // add `array_array_of_model` to the URL query string - if (getArrayArrayOfModel() != null) { - for (int i = 0; i < getArrayArrayOfModel().size(); i++) { - if (getArrayArrayOfModel().get(i) != null) { - joiner.add(String.format("%sarray_array_of_model%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayArrayOfModel().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { + if (this.arrayOfString == null) { + this.arrayOfString = new ArrayList<>(); } - } + this.arrayOfString.add(arrayOfStringItem); + return this; } - return joiner.toString(); - } -} + /** + * Get arrayOfString + * + * @return arrayOfString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayOfString() { + return arrayOfString; + } + @JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayOfString(List arrayOfString) { + this.arrayOfString = arrayOfString; + } + + public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + return this; + } + + public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { + if (this.arrayArrayOfInteger == null) { + this.arrayArrayOfInteger = new ArrayList<>(); + } + this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); + return this; + } + + /** + * Get arrayArrayOfInteger + * + * @return arrayArrayOfInteger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfInteger() { + return arrayArrayOfInteger; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { + this.arrayArrayOfInteger = arrayArrayOfInteger; + } + + public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + return this; + } + + public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { + if (this.arrayArrayOfModel == null) { + this.arrayArrayOfModel = new ArrayList<>(); + } + this.arrayArrayOfModel.add(arrayArrayOfModelItem); + return this; + } + + /** + * Get arrayArrayOfModel + * + * @return arrayArrayOfModel + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getArrayArrayOfModel() { + return arrayArrayOfModel; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayArrayOfModel(List> arrayArrayOfModel) { + this.arrayArrayOfModel = arrayArrayOfModel; + } + + /** Return true if this ArrayTest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ArrayTest arrayTest = (ArrayTest) o; + return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) + && Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) + && Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); + } + + @Override + public int hashCode() { + return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ArrayTest {\n"); + sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); + sb.append(" arrayArrayOfInteger: ") + .append(toIndentedString(arrayArrayOfInteger)) + .append("\n"); + sb.append(" arrayArrayOfModel: ") + .append(toIndentedString(arrayArrayOfModel)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `array_of_string` to the URL query string + if (getArrayOfString() != null) { + for (int i = 0; i < getArrayOfString().size(); i++) { + joiner.add( + String.format( + "%sarray_of_string%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getArrayOfString().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `array_array_of_integer` to the URL query string + if (getArrayArrayOfInteger() != null) { + for (int i = 0; i < getArrayArrayOfInteger().size(); i++) { + joiner.add( + String.format( + "%sarray_array_of_integer%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getArrayArrayOfInteger().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `array_array_of_model` to the URL query string + if (getArrayArrayOfModel() != null) { + for (int i = 0; i < getArrayArrayOfModel().size(); i++) { + if (getArrayArrayOfModel().get(i) != null) { + joiner.add( + String.format( + "%sarray_array_of_model%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getArrayArrayOfModel().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + } + + return joiner.toString(); + } +} diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Banana.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Banana.java index 662cd59df43c..18f400271c40 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Banana.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Banana.java @@ -3,149 +3,138 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Banana - */ -@JsonPropertyOrder({ - Banana.JSON_PROPERTY_LENGTH_CM -}) +/** Banana */ +@JsonPropertyOrder({Banana.JSON_PROPERTY_LENGTH_CM}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Banana { - public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; - private BigDecimal lengthCm; + public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; + private BigDecimal lengthCm; - public Banana() { - } + public Banana() {} - public Banana lengthCm(BigDecimal lengthCm) { - this.lengthCm = lengthCm; - return this; - } - - /** - * Get lengthCm - * @return lengthCm - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LENGTH_CM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getLengthCm() { - return lengthCm; - } - - - @JsonProperty(JSON_PROPERTY_LENGTH_CM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLengthCm(BigDecimal lengthCm) { - this.lengthCm = lengthCm; - } - - - /** - * Return true if this banana object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Banana banana = (Banana) o; - return Objects.equals(this.lengthCm, banana.lengthCm); - } - - @Override - public int hashCode() { - return Objects.hash(lengthCm); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Banana {\n"); - sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Banana lengthCm(BigDecimal lengthCm) { + this.lengthCm = lengthCm; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `lengthCm` to the URL query string - if (getLengthCm() != null) { - joiner.add(String.format("%slengthCm%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLengthCm()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get lengthCm + * + * @return lengthCm + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LENGTH_CM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getLengthCm() { + return lengthCm; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_LENGTH_CM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLengthCm(BigDecimal lengthCm) { + this.lengthCm = lengthCm; + } + + /** Return true if this banana object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Banana banana = (Banana) o; + return Objects.equals(this.lengthCm, banana.lengthCm); + } + + @Override + public int hashCode() { + return Objects.hash(lengthCm); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Banana {\n"); + sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `lengthCm` to the URL query string + if (getLengthCm() != null) { + joiner.add( + String.format( + "%slengthCm%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getLengthCm()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BananaReq.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BananaReq.java index 518ae7eec8c5..44f9e2b4e5e7 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BananaReq.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BananaReq.java @@ -3,185 +3,177 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * BananaReq - */ -@JsonPropertyOrder({ - BananaReq.JSON_PROPERTY_LENGTH_CM, - BananaReq.JSON_PROPERTY_SWEET -}) +/** BananaReq */ +@JsonPropertyOrder({BananaReq.JSON_PROPERTY_LENGTH_CM, BananaReq.JSON_PROPERTY_SWEET}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BananaReq { - public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; - private BigDecimal lengthCm; + public static final String JSON_PROPERTY_LENGTH_CM = "lengthCm"; + private BigDecimal lengthCm; - public static final String JSON_PROPERTY_SWEET = "sweet"; - private Boolean sweet; + public static final String JSON_PROPERTY_SWEET = "sweet"; + private Boolean sweet; - public BananaReq() { - } + public BananaReq() {} - public BananaReq lengthCm(BigDecimal lengthCm) { - this.lengthCm = lengthCm; - return this; - } - - /** - * Get lengthCm - * @return lengthCm - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_LENGTH_CM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public BigDecimal getLengthCm() { - return lengthCm; - } - - - @JsonProperty(JSON_PROPERTY_LENGTH_CM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setLengthCm(BigDecimal lengthCm) { - this.lengthCm = lengthCm; - } - - - public BananaReq sweet(Boolean sweet) { - this.sweet = sweet; - return this; - } - - /** - * Get sweet - * @return sweet - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SWEET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getSweet() { - return sweet; - } - - - @JsonProperty(JSON_PROPERTY_SWEET) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSweet(Boolean sweet) { - this.sweet = sweet; - } - - - /** - * Return true if this bananaReq object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BananaReq bananaReq = (BananaReq) o; - return Objects.equals(this.lengthCm, bananaReq.lengthCm) && - Objects.equals(this.sweet, bananaReq.sweet); - } - - @Override - public int hashCode() { - return Objects.hash(lengthCm, sweet); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BananaReq {\n"); - sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n"); - sb.append(" sweet: ").append(toIndentedString(sweet)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public BananaReq lengthCm(BigDecimal lengthCm) { + this.lengthCm = lengthCm; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `lengthCm` to the URL query string - if (getLengthCm() != null) { - joiner.add(String.format("%slengthCm%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLengthCm()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get lengthCm + * + * @return lengthCm + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_LENGTH_CM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getLengthCm() { + return lengthCm; } - // add `sweet` to the URL query string - if (getSweet() != null) { - joiner.add(String.format("%ssweet%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSweet()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_LENGTH_CM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setLengthCm(BigDecimal lengthCm) { + this.lengthCm = lengthCm; } - return joiner.toString(); - } + public BananaReq sweet(Boolean sweet) { + this.sweet = sweet; + return this; + } + + /** + * Get sweet + * + * @return sweet + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SWEET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getSweet() { + return sweet; + } + + @JsonProperty(JSON_PROPERTY_SWEET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSweet(Boolean sweet) { + this.sweet = sweet; + } + + /** Return true if this bananaReq object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BananaReq bananaReq = (BananaReq) o; + return Objects.equals(this.lengthCm, bananaReq.lengthCm) + && Objects.equals(this.sweet, bananaReq.sweet); + } + + @Override + public int hashCode() { + return Objects.hash(lengthCm, sweet); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BananaReq {\n"); + sb.append(" lengthCm: ").append(toIndentedString(lengthCm)).append("\n"); + sb.append(" sweet: ").append(toIndentedString(sweet)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `lengthCm` to the URL query string + if (getLengthCm() != null) { + joiner.add( + String.format( + "%slengthCm%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getLengthCm()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `sweet` to the URL query string + if (getSweet() != null) { + joiner.add( + String.format( + "%ssweet%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getSweet()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BasquePig.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BasquePig.java index e1c98cd6c7d6..fd075c2d5ca3 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BasquePig.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BasquePig.java @@ -3,148 +3,138 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * BasquePig - */ -@JsonPropertyOrder({ - BasquePig.JSON_PROPERTY_CLASS_NAME -}) +/** BasquePig */ +@JsonPropertyOrder({BasquePig.JSON_PROPERTY_CLASS_NAME}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BasquePig { - public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; - public BasquePig() { - } + public BasquePig() {} - public BasquePig className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getClassName() { - return className; - } - - - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(String className) { - this.className = className; - } - - - /** - * Return true if this BasquePig object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BasquePig basquePig = (BasquePig) o; - return Objects.equals(this.className, basquePig.className); - } - - @Override - public int hashCode() { - return Objects.hash(className); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BasquePig {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public BasquePig className(String className) { + this.className = className; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `className` to the URL query string - if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get className + * + * @return className + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(String className) { + this.className = className; + } + + /** Return true if this BasquePig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BasquePig basquePig = (BasquePig) o; + return Objects.equals(this.className, basquePig.className); + } + + @Override + public int hashCode() { + return Objects.hash(className); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BasquePig {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add( + String.format( + "%sclassName%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getClassName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java index 6ff53ccbf59c..bb95f616d0e8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCat.java @@ -3,164 +3,151 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; import org.openapitools.client.JSON; -/** - * BigCat - */ -@JsonPropertyOrder({ - BigCat.JSON_PROPERTY_KIND -}) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") + +/** BigCat */ +@JsonPropertyOrder({BigCat.JSON_PROPERTY_KIND}) +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) - + value = "className", // ignore manually set className, it will be automatically generated by + // Jackson during serialization + allowSetters = true // allows the className to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "className", + visible = true) public class BigCat extends Cat { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); + /** Gets or Sets kind */ + public enum KindEnum { + LIONS("lions"), - private String value; + TIGERS("tigers"), - KindEnum(String value) { - this.value = value; + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public BigCat() {} + + public BigCat kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * + * @return kind + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public KindEnum getKind() { + return kind; + } + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + /** Return true if this BigCat object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCat bigCat = (BigCat) o; + return Objects.equals(this.kind, bigCat.kind) && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(kind, super.hashCode()); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class BigCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public BigCat() { - } - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - /** - * Return true if this BigCat object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("BigCat", BigCat.class); + JSON.registerDiscriminator(BigCat.class, "className", mappings); } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("BigCat", BigCat.class); - JSON.registerDiscriminator(BigCat.class, "className", mappings); } -} - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java index 7b3f8bb4d9d3..9212e768f07e 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/BigCatAllOf.java @@ -3,145 +3,128 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; - -/** - * BigCatAllOf - */ -@JsonPropertyOrder({ - BigCatAllOf.JSON_PROPERTY_KIND -}) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +/** BigCatAllOf */ +@JsonPropertyOrder({BigCatAllOf.JSON_PROPERTY_KIND}) +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class BigCatAllOf { - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); + /** Gets or Sets kind */ + public enum KindEnum { + LIONS("lions"), - private String value; + TIGERS("tigers"), - KindEnum(String value) { - this.value = value; + LEOPARDS("leopards"), + + JAGUARS("jaguars"); + + private String value; + + KindEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static KindEnum fromValue(String value) { + for (KindEnum b : KindEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_KIND = "kind"; + private KindEnum kind; + + public BigCatAllOf() {} + + public BigCatAllOf kind(KindEnum kind) { + this.kind = kind; + return this; + } + + /** + * Get kind + * + * @return kind + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public KindEnum getKind() { + return kind; + } + + @JsonProperty(JSON_PROPERTY_KIND) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setKind(KindEnum kind) { + this.kind = kind; + } + + /** Return true if this BigCat_allOf object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCatAllOf bigCatAllOf = (BigCatAllOf) o; + return Objects.equals(this.kind, bigCatAllOf.kind); + } + + @Override + public int hashCode() { + return Objects.hash(kind); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class BigCatAllOf {\n"); + sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return o.toString().replace("\n", "\n "); } - } - - public static final String JSON_PROPERTY_KIND = "kind"; - private KindEnum kind; - - public BigCatAllOf() { - } - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public KindEnum getKind() { - return kind; - } - - - @JsonProperty(JSON_PROPERTY_KIND) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setKind(KindEnum kind) { - this.kind = kind; - } - - - /** - * Return true if this BigCat_allOf object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java index 66035b10d5d1..c35cb0e3fd46 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Capitalization.java @@ -3,328 +3,348 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Capitalization - */ +/** Capitalization */ @JsonPropertyOrder({ - Capitalization.JSON_PROPERTY_SMALL_CAMEL, - Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, - Capitalization.JSON_PROPERTY_SMALL_SNAKE, - Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, - Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, - Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E + Capitalization.JSON_PROPERTY_SMALL_CAMEL, + Capitalization.JSON_PROPERTY_CAPITAL_CAMEL, + Capitalization.JSON_PROPERTY_SMALL_SNAKE, + Capitalization.JSON_PROPERTY_CAPITAL_SNAKE, + Capitalization.JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS, + Capitalization.JSON_PROPERTY_A_T_T_N_A_M_E }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Capitalization { - public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; - private String smallCamel; + public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel"; + private String smallCamel; - public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; - private String capitalCamel; + public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel"; + private String capitalCamel; - public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; - private String smallSnake; + public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake"; + private String smallSnake; - public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; - private String capitalSnake; + public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake"; + private String capitalSnake; - public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; - private String scAETHFlowPoints; + public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points"; + private String scAETHFlowPoints; - public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; - private String ATT_NAME; + public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME"; + private String ATT_NAME; - public Capitalization() { - } + public Capitalization() {} - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSmallCamel() { - return smallCamel; - } - - - @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCapitalCamel() { - return capitalCamel; - } - - - @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSmallSnake() { - return smallSnake; - } - - - @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getCapitalSnake() { - return capitalSnake; - } - - - @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - - @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getATTNAME() { - return ATT_NAME; - } - - - @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - - /** - * Return true if this Capitalization object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Capitalization smallCamel(String smallCamel) { + this.smallCamel = smallCamel; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `smallCamel` to the URL query string - if (getSmallCamel() != null) { - joiner.add(String.format("%ssmallCamel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get smallCamel + * + * @return smallCamel + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallCamel() { + return smallCamel; } - // add `CapitalCamel` to the URL query string - if (getCapitalCamel() != null) { - joiner.add(String.format("%sCapitalCamel%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCapitalCamel()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_SMALL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallCamel(String smallCamel) { + this.smallCamel = smallCamel; } - // add `small_Snake` to the URL query string - if (getSmallSnake() != null) { - joiner.add(String.format("%ssmall_Snake%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSmallSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public Capitalization capitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; + return this; } - // add `Capital_Snake` to the URL query string - if (getCapitalSnake() != null) { - joiner.add(String.format("%sCapital_Snake%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCapitalSnake()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get capitalCamel + * + * @return capitalCamel + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalCamel() { + return capitalCamel; } - // add `SCA_ETH_Flow_Points` to the URL query string - if (getScAETHFlowPoints() != null) { - joiner.add(String.format("%sSCA_ETH_Flow_Points%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getScAETHFlowPoints()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalCamel(String capitalCamel) { + this.capitalCamel = capitalCamel; } - // add `ATT_NAME` to the URL query string - if (getATTNAME() != null) { - joiner.add(String.format("%sATT_NAME%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getATTNAME()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public Capitalization smallSnake(String smallSnake) { + this.smallSnake = smallSnake; + return this; } - return joiner.toString(); - } + /** + * Get smallSnake + * + * @return smallSnake + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSmallSnake() { + return smallSnake; + } + + @JsonProperty(JSON_PROPERTY_SMALL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSmallSnake(String smallSnake) { + this.smallSnake = smallSnake; + } + + public Capitalization capitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + return this; + } + + /** + * Get capitalSnake + * + * @return capitalSnake + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCapitalSnake() { + return capitalSnake; + } + + @JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCapitalSnake(String capitalSnake) { + this.capitalSnake = capitalSnake; + } + + public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + return this; + } + + /** + * Get scAETHFlowPoints + * + * @return scAETHFlowPoints + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getScAETHFlowPoints() { + return scAETHFlowPoints; + } + + @JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setScAETHFlowPoints(String scAETHFlowPoints) { + this.scAETHFlowPoints = scAETHFlowPoints; + } + + public Capitalization ATT_NAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + return this; + } + + /** + * Name of the pet + * + * @return ATT_NAME + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getATTNAME() { + return ATT_NAME; + } + + @JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setATTNAME(String ATT_NAME) { + this.ATT_NAME = ATT_NAME; + } + + /** Return true if this Capitalization object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Capitalization capitalization = (Capitalization) o; + return Objects.equals(this.smallCamel, capitalization.smallCamel) + && Objects.equals(this.capitalCamel, capitalization.capitalCamel) + && Objects.equals(this.smallSnake, capitalization.smallSnake) + && Objects.equals(this.capitalSnake, capitalization.capitalSnake) + && Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) + && Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); + } + + @Override + public int hashCode() { + return Objects.hash( + smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Capitalization {\n"); + sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); + sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); + sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); + sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); + sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); + sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `smallCamel` to the URL query string + if (getSmallCamel() != null) { + joiner.add( + String.format( + "%ssmallCamel%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getSmallCamel()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `CapitalCamel` to the URL query string + if (getCapitalCamel() != null) { + joiner.add( + String.format( + "%sCapitalCamel%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getCapitalCamel()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `small_Snake` to the URL query string + if (getSmallSnake() != null) { + joiner.add( + String.format( + "%ssmall_Snake%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getSmallSnake()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `Capital_Snake` to the URL query string + if (getCapitalSnake() != null) { + joiner.add( + String.format( + "%sCapital_Snake%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getCapitalSnake()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `SCA_ETH_Flow_Points` to the URL query string + if (getScAETHFlowPoints() != null) { + joiner.add( + String.format( + "%sSCA_ETH_Flow_Points%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getScAETHFlowPoints()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `ATT_NAME` to the URL query string + if (getATTNAME() != null) { + joiner.add( + String.format( + "%sATT_NAME%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getATTNAME()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java index 8b85a7bb1088..dff315cbd6ef 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Cat.java @@ -3,177 +3,183 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; import org.openapitools.client.JSON; -/** - * Cat - */ -@JsonPropertyOrder({ - Cat.JSON_PROPERTY_DECLAWED -}) + +/** Cat */ +@JsonPropertyOrder({Cat.JSON_PROPERTY_DECLAWED}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) - + value = "className", // ignore manually set className, it will be automatically generated by + // Jackson during serialization + allowSetters = true // allows the className to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "className", + visible = true) public class Cat extends Animal { - public static final String JSON_PROPERTY_DECLAWED = "declawed"; - private Boolean declawed; + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + private Boolean declawed; - public Cat() { - } + public Cat() {} - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getDeclawed() { - return declawed; - } - - - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - - /** - * Return true if this Cat object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Cat declawed(Boolean declawed) { + this.declawed = declawed; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `className` to the URL query string - if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get declawed + * + * @return declawed + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { + return declawed; } - // add `color` to the URL query string - if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; } - // add `declawed` to the URL query string - if (getDeclawed() != null) { - joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeclawed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** Return true if this Cat object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Cat cat = (Cat) o; + return Objects.equals(this.declawed, cat.declawed) && super.equals(o); } - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Cat", Cat.class); - JSON.registerDiscriminator(Cat.class, "className", mappings); + @Override + public int hashCode() { + return Objects.hash(declawed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Cat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add( + String.format( + "%sclassName%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getClassName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `color` to the URL query string + if (getColor() != null) { + joiner.add( + String.format( + "%scolor%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `declawed` to the URL query string + if (getDeclawed() != null) { + joiner.add( + String.format( + "%sdeclawed%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getDeclawed()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Cat", Cat.class); + JSON.registerDiscriminator(Cat.class, "className", mappings); + } } -} - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java index 488de1e892e0..c095acc4005a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/CatAllOf.java @@ -3,148 +3,137 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * CatAllOf - */ -@JsonPropertyOrder({ - CatAllOf.JSON_PROPERTY_DECLAWED -}) +/** CatAllOf */ +@JsonPropertyOrder({CatAllOf.JSON_PROPERTY_DECLAWED}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class CatAllOf { - public static final String JSON_PROPERTY_DECLAWED = "declawed"; - private Boolean declawed; + public static final String JSON_PROPERTY_DECLAWED = "declawed"; + private Boolean declawed; - public CatAllOf() { - } + public CatAllOf() {} - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getDeclawed() { - return declawed; - } - - - @JsonProperty(JSON_PROPERTY_DECLAWED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - - /** - * Return true if this Cat_allOf object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public CatAllOf declawed(Boolean declawed) { + this.declawed = declawed; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `declawed` to the URL query string - if (getDeclawed() != null) { - joiner.add(String.format("%sdeclawed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDeclawed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get declawed + * + * @return declawed + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getDeclawed() { + return declawed; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_DECLAWED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeclawed(Boolean declawed) { + this.declawed = declawed; + } + + /** Return true if this Cat_allOf object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CatAllOf catAllOf = (CatAllOf) o; + return Objects.equals(this.declawed, catAllOf.declawed); + } + + @Override + public int hashCode() { + return Objects.hash(declawed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CatAllOf {\n"); + sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `declawed` to the URL query string + if (getDeclawed() != null) { + joiner.add( + String.format( + "%sdeclawed%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getDeclawed()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java index 3a31ec85e868..873bce9189ca 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Category.java @@ -3,184 +3,175 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Category - */ -@JsonPropertyOrder({ - Category.JSON_PROPERTY_ID, - Category.JSON_PROPERTY_NAME -}) +/** Category */ +@JsonPropertyOrder({Category.JSON_PROPERTY_ID, Category.JSON_PROPERTY_NAME}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Category { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - public static final String JSON_PROPERTY_NAME = "name"; - private String name = "default-name"; + public static final String JSON_PROPERTY_NAME = "name"; + private String name = "default-name"; - public Category() { - } + public Category() {} - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Long getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - /** - * Return true if this Category object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Category id(Long id) { + this.id = id; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `id` to the URL query string - if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; } - // add `name` to the URL query string - if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; } - return joiner.toString(); - } + public Category name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + /** Return true if this Category object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Category category = (Category) o; + return Objects.equals(this.id, category.id) && Objects.equals(this.name, category.name); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Category {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add( + String.format( + "%sid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCat.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCat.java index 95042aa3a5ff..8cd454a1d413 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCat.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCat.java @@ -3,217 +3,219 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ParentPet; -import java.util.Set; -import java.util.HashSet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.StringJoiner; import org.openapitools.client.JSON; -/** - * ChildCat - */ -@JsonPropertyOrder({ - ChildCat.JSON_PROPERTY_NAME, - ChildCat.JSON_PROPERTY_PET_TYPE -}) + +/** ChildCat */ +@JsonPropertyOrder({ChildCat.JSON_PROPERTY_NAME, ChildCat.JSON_PROPERTY_PET_TYPE}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonIgnoreProperties( - value = "pet_type", // ignore manually set pet_type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the pet_type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "pet_type", visible = true) - + value = "pet_type", // ignore manually set pet_type, it will be automatically generated by + // Jackson during serialization + allowSetters = true // allows the pet_type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "pet_type", + visible = true) public class ChildCat extends ParentPet { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; - private String petType = "ChildCat"; + public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + private String petType = "ChildCat"; - public ChildCat() { - } + public ChildCat() {} - public ChildCat name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public static final Set PET_TYPE_VALUES = new HashSet<>(Arrays.asList( - "ChildCat" - )); - - public ChildCat petType(String petType) { - if (!PET_TYPE_VALUES.contains(petType)) { - throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES)); + public ChildCat name(String name) { + this.name = name; + return this; } - this.petType = petType; - return this; - } - - /** - * Get petType - * @return petType - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PET_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPetType() { - return petType; - } - - - @JsonProperty(JSON_PROPERTY_PET_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPetType(String petType) { - if (!PET_TYPE_VALUES.contains(petType)) { - throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES)); + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - this.petType = petType; - } - - - /** - * Return true if this ChildCat object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ChildCat childCat = (ChildCat) o; - return Objects.equals(this.name, childCat.name) && - Objects.equals(this.petType, childCat.petType) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, petType, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChildCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - StringJoiner joiner = new StringJoiner("&"); + public static final Set PET_TYPE_VALUES = new HashSet<>(Arrays.asList("ChildCat")); - // add `pet_type` to the URL query string - if (getPetType() != null) { - joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public ChildCat petType(String petType) { + if (!PET_TYPE_VALUES.contains(petType)) { + throw new IllegalArgumentException( + petType + + " is invalid. Possible values for petType: " + + String.join(", ", PET_TYPE_VALUES)); + } + + this.petType = petType; + return this; } - // add `name` to the URL query string - if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get petType + * + * @return petType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PET_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPetType() { + return petType; } - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildCat", ChildCat.class); - JSON.registerDiscriminator(ChildCat.class, "pet_type", mappings); + @JsonProperty(JSON_PROPERTY_PET_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetType(String petType) { + if (!PET_TYPE_VALUES.contains(petType)) { + throw new IllegalArgumentException( + petType + + " is invalid. Possible values for petType: " + + String.join(", ", PET_TYPE_VALUES)); + } + + this.petType = petType; + } + + /** Return true if this ChildCat object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildCat childCat = (ChildCat) o; + return Objects.equals(this.name, childCat.name) + && Objects.equals(this.petType, childCat.petType) + && super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(name, petType, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildCat {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `pet_type` to the URL query string + if (getPetType() != null) { + joiner.add( + String.format( + "%spet_type%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ChildCat", ChildCat.class); + JSON.registerDiscriminator(ChildCat.class, "pet_type", mappings); + } } -} - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCatAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCatAllOf.java index dd086c58f56e..77815066930a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCatAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ChildCatAllOf.java @@ -3,198 +3,195 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Set; -import java.util.HashSet; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; +import java.util.StringJoiner; - -/** - * ChildCatAllOf - */ -@JsonPropertyOrder({ - ChildCatAllOf.JSON_PROPERTY_NAME, - ChildCatAllOf.JSON_PROPERTY_PET_TYPE -}) +/** ChildCatAllOf */ +@JsonPropertyOrder({ChildCatAllOf.JSON_PROPERTY_NAME, ChildCatAllOf.JSON_PROPERTY_PET_TYPE}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ChildCatAllOf { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; - private String petType = "ChildCat"; + public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + private String petType = "ChildCat"; - public ChildCatAllOf() { - } + public ChildCatAllOf() {} - public ChildCatAllOf name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - public static final Set PET_TYPE_VALUES = new HashSet<>(Arrays.asList( - "ChildCat" - )); - - public ChildCatAllOf petType(String petType) { - if (!PET_TYPE_VALUES.contains(petType)) { - throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES)); + public ChildCatAllOf name(String name) { + this.name = name; + return this; } - this.petType = petType; - return this; - } - - /** - * Get petType - * @return petType - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PET_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPetType() { - return petType; - } - - - @JsonProperty(JSON_PROPERTY_PET_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPetType(String petType) { - if (!PET_TYPE_VALUES.contains(petType)) { - throw new IllegalArgumentException(petType + " is invalid. Possible values for petType: " + String.join(", ", PET_TYPE_VALUES)); + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - this.petType = petType; - } - - - /** - * Return true if this ChildCat_allOf object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ChildCatAllOf childCatAllOf = (ChildCatAllOf) o; - return Objects.equals(this.name, childCatAllOf.name) && - Objects.equals(this.petType, childCatAllOf.petType); - } - - @Override - public int hashCode() { - return Objects.hash(name, petType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ChildCatAllOf {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; } - StringJoiner joiner = new StringJoiner("&"); + public static final Set PET_TYPE_VALUES = new HashSet<>(Arrays.asList("ChildCat")); - // add `name` to the URL query string - if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public ChildCatAllOf petType(String petType) { + if (!PET_TYPE_VALUES.contains(petType)) { + throw new IllegalArgumentException( + petType + + " is invalid. Possible values for petType: " + + String.join(", ", PET_TYPE_VALUES)); + } + + this.petType = petType; + return this; } - // add `pet_type` to the URL query string - if (getPetType() != null) { - joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get petType + * + * @return petType + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PET_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPetType() { + return petType; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_PET_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetType(String petType) { + if (!PET_TYPE_VALUES.contains(petType)) { + throw new IllegalArgumentException( + petType + + " is invalid. Possible values for petType: " + + String.join(", ", PET_TYPE_VALUES)); + } + + this.petType = petType; + } + + /** Return true if this ChildCat_allOf object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildCatAllOf childCatAllOf = (ChildCatAllOf) o; + return Objects.equals(this.name, childCatAllOf.name) + && Objects.equals(this.petType, childCatAllOf.petType); + } + + @Override + public int hashCode() { + return Objects.hash(name, petType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildCatAllOf {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `pet_type` to the URL query string + if (getPetType() != null) { + joiner.add( + String.format( + "%spet_type%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java index b0f7a754c332..8c660a13c9d9 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ClassModel.java @@ -3,148 +3,139 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Model for testing model with \"_class\" property - */ -@JsonPropertyOrder({ - ClassModel.JSON_PROPERTY_PROPERTY_CLASS -}) +/** Model for testing model with \"_class\" property */ +@JsonPropertyOrder({ClassModel.JSON_PROPERTY_PROPERTY_CLASS}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ClassModel { - public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; - private String propertyClass; + public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class"; + private String propertyClass; - public ClassModel() { - } + public ClassModel() {} - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPropertyClass() { - return propertyClass; - } - - - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - - /** - * Return true if this ClassModel object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ClassModel propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `_class` to the URL query string - if (getPropertyClass() != null) { - joiner.add(String.format("%s_class%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get propertyClass + * + * @return propertyClass + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { + return propertyClass; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + /** Return true if this ClassModel object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClassModel classModel = (ClassModel) o; + return Objects.equals(this.propertyClass, classModel.propertyClass); + } + + @Override + public int hashCode() { + return Objects.hash(propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClassModel {\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `_class` to the URL query string + if (getPropertyClass() != null) { + joiner.add( + String.format( + "%s_class%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getPropertyClass()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java index a6b6b93f0c85..cc15db685eac 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Client.java @@ -3,148 +3,137 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Client - */ -@JsonPropertyOrder({ - Client.JSON_PROPERTY_CLIENT -}) +/** Client */ +@JsonPropertyOrder({Client.JSON_PROPERTY_CLIENT}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Client { - public static final String JSON_PROPERTY_CLIENT = "client"; - private String client; + public static final String JSON_PROPERTY_CLIENT = "client"; + private String client; - public Client() { - } + public Client() {} - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CLIENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getClient() { - return client; - } - - - @JsonProperty(JSON_PROPERTY_CLIENT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setClient(String client) { - this.client = client; - } - - - /** - * Return true if this Client object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Client client(String client) { + this.client = client; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `client` to the URL query string - if (getClient() != null) { - joiner.add(String.format("%sclient%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClient()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get client + * + * @return client + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getClient() { + return client; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_CLIENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setClient(String client) { + this.client = client; + } + + /** Return true if this Client object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Client client = (Client) o; + return Objects.equals(this.client, client.client); + } + + @Override + public int hashCode() { + return Objects.hash(client); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Client {\n"); + sb.append(" client: ").append(toIndentedString(client)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `client` to the URL query string + if (getClient() != null) { + joiner.add( + String.format( + "%sclient%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getClient()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java index 7001485020c1..d3fb8195d0d4 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/ComplexQuadrilateral.java @@ -3,184 +3,184 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * ComplexQuadrilateral - */ +/** ComplexQuadrilateral */ @JsonPropertyOrder({ - ComplexQuadrilateral.JSON_PROPERTY_SHAPE_TYPE, - ComplexQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE + ComplexQuadrilateral.JSON_PROPERTY_SHAPE_TYPE, + ComplexQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ComplexQuadrilateral { - public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - private String shapeType; + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; - public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; - private String quadrilateralType; + public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + private String quadrilateralType; - public ComplexQuadrilateral() { - } + public ComplexQuadrilateral() {} - public ComplexQuadrilateral shapeType(String shapeType) { - this.shapeType = shapeType; - return this; - } - - /** - * Get shapeType - * @return shapeType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getShapeType() { - return shapeType; - } - - - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(String shapeType) { - this.shapeType = shapeType; - } - - - public ComplexQuadrilateral quadrilateralType(String quadrilateralType) { - this.quadrilateralType = quadrilateralType; - return this; - } - - /** - * Get quadrilateralType - * @return quadrilateralType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getQuadrilateralType() { - return quadrilateralType; - } - - - @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setQuadrilateralType(String quadrilateralType) { - this.quadrilateralType = quadrilateralType; - } - - - /** - * Return true if this ComplexQuadrilateral object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ComplexQuadrilateral complexQuadrilateral = (ComplexQuadrilateral) o; - return Objects.equals(this.shapeType, complexQuadrilateral.shapeType) && - Objects.equals(this.quadrilateralType, complexQuadrilateral.quadrilateralType); - } - - @Override - public int hashCode() { - return Objects.hash(shapeType, quadrilateralType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ComplexQuadrilateral {\n"); - sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); - sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ComplexQuadrilateral shapeType(String shapeType) { + this.shapeType = shapeType; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `shapeType` to the URL query string - if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get shapeType + * + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; } - // add `quadrilateralType` to the URL query string - if (getQuadrilateralType() != null) { - joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(String shapeType) { + this.shapeType = shapeType; } - return joiner.toString(); - } + public ComplexQuadrilateral quadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * + * @return quadrilateralType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuadrilateralType() { + return quadrilateralType; + } + + @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + /** Return true if this ComplexQuadrilateral object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ComplexQuadrilateral complexQuadrilateral = (ComplexQuadrilateral) o; + return Objects.equals(this.shapeType, complexQuadrilateral.shapeType) + && Objects.equals(this.quadrilateralType, complexQuadrilateral.quadrilateralType); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, quadrilateralType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ComplexQuadrilateral {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" quadrilateralType: ") + .append(toIndentedString(quadrilateralType)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add( + String.format( + "%sshapeType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getShapeType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `quadrilateralType` to the URL query string + if (getQuadrilateralType() != null) { + joiner.add( + String.format( + "%squadrilateralType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getQuadrilateralType()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DanishPig.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DanishPig.java index ff06d18c1dab..6cfaf9171314 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DanishPig.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DanishPig.java @@ -3,148 +3,138 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * DanishPig - */ -@JsonPropertyOrder({ - DanishPig.JSON_PROPERTY_CLASS_NAME -}) +/** DanishPig */ +@JsonPropertyOrder({DanishPig.JSON_PROPERTY_CLASS_NAME}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DanishPig { - public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; - public DanishPig() { - } + public DanishPig() {} - public DanishPig className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getClassName() { - return className; - } - - - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(String className) { - this.className = className; - } - - - /** - * Return true if this DanishPig object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DanishPig danishPig = (DanishPig) o; - return Objects.equals(this.className, danishPig.className); - } - - @Override - public int hashCode() { - return Objects.hash(className); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DanishPig {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public DanishPig className(String className) { + this.className = className; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `className` to the URL query string - if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get className + * + * @return className + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(String className) { + this.className = className; + } + + /** Return true if this DanishPig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DanishPig danishPig = (DanishPig) o; + return Objects.equals(this.className, danishPig.className); + } + + @Override + public int hashCode() { + return Objects.hash(className); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DanishPig {\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add( + String.format( + "%sclassName%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getClassName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DeprecatedObject.java index 54d427bcf974..0019eb1bef1b 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DeprecatedObject.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DeprecatedObject.java @@ -3,150 +3,142 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; - +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; /** * DeprecatedObject + * * @deprecated */ @Deprecated -@JsonPropertyOrder({ - DeprecatedObject.JSON_PROPERTY_NAME -}) +@JsonPropertyOrder({DeprecatedObject.JSON_PROPERTY_NAME}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DeprecatedObject { - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public DeprecatedObject() { - } + public DeprecatedObject() {} - public DeprecatedObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - /** - * Return true if this DeprecatedObject object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeprecatedObject deprecatedObject = (DeprecatedObject) o; - return Objects.equals(this.name, deprecatedObject.name); - } - - @Override - public int hashCode() { - return Objects.hash(name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DeprecatedObject {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public DeprecatedObject name(String name) { + this.name = name; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `name` to the URL query string - if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** Return true if this DeprecatedObject object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); + } + + @Override + public int hashCode() { + return Objects.hash(name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeprecatedObject {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java index e46cae8e00e5..a3cc6a54f58a 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Dog.java @@ -3,177 +3,183 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Animal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; import org.openapitools.client.JSON; -/** - * Dog - */ -@JsonPropertyOrder({ - Dog.JSON_PROPERTY_BREED -}) + +/** Dog */ +@JsonPropertyOrder({Dog.JSON_PROPERTY_BREED}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) - + value = "className", // ignore manually set className, it will be automatically generated by + // Jackson during serialization + allowSetters = true // allows the className to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "className", + visible = true) public class Dog extends Animal { - public static final String JSON_PROPERTY_BREED = "breed"; - private String breed; + public static final String JSON_PROPERTY_BREED = "breed"; + private String breed; - public Dog() { - } + public Dog() {} - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getBreed() { - return breed; - } - - - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBreed(String breed) { - this.breed = breed; - } - - - /** - * Return true if this Dog object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Dog breed(String breed) { + this.breed = breed; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `className` to the URL query string - if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get breed + * + * @return breed + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { + return breed; } - // add `color` to the URL query string - if (getColor() != null) { - joiner.add(String.format("%scolor%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreed(String breed) { + this.breed = breed; } - // add `breed` to the URL query string - if (getBreed() != null) { - joiner.add(String.format("%sbreed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBreed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** Return true if this Dog object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Dog dog = (Dog) o; + return Objects.equals(this.breed, dog.breed) && super.equals(o); } - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("Dog", Dog.class); - JSON.registerDiscriminator(Dog.class, "className", mappings); + @Override + public int hashCode() { + return Objects.hash(breed, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Dog {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add( + String.format( + "%sclassName%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getClassName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `color` to the URL query string + if (getColor() != null) { + joiner.add( + String.format( + "%scolor%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getColor()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `breed` to the URL query string + if (getBreed() != null) { + joiner.add( + String.format( + "%sbreed%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getBreed()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("Dog", Dog.class); + JSON.registerDiscriminator(Dog.class, "className", mappings); + } } -} - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java index 82d93902a71a..c96b192502dc 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/DogAllOf.java @@ -3,148 +3,137 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * DogAllOf - */ -@JsonPropertyOrder({ - DogAllOf.JSON_PROPERTY_BREED -}) +/** DogAllOf */ +@JsonPropertyOrder({DogAllOf.JSON_PROPERTY_BREED}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class DogAllOf { - public static final String JSON_PROPERTY_BREED = "breed"; - private String breed; + public static final String JSON_PROPERTY_BREED = "breed"; + private String breed; - public DogAllOf() { - } + public DogAllOf() {} - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getBreed() { - return breed; - } - - - @JsonProperty(JSON_PROPERTY_BREED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBreed(String breed) { - this.breed = breed; - } - - - /** - * Return true if this Dog_allOf object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public DogAllOf breed(String breed) { + this.breed = breed; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `breed` to the URL query string - if (getBreed() != null) { - joiner.add(String.format("%sbreed%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBreed()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get breed + * + * @return breed + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBreed() { + return breed; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_BREED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBreed(String breed) { + this.breed = breed; + } + + /** Return true if this Dog_allOf object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DogAllOf dogAllOf = (DogAllOf) o; + return Objects.equals(this.breed, dogAllOf.breed); + } + + @Override + public int hashCode() { + return Objects.hash(breed); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DogAllOf {\n"); + sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `breed` to the URL query string + if (getBreed() != null) { + joiner.add( + String.format( + "%sbreed%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getBreed()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java index 3b3908f19326..a0619a549e26 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/Drawing.java @@ -3,351 +3,350 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; -import org.openapitools.client.model.Fruit; -import org.openapitools.client.model.NullableShape; -import org.openapitools.client.model.Shape; -import org.openapitools.client.model.ShapeOrNull; +import java.util.Objects; +import java.util.StringJoiner; import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * Drawing - */ +/** Drawing */ @JsonPropertyOrder({ - Drawing.JSON_PROPERTY_MAIN_SHAPE, - Drawing.JSON_PROPERTY_SHAPE_OR_NULL, - Drawing.JSON_PROPERTY_NULLABLE_SHAPE, - Drawing.JSON_PROPERTY_SHAPES + Drawing.JSON_PROPERTY_MAIN_SHAPE, + Drawing.JSON_PROPERTY_SHAPE_OR_NULL, + Drawing.JSON_PROPERTY_NULLABLE_SHAPE, + Drawing.JSON_PROPERTY_SHAPES }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Drawing extends HashMap { - public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape"; - private Shape mainShape; + public static final String JSON_PROPERTY_MAIN_SHAPE = "mainShape"; + private Shape mainShape; - public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull"; - private ShapeOrNull shapeOrNull; + public static final String JSON_PROPERTY_SHAPE_OR_NULL = "shapeOrNull"; + private ShapeOrNull shapeOrNull; - public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape"; - private JsonNullable nullableShape = JsonNullable.undefined(); + public static final String JSON_PROPERTY_NULLABLE_SHAPE = "nullableShape"; + private JsonNullable nullableShape = JsonNullable.undefined(); - public static final String JSON_PROPERTY_SHAPES = "shapes"; - private List shapes = new ArrayList<>(); + public static final String JSON_PROPERTY_SHAPES = "shapes"; + private List shapes = new ArrayList<>(); - public Drawing() { - } + public Drawing() {} - public Drawing mainShape(Shape mainShape) { - this.mainShape = mainShape; - return this; - } + public Drawing mainShape(Shape mainShape) { + this.mainShape = mainShape; + return this; + } - /** - * Get mainShape - * @return mainShape - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MAIN_SHAPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Get mainShape + * + * @return mainShape + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAIN_SHAPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Shape getMainShape() { + return mainShape; + } - public Shape getMainShape() { - return mainShape; - } + @JsonProperty(JSON_PROPERTY_MAIN_SHAPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMainShape(Shape mainShape) { + this.mainShape = mainShape; + } + public Drawing shapeOrNull(ShapeOrNull shapeOrNull) { + this.shapeOrNull = shapeOrNull; + return this; + } - @JsonProperty(JSON_PROPERTY_MAIN_SHAPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMainShape(Shape mainShape) { - this.mainShape = mainShape; - } + /** + * Get shapeOrNull + * + * @return shapeOrNull + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ShapeOrNull getShapeOrNull() { + return shapeOrNull; + } + @JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShapeOrNull(ShapeOrNull shapeOrNull) { + this.shapeOrNull = shapeOrNull; + } - public Drawing shapeOrNull(ShapeOrNull shapeOrNull) { - this.shapeOrNull = shapeOrNull; - return this; - } + public Drawing nullableShape(NullableShape nullableShape) { + this.nullableShape = JsonNullable.of(nullableShape); + return this; + } - /** - * Get shapeOrNull - * @return shapeOrNull - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public ShapeOrNull getShapeOrNull() { - return shapeOrNull; - } - - - @JsonProperty(JSON_PROPERTY_SHAPE_OR_NULL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShapeOrNull(ShapeOrNull shapeOrNull) { - this.shapeOrNull = shapeOrNull; - } - - - public Drawing nullableShape(NullableShape nullableShape) { - this.nullableShape = JsonNullable.of(nullableShape); - return this; - } - - /** - * Get nullableShape - * @return nullableShape - **/ - @javax.annotation.Nullable - @JsonIgnore - - public NullableShape getNullableShape() { + /** + * Get nullableShape + * + * @return nullableShape + */ + @javax.annotation.Nullable + @JsonIgnore + public NullableShape getNullableShape() { return nullableShape.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_NULLABLE_SHAPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable getNullableShape_JsonNullable() { - return nullableShape; - } - - @JsonProperty(JSON_PROPERTY_NULLABLE_SHAPE) - public void setNullableShape_JsonNullable(JsonNullable nullableShape) { - this.nullableShape = nullableShape; - } - - public void setNullableShape(NullableShape nullableShape) { - this.nullableShape = JsonNullable.of(nullableShape); - } - - - public Drawing shapes(List shapes) { - this.shapes = shapes; - return this; - } - - public Drawing addShapesItem(Shape shapesItem) { - if (this.shapes == null) { - this.shapes = new ArrayList<>(); - } - this.shapes.add(shapesItem); - return this; - } - - /** - * Get shapes - * @return shapes - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SHAPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getShapes() { - return shapes; - } - - - @JsonProperty(JSON_PROPERTY_SHAPES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShapes(List shapes) { - this.shapes = shapes; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * @param key the name of the property - * @param value the value of the property - * @return self reference - */ - @JsonAnySetter - public Drawing putAdditionalProperty(String key, Fruit value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) properties. - * @return the additional (undeclared) properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * @param key the name of the property - * @return the additional (undeclared) property with the specified name - */ - public Fruit getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** - * Return true if this Drawing object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Drawing drawing = (Drawing) o; - return Objects.equals(this.mainShape, drawing.mainShape) && - Objects.equals(this.shapeOrNull, drawing.shapeOrNull) && - equalsNullable(this.nullableShape, drawing.nullableShape) && - Objects.equals(this.shapes, drawing.shapes)&& - Objects.equals(this.additionalProperties, drawing.additionalProperties) && - super.equals(o); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(mainShape, shapeOrNull, hashCodeNullable(nullableShape), shapes, super.hashCode(), additionalProperties); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Drawing {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" mainShape: ").append(toIndentedString(mainShape)).append("\n"); - sb.append(" shapeOrNull: ").append(toIndentedString(shapeOrNull)).append("\n"); - sb.append(" nullableShape: ").append(toIndentedString(nullableShape)).append("\n"); - sb.append(" shapes: ").append(toIndentedString(shapes)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; } - StringJoiner joiner = new StringJoiner("&"); - - // add `mainShape` to the URL query string - if (getMainShape() != null) { - joiner.add(getMainShape().toUrlQueryString(prefix + "mainShape" + suffix)); + @JsonProperty(JSON_PROPERTY_NULLABLE_SHAPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNullableShape_JsonNullable() { + return nullableShape; } - // add `shapeOrNull` to the URL query string - if (getShapeOrNull() != null) { - joiner.add(getShapeOrNull().toUrlQueryString(prefix + "shapeOrNull" + suffix)); + @JsonProperty(JSON_PROPERTY_NULLABLE_SHAPE) + public void setNullableShape_JsonNullable(JsonNullable nullableShape) { + this.nullableShape = nullableShape; } - // add `nullableShape` to the URL query string - if (getNullableShape() != null) { - joiner.add(getNullableShape().toUrlQueryString(prefix + "nullableShape" + suffix)); + public void setNullableShape(NullableShape nullableShape) { + this.nullableShape = JsonNullable.of(nullableShape); } - // add `shapes` to the URL query string - if (getShapes() != null) { - for (int i = 0; i < getShapes().size(); i++) { - if (getShapes().get(i) != null) { - joiner.add(getShapes().get(i).toUrlQueryString(String.format("%sshapes%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + public Drawing shapes(List shapes) { + this.shapes = shapes; + return this; + } + + public Drawing addShapesItem(Shape shapesItem) { + if (this.shapes == null) { + this.shapes = new ArrayList<>(); } - } + this.shapes.add(shapesItem); + return this; } - return joiner.toString(); - } -} + /** + * Get shapes + * + * @return shapes + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHAPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getShapes() { + return shapes; + } + @JsonProperty(JSON_PROPERTY_SHAPES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShapes(List shapes) { + this.shapes = shapes; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public Drawing putAdditionalProperty(String key, Fruit value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Fruit getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this Drawing object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Drawing drawing = (Drawing) o; + return Objects.equals(this.mainShape, drawing.mainShape) + && Objects.equals(this.shapeOrNull, drawing.shapeOrNull) + && equalsNullable(this.nullableShape, drawing.nullableShape) + && Objects.equals(this.shapes, drawing.shapes) + && Objects.equals(this.additionalProperties, drawing.additionalProperties) + && super.equals(o); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + mainShape, + shapeOrNull, + hashCodeNullable(nullableShape), + shapes, + super.hashCode(), + additionalProperties); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Drawing {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" mainShape: ").append(toIndentedString(mainShape)).append("\n"); + sb.append(" shapeOrNull: ").append(toIndentedString(shapeOrNull)).append("\n"); + sb.append(" nullableShape: ").append(toIndentedString(nullableShape)).append("\n"); + sb.append(" shapes: ").append(toIndentedString(shapes)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `mainShape` to the URL query string + if (getMainShape() != null) { + joiner.add(getMainShape().toUrlQueryString(prefix + "mainShape" + suffix)); + } + + // add `shapeOrNull` to the URL query string + if (getShapeOrNull() != null) { + joiner.add(getShapeOrNull().toUrlQueryString(prefix + "shapeOrNull" + suffix)); + } + + // add `nullableShape` to the URL query string + if (getNullableShape() != null) { + joiner.add(getNullableShape().toUrlQueryString(prefix + "nullableShape" + suffix)); + } + + // add `shapes` to the URL query string + if (getShapes() != null) { + for (int i = 0; i < getShapes().size(); i++) { + if (getShapes().get(i) != null) { + joiner.add( + getShapes() + .get(i) + .toUrlQueryString( + String.format( + "%sshapes%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", + containerPrefix, + i, + containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} 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 ddcc6e0f217d..e633850014bb 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 @@ -3,268 +3,263 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * EnumArrays - */ -@JsonPropertyOrder({ - EnumArrays.JSON_PROPERTY_JUST_SYMBOL, - EnumArrays.JSON_PROPERTY_ARRAY_ENUM -}) +/** EnumArrays */ +@JsonPropertyOrder({EnumArrays.JSON_PROPERTY_JUST_SYMBOL, EnumArrays.JSON_PROPERTY_ARRAY_ENUM}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumArrays { - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); + /** Gets or Sets justSymbol */ + public enum JustSymbolEnum { + GREATER_THAN_OR_EQUAL_TO(">="), - private String value; + DOLLAR("$"); - JustSymbolEnum(String value) { - this.value = value; + private String value; + + JustSymbolEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static JustSymbolEnum fromValue(String value) { + for (JustSymbolEnum b : JustSymbolEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; + private JustSymbolEnum justSymbol; + + /** Gets or Sets arrayEnum */ + public enum ArrayEnumEnum { + FISH("fish"), + + CRAB("crab"); + + private String value; + + ArrayEnumEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ArrayEnumEnum fromValue(String value) { + for (ArrayEnumEnum b : ArrayEnumEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } + + public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; + private List arrayEnum = new ArrayList<>(); + + public EnumArrays() {} + + public EnumArrays justSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + return this; + } + + /** + * Get justSymbol + * + * @return justSymbol + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JustSymbolEnum getJustSymbol() { + return justSymbol; + } + + @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustSymbol(JustSymbolEnum justSymbol) { + this.justSymbol = justSymbol; + } + + public EnumArrays arrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + return this; + } + + public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { + if (this.arrayEnum == null) { + this.arrayEnum = new ArrayList<>(); + } + this.arrayEnum.add(arrayEnumItem); + return this; + } + + /** + * Get arrayEnum + * + * @return arrayEnum + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayEnum() { + return arrayEnum; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayEnum(List arrayEnum) { + this.arrayEnum = arrayEnum; + } + + /** Return true if this EnumArrays object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(justSymbol, arrayEnum); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class EnumArrays {\n"); + sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); + sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol"; - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; + return o.toString().replace("\n", "\n "); } - @JsonValue - public String getValue() { - return value; + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + + StringJoiner joiner = new StringJoiner("&"); + + // add `just_symbol` to the URL query string + if (getJustSymbol() != null) { + joiner.add( + String.format( + "%sjust_symbol%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getJustSymbol()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `array_enum` to the URL query string + if (getArrayEnum() != null) { + for (int i = 0; i < getArrayEnum().size(); i++) { + joiner.add( + String.format( + "%sarray_enum%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getArrayEnum().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + return joiner.toString(); } - } - - public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum"; - private List arrayEnum = new ArrayList<>(); - - public EnumArrays() { - } - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - - @JsonProperty(JSON_PROPERTY_JUST_SYMBOL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getArrayEnum() { - return arrayEnum; - } - - - @JsonProperty(JSON_PROPERTY_ARRAY_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - - /** - * Return true if this EnumArrays object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; - } - - StringJoiner joiner = new StringJoiner("&"); - - // add `just_symbol` to the URL query string - if (getJustSymbol() != null) { - joiner.add(String.format("%sjust_symbol%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getJustSymbol()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } - - // add `array_enum` to the URL query string - if (getArrayEnum() != null) { - for (int i = 0; i < getArrayEnum().size(); i++) { - joiner.add(String.format("%sarray_enum%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayEnum().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } - } - - return joiner.toString(); - } } - 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 b897738ccfb0..2198fbf8f72a 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 @@ -3,79 +3,64 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Gets or Sets EnumClass - */ +/** Gets or Sets EnumClass */ public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); + _ABC("_abc"), - private String value; + _EFG("-efg"), - EnumClass(String value) { - this.value = value; - } + _XYZ_("(xyz)"); - @JsonValue - public String getValue() { - return value; - } + private String value; - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - if (prefix == null) { - prefix = ""; + EnumClass(String value) { + this.value = value; } - return String.format("%s=%s", prefix, this.toString()); - } + @JsonValue + public String getValue() { + return value; + } + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumClass fromValue(String value) { + for (EnumClass b : EnumClass.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } } - 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 26a51006015f..20e03b42f397 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 @@ -3,642 +3,692 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.OuterEnum; -import org.openapitools.client.model.OuterEnumDefaultValue; -import org.openapitools.client.model.OuterEnumInteger; -import org.openapitools.client.model.OuterEnumIntegerDefaultValue; -import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Objects; +import java.util.StringJoiner; +import org.openapitools.jackson.nullable.JsonNullable; - -/** - * EnumTest - */ +/** EnumTest */ @JsonPropertyOrder({ - EnumTest.JSON_PROPERTY_ENUM_STRING, - EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, - EnumTest.JSON_PROPERTY_ENUM_INTEGER, - EnumTest.JSON_PROPERTY_ENUM_INTEGER_ONLY, - EnumTest.JSON_PROPERTY_ENUM_NUMBER, - EnumTest.JSON_PROPERTY_OUTER_ENUM, - EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER, - EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, - EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE + EnumTest.JSON_PROPERTY_ENUM_STRING, + EnumTest.JSON_PROPERTY_ENUM_STRING_REQUIRED, + EnumTest.JSON_PROPERTY_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_ENUM_INTEGER_ONLY, + EnumTest.JSON_PROPERTY_ENUM_NUMBER, + EnumTest.JSON_PROPERTY_OUTER_ENUM, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER, + EnumTest.JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE, + EnumTest.JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EnumTest { - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); + /** Gets or Sets enumString */ + public enum EnumStringEnum { + UPPER("UPPER"), - private String value; + LOWER("lower"), - EnumStringEnum(String value) { - this.value = value; - } + EMPTY(""); - @JsonValue - public String getValue() { - return value; - } + private String value; - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; + EnumStringEnum(String value) { + this.value = value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; + @JsonValue + public String getValue() { + return value; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; + @Override + public String toString() { + return String.valueOf(value); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumIntegerOnly - */ - public enum EnumIntegerOnlyEnum { - NUMBER_2(2), - - NUMBER_MINUS_2(-2); - - private Integer value; - - EnumIntegerOnlyEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerOnlyEnum fromValue(Integer value) { - for (EnumIntegerOnlyEnum b : EnumIntegerOnlyEnum.values()) { - if (b.value.equals(value)) { - return b; + @JsonCreator + public static EnumStringEnum fromValue(String value) { + for (EnumStringEnum b : EnumStringEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_ENUM_INTEGER_ONLY = "enum_integer_only"; - private EnumIntegerOnlyEnum enumIntegerOnly; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; } - @JsonValue - public Double getValue() { - return value; - } + public static final String JSON_PROPERTY_ENUM_STRING = "enum_string"; + private EnumStringEnum enumString; - @Override - public String toString() { - return String.valueOf(value); - } + /** Gets or Sets enumStringRequired */ + public enum EnumStringRequiredEnum { + UPPER("UPPER"), - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; + LOWER("lower"), + + EMPTY(""); + + private String value; + + EnumStringRequiredEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static EnumStringRequiredEnum fromValue(String value) { + for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); } - } - public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; - private EnumNumberEnum enumNumber; + public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required"; + private EnumStringRequiredEnum enumStringRequired; - public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; - private JsonNullable outerEnum = JsonNullable.undefined(); + /** Gets or Sets enumInteger */ + public enum EnumIntegerEnum { + NUMBER_1(1), - public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; - private OuterEnumInteger outerEnumInteger; + NUMBER_MINUS_1(-1); - public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; - private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + private Integer value; - public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = "outerEnumIntegerDefaultValue"; - private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; + EnumIntegerEnum(Integer value) { + this.value = value; + } - public EnumTest() { - } + @JsonValue + public Integer getValue() { + return value; + } - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } + @Override + public String toString() { + return String.valueOf(value); + } - /** - * Get enumString - * @return enumString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonCreator + public static EnumIntegerEnum fromValue(Integer value) { + for (EnumIntegerEnum b : EnumIntegerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } - public EnumStringEnum getEnumString() { - return enumString; - } + public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer"; + private EnumIntegerEnum enumInteger; + /** Gets or Sets enumIntegerOnly */ + public enum EnumIntegerOnlyEnum { + NUMBER_2(2), - @JsonProperty(JSON_PROPERTY_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } + NUMBER_MINUS_2(-2); + private Integer value; - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } + EnumIntegerOnlyEnum(Integer value) { + this.value = value; + } - /** - * Get enumStringRequired - * @return enumStringRequired - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonValue + public Integer getValue() { + return value; + } - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } + @Override + public String toString() { + return String.valueOf(value); + } + @JsonCreator + public static EnumIntegerOnlyEnum fromValue(Integer value) { + for (EnumIntegerOnlyEnum b : EnumIntegerOnlyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } - @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } + public static final String JSON_PROPERTY_ENUM_INTEGER_ONLY = "enum_integer_only"; + private EnumIntegerOnlyEnum enumIntegerOnly; + /** Gets or Sets enumNumber */ + public enum EnumNumberEnum { + NUMBER_1_DOT_1(1.1), - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } + NUMBER_MINUS_1_DOT_2(-1.2); - /** - * Get enumInteger - * @return enumInteger - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + private Double value; - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } + EnumNumberEnum(Double value) { + this.value = value; + } + @JsonValue + public Double getValue() { + return value; + } - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } + @Override + public String toString() { + return String.valueOf(value); + } + @JsonCreator + public static EnumNumberEnum fromValue(Double value) { + for (EnumNumberEnum b : EnumNumberEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + } - public EnumTest enumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { - this.enumIntegerOnly = enumIntegerOnly; - return this; - } + public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number"; + private EnumNumberEnum enumNumber; - /** - * Get enumIntegerOnly - * @return enumIntegerOnly - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER_ONLY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum"; + private JsonNullable outerEnum = JsonNullable.undefined(); - public EnumIntegerOnlyEnum getEnumIntegerOnly() { - return enumIntegerOnly; - } + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER = "outerEnumInteger"; + private OuterEnumInteger outerEnumInteger; + public static final String JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE = "outerEnumDefaultValue"; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; - @JsonProperty(JSON_PROPERTY_ENUM_INTEGER_ONLY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { - this.enumIntegerOnly = enumIntegerOnly; - } + public static final String JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE = + "outerEnumIntegerDefaultValue"; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = + OuterEnumIntegerDefaultValue.NUMBER_0; + public EnumTest() {} - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } + public EnumTest enumString(EnumStringEnum enumString) { + this.enumString = enumString; + return this; + } - /** - * Get enumNumber - * @return enumNumber - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + /** + * Get enumString + * + * @return enumString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumStringEnum getEnumString() { + return enumString; + } - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } + @JsonProperty(JSON_PROPERTY_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumString(EnumStringEnum enumString) { + this.enumString = enumString; + } + public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + return this; + } - @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } + /** + * Get enumStringRequired + * + * @return enumStringRequired + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EnumStringRequiredEnum getEnumStringRequired() { + return enumStringRequired; + } + @JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { + this.enumStringRequired = enumStringRequired; + } - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = JsonNullable.of(outerEnum); - return this; - } + public EnumTest enumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + return this; + } - /** - * Get outerEnum - * @return outerEnum - **/ - @javax.annotation.Nullable - @JsonIgnore + /** + * Get enumInteger + * + * @return enumInteger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerEnum getEnumInteger() { + return enumInteger; + } - public OuterEnum getOuterEnum() { + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumInteger(EnumIntegerEnum enumInteger) { + this.enumInteger = enumInteger; + } + + public EnumTest enumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { + this.enumIntegerOnly = enumIntegerOnly; + return this; + } + + /** + * Get enumIntegerOnly + * + * @return enumIntegerOnly + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumIntegerOnlyEnum getEnumIntegerOnly() { + return enumIntegerOnly; + } + + @JsonProperty(JSON_PROPERTY_ENUM_INTEGER_ONLY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) { + this.enumIntegerOnly = enumIntegerOnly; + } + + public EnumTest enumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + return this; + } + + /** + * Get enumNumber + * + * @return enumNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public EnumNumberEnum getEnumNumber() { + return enumNumber; + } + + @JsonProperty(JSON_PROPERTY_ENUM_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEnumNumber(EnumNumberEnum enumNumber) { + this.enumNumber = enumNumber; + } + + public EnumTest outerEnum(OuterEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); + return this; + } + + /** + * Get outerEnum + * + * @return outerEnum + */ + @javax.annotation.Nullable + @JsonIgnore + public OuterEnum getOuterEnum() { return outerEnum.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable getOuterEnum_JsonNullable() { - return outerEnum; - } - - @JsonProperty(JSON_PROPERTY_OUTER_ENUM) - public void setOuterEnum_JsonNullable(JsonNullable outerEnum) { - this.outerEnum = outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = JsonNullable.of(outerEnum); - } - - - public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { - this.outerEnumInteger = outerEnumInteger; - return this; - } - - /** - * Get outerEnumInteger - * @return outerEnumInteger - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public OuterEnumInteger getOuterEnumInteger() { - return outerEnumInteger; - } - - - @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { - this.outerEnumInteger = outerEnumInteger; - } - - - public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { - this.outerEnumDefaultValue = outerEnumDefaultValue; - return this; - } - - /** - * Get outerEnumDefaultValue - * @return outerEnumDefaultValue - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public OuterEnumDefaultValue getOuterEnumDefaultValue() { - return outerEnumDefaultValue; - } - - - @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { - this.outerEnumDefaultValue = outerEnumDefaultValue; - } - - - public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { - this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; - return this; - } - - /** - * Get outerEnumIntegerDefaultValue - * @return outerEnumIntegerDefaultValue - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { - return outerEnumIntegerDefaultValue; - } - - - @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { - this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; - } - - - /** - * Return true if this Enum_Test object is equal to o. - */ - @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); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumIntegerOnly, enumNumber, hashCodeNullable(outerEnum), outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumIntegerOnly: ").append(toIndentedString(enumIntegerOnly)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); - sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); - sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; } - StringJoiner joiner = new StringJoiner("&"); - - // add `enum_string` to the URL query string - if (getEnumString() != null) { - joiner.add(String.format("%senum_string%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getOuterEnum_JsonNullable() { + return outerEnum; } - // add `enum_string_required` to the URL query string - if (getEnumStringRequired() != null) { - joiner.add(String.format("%senum_string_required%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumStringRequired()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_OUTER_ENUM) + public void setOuterEnum_JsonNullable(JsonNullable outerEnum) { + this.outerEnum = outerEnum; } - // add `enum_integer` to the URL query string - if (getEnumInteger() != null) { - joiner.add(String.format("%senum_integer%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public void setOuterEnum(OuterEnum outerEnum) { + this.outerEnum = JsonNullable.of(outerEnum); } - // add `enum_integer_only` to the URL query string - if (getEnumIntegerOnly() != null) { - joiner.add(String.format("%senum_integer_only%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumIntegerOnly()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; } - // add `enum_number` to the URL query string - if (getEnumNumber() != null) { - joiner.add(String.format("%senum_number%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEnumNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get outerEnumInteger + * + * @return outerEnumInteger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; } - // add `outerEnum` to the URL query string - if (getOuterEnum() != null) { - joiner.add(String.format("%souterEnum%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnum()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; } - // add `outerEnumInteger` to the URL query string - if (getOuterEnumInteger() != null) { - joiner.add(String.format("%souterEnumInteger%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnumInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; } - // add `outerEnumDefaultValue` to the URL query string - if (getOuterEnumDefaultValue() != null) { - joiner.add(String.format("%souterEnumDefaultValue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnumDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get outerEnumDefaultValue + * + * @return outerEnumDefaultValue + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; } - // add `outerEnumIntegerDefaultValue` to the URL query string - if (getOuterEnumIntegerDefaultValue() != null) { - joiner.add(String.format("%souterEnumIntegerDefaultValue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getOuterEnumIntegerDefaultValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; } - return joiner.toString(); - } + public EnumTest outerEnumIntegerDefaultValue( + OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + /** + * Get outerEnumIntegerDefaultValue + * + * @return outerEnumIntegerDefaultValue + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + @JsonProperty(JSON_PROPERTY_OUTER_ENUM_INTEGER_DEFAULT_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setOuterEnumIntegerDefaultValue( + OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + + /** Return true if this Enum_Test object is equal to o. */ + @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); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash( + enumString, + enumStringRequired, + enumInteger, + enumIntegerOnly, + enumNumber, + hashCodeNullable(outerEnum), + outerEnumInteger, + outerEnumDefaultValue, + outerEnumIntegerDefaultValue); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EnumTest {\n"); + sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); + sb.append(" enumStringRequired: ") + .append(toIndentedString(enumStringRequired)) + .append("\n"); + sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); + sb.append(" enumIntegerOnly: ").append(toIndentedString(enumIntegerOnly)).append("\n"); + sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); + sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); + sb.append(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ") + .append(toIndentedString(outerEnumDefaultValue)) + .append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ") + .append(toIndentedString(outerEnumIntegerDefaultValue)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `enum_string` to the URL query string + if (getEnumString() != null) { + joiner.add( + String.format( + "%senum_string%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getEnumString()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `enum_string_required` to the URL query string + if (getEnumStringRequired() != null) { + joiner.add( + String.format( + "%senum_string_required%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getEnumStringRequired()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `enum_integer` to the URL query string + if (getEnumInteger() != null) { + joiner.add( + String.format( + "%senum_integer%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getEnumInteger()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `enum_integer_only` to the URL query string + if (getEnumIntegerOnly() != null) { + joiner.add( + String.format( + "%senum_integer_only%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getEnumIntegerOnly()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `enum_number` to the URL query string + if (getEnumNumber() != null) { + joiner.add( + String.format( + "%senum_number%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getEnumNumber()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outerEnum` to the URL query string + if (getOuterEnum() != null) { + joiner.add( + String.format( + "%souterEnum%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOuterEnum()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outerEnumInteger` to the URL query string + if (getOuterEnumInteger() != null) { + joiner.add( + String.format( + "%souterEnumInteger%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOuterEnumInteger()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outerEnumDefaultValue` to the URL query string + if (getOuterEnumDefaultValue() != null) { + joiner.add( + String.format( + "%souterEnumDefaultValue%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOuterEnumDefaultValue()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `outerEnumIntegerDefaultValue` to the URL query string + if (getOuterEnumIntegerDefaultValue() != null) { + joiner.add( + String.format( + "%souterEnumIntegerDefaultValue%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getOuterEnumIntegerDefaultValue()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 d5e0b4fdce31..28b839d236a5 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 @@ -3,184 +3,182 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * EquilateralTriangle - */ +/** EquilateralTriangle */ @JsonPropertyOrder({ - EquilateralTriangle.JSON_PROPERTY_SHAPE_TYPE, - EquilateralTriangle.JSON_PROPERTY_TRIANGLE_TYPE + EquilateralTriangle.JSON_PROPERTY_SHAPE_TYPE, + EquilateralTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class EquilateralTriangle { - public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - private String shapeType; + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; - public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; - private String triangleType; + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + private String triangleType; - public EquilateralTriangle() { - } + public EquilateralTriangle() {} - public EquilateralTriangle shapeType(String shapeType) { - this.shapeType = shapeType; - return this; - } - - /** - * Get shapeType - * @return shapeType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getShapeType() { - return shapeType; - } - - - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(String shapeType) { - this.shapeType = shapeType; - } - - - public EquilateralTriangle triangleType(String triangleType) { - this.triangleType = triangleType; - return this; - } - - /** - * Get triangleType - * @return triangleType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getTriangleType() { - return triangleType; - } - - - @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriangleType(String triangleType) { - this.triangleType = triangleType; - } - - - /** - * Return true if this EquilateralTriangle object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(shapeType, triangleType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EquilateralTriangle {\n"); - sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); - sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public EquilateralTriangle shapeType(String shapeType) { + this.shapeType = shapeType; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `shapeType` to the URL query string - if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get shapeType + * + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; } - // add `triangleType` to the URL query string - if (getTriangleType() != null) { - joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(String shapeType) { + this.shapeType = shapeType; } - return joiner.toString(); - } + public EquilateralTriangle triangleType(String triangleType) { + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * + * @return triangleType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriangleType() { + return triangleType; + } + + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + /** Return true if this EquilateralTriangle object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, triangleType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EquilateralTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add( + String.format( + "%sshapeType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getShapeType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `triangleType` to the URL query string + if (getTriangleType() != null) { + joiner.add( + String.format( + "%striangleType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getTriangleType()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 fb6ea0715801..9c665bc41203 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 @@ -3,200 +3,193 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.ArrayList; import java.util.List; -import org.openapitools.client.model.ModelFile; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * FileSchemaTestClass - */ +/** FileSchemaTestClass */ @JsonPropertyOrder({ - FileSchemaTestClass.JSON_PROPERTY_FILE, - FileSchemaTestClass.JSON_PROPERTY_FILES + FileSchemaTestClass.JSON_PROPERTY_FILE, + FileSchemaTestClass.JSON_PROPERTY_FILES }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FileSchemaTestClass { - public static final String JSON_PROPERTY_FILE = "file"; - private ModelFile _file; + public static final String JSON_PROPERTY_FILE = "file"; + private ModelFile _file; - public static final String JSON_PROPERTY_FILES = "files"; - private List files = new ArrayList<>(); + public static final String JSON_PROPERTY_FILES = "files"; + private List files = new ArrayList<>(); - public FileSchemaTestClass() { - } + public FileSchemaTestClass() {} - public FileSchemaTestClass _file(ModelFile _file) { - this._file = _file; - return this; - } - - /** - * Get _file - * @return _file - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public ModelFile getFile() { - return _file; - } - - - @JsonProperty(JSON_PROPERTY_FILE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFile(ModelFile _file) { - this._file = _file; - } - - - public FileSchemaTestClass files(List files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(ModelFile filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getFiles() { - return files; - } - - - @JsonProperty(JSON_PROPERTY_FILES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFiles(List files) { - this.files = files; - } - - - /** - * Return true if this FileSchemaTestClass object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(_file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public FileSchemaTestClass _file(ModelFile _file) { + this._file = _file; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `file` to the URL query string - if (getFile() != null) { - joiner.add(getFile().toUrlQueryString(prefix + "file" + suffix)); + /** + * Get _file + * + * @return _file + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public ModelFile getFile() { + return _file; } - // add `files` to the URL query string - if (getFiles() != null) { - for (int i = 0; i < getFiles().size(); i++) { - if (getFiles().get(i) != null) { - joiner.add(getFiles().get(i).toUrlQueryString(String.format("%sfiles%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + @JsonProperty(JSON_PROPERTY_FILE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFile(ModelFile _file) { + this._file = _file; + } + + public FileSchemaTestClass files(List files) { + this.files = files; + return this; + } + + public FileSchemaTestClass addFilesItem(ModelFile filesItem) { + if (this.files == null) { + this.files = new ArrayList<>(); } - } + this.files.add(filesItem); + return this; } - return joiner.toString(); - } -} + /** + * Get files + * + * @return files + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getFiles() { + return files; + } + @JsonProperty(JSON_PROPERTY_FILES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFiles(List files) { + this.files = files; + } + + /** Return true if this FileSchemaTestClass object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(_file, files); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FileSchemaTestClass {\n"); + sb.append(" _file: ").append(toIndentedString(_file)).append("\n"); + sb.append(" files: ").append(toIndentedString(files)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `file` to the URL query string + if (getFile() != null) { + joiner.add(getFile().toUrlQueryString(prefix + "file" + suffix)); + } + + // add `files` to the URL query string + if (getFiles() != null) { + for (int i = 0; i < getFiles().size(); i++) { + if (getFiles().get(i) != null) { + joiner.add( + getFiles() + .get(i) + .toUrlQueryString( + String.format( + "%sfiles%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", + containerPrefix, + i, + containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} 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 1d4de25f3178..aea93811a5bc 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 @@ -3,148 +3,137 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Foo - */ -@JsonPropertyOrder({ - Foo.JSON_PROPERTY_BAR -}) +/** Foo */ +@JsonPropertyOrder({Foo.JSON_PROPERTY_BAR}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Foo { - public static final String JSON_PROPERTY_BAR = "bar"; - private String bar = "bar"; + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar = "bar"; - public Foo() { - } + public Foo() {} - public Foo bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BAR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getBar() { - return bar; - } - - - @JsonProperty(JSON_PROPERTY_BAR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBar(String bar) { - this.bar = bar; - } - - - /** - * Return true if this Foo object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(bar); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Foo {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Foo bar(String bar) { + this.bar = bar; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `bar` to the URL query string - if (getBar() != null) { - joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get bar + * + * @return bar + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBar(String bar) { + this.bar = bar; + } + + /** Return true if this Foo object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(bar); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Foo {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bar` to the URL query string + if (getBar() != null) { + joiner.add( + String.format( + "%sbar%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 e978aaf2ee2f..b6a5b6dc238c 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 @@ -3,149 +3,129 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Foo; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * FooGetDefaultResponse - */ -@JsonPropertyOrder({ - FooGetDefaultResponse.JSON_PROPERTY_STRING -}) +/** FooGetDefaultResponse */ +@JsonPropertyOrder({FooGetDefaultResponse.JSON_PROPERTY_STRING}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FooGetDefaultResponse { - public static final String JSON_PROPERTY_STRING = "string"; - private Foo string; + public static final String JSON_PROPERTY_STRING = "string"; + private Foo string; - public FooGetDefaultResponse() { - } + public FooGetDefaultResponse() {} - public FooGetDefaultResponse string(Foo string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Foo getString() { - return string; - } - - - @JsonProperty(JSON_PROPERTY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setString(Foo string) { - this.string = string; - } - - - /** - * Return true if this _foo_get_default_response object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(string); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FooGetDefaultResponse {\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `string` to the URL query string - if (getString() != null) { - joiner.add(getString().toUrlQueryString(prefix + "string" + suffix)); + /** + * Get string + * + * @return string + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Foo getString() { + return string; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(Foo string) { + this.string = string; + } + + /** Return true if this _foo_get_default_response object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `string` to the URL query string + if (getString() != null) { + joiner.add(getString().toUrlQueryString(prefix + "string" + suffix)); + } + + return joiner.toString(); + } } - 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 478fbb634c59..6b56e9e3adf0 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 @@ -3,703 +3,773 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.io.File; import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.Objects; +import java.util.StringJoiner; import java.util.UUID; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * FormatTest - */ +/** FormatTest */ @JsonPropertyOrder({ - FormatTest.JSON_PROPERTY_INTEGER, - FormatTest.JSON_PROPERTY_INT32, - FormatTest.JSON_PROPERTY_INT64, - FormatTest.JSON_PROPERTY_NUMBER, - FormatTest.JSON_PROPERTY_FLOAT, - FormatTest.JSON_PROPERTY_DOUBLE, - FormatTest.JSON_PROPERTY_DECIMAL, - FormatTest.JSON_PROPERTY_STRING, - FormatTest.JSON_PROPERTY_BYTE, - FormatTest.JSON_PROPERTY_BINARY, - FormatTest.JSON_PROPERTY_DATE, - FormatTest.JSON_PROPERTY_DATE_TIME, - FormatTest.JSON_PROPERTY_UUID, - FormatTest.JSON_PROPERTY_PASSWORD, - FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, - FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER + FormatTest.JSON_PROPERTY_INTEGER, + FormatTest.JSON_PROPERTY_INT32, + FormatTest.JSON_PROPERTY_INT64, + FormatTest.JSON_PROPERTY_NUMBER, + FormatTest.JSON_PROPERTY_FLOAT, + FormatTest.JSON_PROPERTY_DOUBLE, + FormatTest.JSON_PROPERTY_DECIMAL, + FormatTest.JSON_PROPERTY_STRING, + FormatTest.JSON_PROPERTY_BYTE, + FormatTest.JSON_PROPERTY_BINARY, + FormatTest.JSON_PROPERTY_DATE, + FormatTest.JSON_PROPERTY_DATE_TIME, + FormatTest.JSON_PROPERTY_UUID, + FormatTest.JSON_PROPERTY_PASSWORD, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS, + FormatTest.JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class FormatTest { - public static final String JSON_PROPERTY_INTEGER = "integer"; - private Integer integer; + public static final String JSON_PROPERTY_INTEGER = "integer"; + private Integer integer; - public static final String JSON_PROPERTY_INT32 = "int32"; - private Integer int32; + public static final String JSON_PROPERTY_INT32 = "int32"; + private Integer int32; - public static final String JSON_PROPERTY_INT64 = "int64"; - private Long int64; + public static final String JSON_PROPERTY_INT64 = "int64"; + private Long int64; - public static final String JSON_PROPERTY_NUMBER = "number"; - private BigDecimal number; + public static final String JSON_PROPERTY_NUMBER = "number"; + private BigDecimal number; - public static final String JSON_PROPERTY_FLOAT = "float"; - private Float _float; + public static final String JSON_PROPERTY_FLOAT = "float"; + private Float _float; - public static final String JSON_PROPERTY_DOUBLE = "double"; - private Double _double; + public static final String JSON_PROPERTY_DOUBLE = "double"; + private Double _double; - public static final String JSON_PROPERTY_DECIMAL = "decimal"; - private BigDecimal decimal; + public static final String JSON_PROPERTY_DECIMAL = "decimal"; + private BigDecimal decimal; - public static final String JSON_PROPERTY_STRING = "string"; - private String string; + public static final String JSON_PROPERTY_STRING = "string"; + private String string; - public static final String JSON_PROPERTY_BYTE = "byte"; - private byte[] _byte; + public static final String JSON_PROPERTY_BYTE = "byte"; + private byte[] _byte; - public static final String JSON_PROPERTY_BINARY = "binary"; - private File binary; + public static final String JSON_PROPERTY_BINARY = "binary"; + private File binary; - public static final String JSON_PROPERTY_DATE = "date"; - private LocalDate date; + public static final String JSON_PROPERTY_DATE = "date"; + private LocalDate date; - public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - private OffsetDateTime dateTime; + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; - public static final String JSON_PROPERTY_UUID = "uuid"; - private UUID uuid; + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; - public static final String JSON_PROPERTY_PASSWORD = "password"; - private String password; + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; - public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; - private String patternWithDigits; + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS = "pattern_with_digits"; + private String patternWithDigits; - public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = "pattern_with_digits_and_delimiter"; - private String patternWithDigitsAndDelimiter; + public static final String JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER = + "pattern_with_digits_and_delimiter"; + private String patternWithDigitsAndDelimiter; - public FormatTest() { - } + public FormatTest() {} - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getInteger() { - return integer; - } - - - @JsonProperty(JSON_PROPERTY_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInteger(Integer integer) { - this.integer = integer; - } - - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INT32) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getInt32() { - return int32; - } - - - @JsonProperty(JSON_PROPERTY_INT32) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInt32(Integer int32) { - this.int32 = int32; - } - - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INT64) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Long getInt64() { - return int64; - } - - - @JsonProperty(JSON_PROPERTY_INT64) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setInt64(Long int64) { - this.int64 = int64; - } - - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public BigDecimal getNumber() { - return number; - } - - - @JsonProperty(JSON_PROPERTY_NUMBER) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumber(BigDecimal number) { - this.number = number; - } - - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FLOAT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Float getFloat() { - return _float; - } - - - @JsonProperty(JSON_PROPERTY_FLOAT) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFloat(Float _float) { - this._float = _float; - } - - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DOUBLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Double getDouble() { - return _double; - } - - - @JsonProperty(JSON_PROPERTY_DOUBLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDouble(Double _double) { - this._double = _double; - } - - - public FormatTest decimal(BigDecimal decimal) { - this.decimal = decimal; - return this; - } - - /** - * Get decimal - * @return decimal - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DECIMAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getDecimal() { - return decimal; - } - - - @JsonProperty(JSON_PROPERTY_DECIMAL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDecimal(BigDecimal decimal) { - this.decimal = decimal; - } - - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getString() { - return string; - } - - - @JsonProperty(JSON_PROPERTY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setString(String string) { - this.string = string; - } - - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_BYTE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public byte[] getByte() { - return _byte; - } - - - @JsonProperty(JSON_PROPERTY_BYTE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - - public FormatTest binary(File binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BINARY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public File getBinary() { - return binary; - } - - - @JsonProperty(JSON_PROPERTY_BINARY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBinary(File binary) { - this.binary = binary; - } - - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public LocalDate getDate() { - return date; - } - - - @JsonProperty(JSON_PROPERTY_DATE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setDate(LocalDate date) { - this.date = date; - } - - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public OffsetDateTime getDateTime() { - return dateTime; - } - - - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public UUID getUuid() { - return uuid; - } - - - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getPassword() { - return password; - } - - - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPassword(String password) { - this.password = password; - } - - - public FormatTest patternWithDigits(String patternWithDigits) { - this.patternWithDigits = patternWithDigits; - return this; - } - - /** - * A string that is a 10 digit number. Can have leading zeros. - * @return patternWithDigits - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPatternWithDigits() { - return patternWithDigits; - } - - - @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPatternWithDigits(String patternWithDigits) { - this.patternWithDigits = patternWithDigits; - } - - - public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { - this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; - return this; - } - - /** - * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - * @return patternWithDigitsAndDelimiter - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPatternWithDigitsAndDelimiter() { - return patternWithDigitsAndDelimiter; - } - - - @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { - this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; - } - - - /** - * Return true if this format_test object is equal to o. - */ - @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); - } - - @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); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); - sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public FormatTest integer(Integer integer) { + this.integer = integer; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `integer` to the URL query string - if (getInteger() != null) { - joiner.add(String.format("%sinteger%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInteger()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get integer minimum: 10 maximum: 100 + * + * @return integer + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInteger() { + return integer; } - // add `int32` to the URL query string - if (getInt32() != null) { - joiner.add(String.format("%sint32%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInt32()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInteger(Integer integer) { + this.integer = integer; } - // add `int64` to the URL query string - if (getInt64() != null) { - joiner.add(String.format("%sint64%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getInt64()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public FormatTest int32(Integer int32) { + this.int32 = int32; + return this; } - // add `number` to the URL query string - if (getNumber() != null) { - joiner.add(String.format("%snumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get int32 minimum: 20 maximum: 200 + * + * @return int32 + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getInt32() { + return int32; } - // add `float` to the URL query string - if (getFloat() != null) { - joiner.add(String.format("%sfloat%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFloat()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_INT32) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt32(Integer int32) { + this.int32 = int32; } - // add `double` to the URL query string - if (getDouble() != null) { - joiner.add(String.format("%sdouble%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDouble()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public FormatTest int64(Long int64) { + this.int64 = int64; + return this; } - // add `decimal` to the URL query string - if (getDecimal() != null) { - joiner.add(String.format("%sdecimal%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDecimal()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get int64 + * + * @return int64 + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getInt64() { + return int64; } - // add `string` to the URL query string - if (getString() != null) { - joiner.add(String.format("%sstring%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_INT64) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInt64(Long int64) { + this.int64 = int64; } - // add `byte` to the URL query string - if (getByte() != null) { - joiner.add(String.format("%sbyte%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getByte()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public FormatTest number(BigDecimal number) { + this.number = number; + return this; } - // add `binary` to the URL query string - if (getBinary() != null) { - joiner.add(String.format("%sbinary%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBinary()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get number minimum: 32.1 maximum: 543.2 + * + * @return number + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumber() { + return number; } - // add `date` to the URL query string - if (getDate() != null) { - joiner.add(String.format("%sdate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_NUMBER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumber(BigDecimal number) { + this.number = number; } - // add `dateTime` to the URL query string - if (getDateTime() != null) { - joiner.add(String.format("%sdateTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public FormatTest _float(Float _float) { + this._float = _float; + return this; } - // add `uuid` to the URL query string - if (getUuid() != null) { - joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get _float minimum: 54.3 maximum: 987.6 + * + * @return _float + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Float getFloat() { + return _float; } - // add `password` to the URL query string - if (getPassword() != null) { - joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_FLOAT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFloat(Float _float) { + this._float = _float; } - // add `pattern_with_digits` to the URL query string - if (getPatternWithDigits() != null) { - joiner.add(String.format("%spattern_with_digits%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPatternWithDigits()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public FormatTest _double(Double _double) { + this._double = _double; + return this; } - // add `pattern_with_digits_and_delimiter` to the URL query string - if (getPatternWithDigitsAndDelimiter() != null) { - joiner.add(String.format("%spattern_with_digits_and_delimiter%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPatternWithDigitsAndDelimiter()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get _double minimum: 67.8 maximum: 123.4 + * + * @return _double + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getDouble() { + return _double; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_DOUBLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDouble(Double _double) { + this._double = _double; + } + + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + /** + * Get decimal + * + * @return decimal + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getDecimal() { + return decimal; + } + + @JsonProperty(JSON_PROPERTY_DECIMAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + + public FormatTest string(String string) { + this.string = string; + return this; + } + + /** + * Get string + * + * @return string + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getString() { + return string; + } + + @JsonProperty(JSON_PROPERTY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setString(String string) { + this.string = string; + } + + public FormatTest _byte(byte[] _byte) { + this._byte = _byte; + return this; + } + + /** + * Get _byte + * + * @return _byte + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public byte[] getByte() { + return _byte; + } + + @JsonProperty(JSON_PROPERTY_BYTE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setByte(byte[] _byte) { + this._byte = _byte; + } + + public FormatTest binary(File binary) { + this.binary = binary; + return this; + } + + /** + * Get binary + * + * @return binary + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public File getBinary() { + return binary; + } + + @JsonProperty(JSON_PROPERTY_BINARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBinary(File binary) { + this.binary = binary; + } + + public FormatTest date(LocalDate date) { + this.date = date; + return this; + } + + /** + * Get date + * + * @return date + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public LocalDate getDate() { + return date; + } + + @JsonProperty(JSON_PROPERTY_DATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setDate(LocalDate date) { + this.date = date; + } + + public FormatTest dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * + * @return dateTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { + return dateTime; + } + + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public FormatTest uuid(UUID uuid) { + this.uuid = uuid; + return this; + } + + /** + * Get uuid + * + * @return uuid + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { + return uuid; + } + + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; + } + + public FormatTest password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * + * @return password + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPassword(String password) { + this.password = password; + } + + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + return this; + } + + /** + * A string that is a 10 digit number. Can have leading zeros. + * + * @return patternWithDigits + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPatternWithDigits() { + return patternWithDigits; + } + + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; + } + + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + /** + * A string starting with 'image_' (case insensitive) and one to three digits following + * i.e. Image_01. + * + * @return patternWithDigitsAndDelimiter + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + @JsonProperty(JSON_PROPERTY_PATTERN_WITH_DIGITS_AND_DELIMITER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + } + + /** Return true if this format_test object is equal to o. */ + @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); + } + + @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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FormatTest {\n"); + sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); + sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); + sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); + sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); + sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n"); + sb.append(" string: ").append(toIndentedString(string)).append("\n"); + sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); + sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" patternWithDigits: ") + .append(toIndentedString(patternWithDigits)) + .append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ") + .append(toIndentedString(patternWithDigitsAndDelimiter)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `integer` to the URL query string + if (getInteger() != null) { + joiner.add( + String.format( + "%sinteger%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getInteger()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `int32` to the URL query string + if (getInt32() != null) { + joiner.add( + String.format( + "%sint32%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getInt32()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `int64` to the URL query string + if (getInt64() != null) { + joiner.add( + String.format( + "%sint64%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getInt64()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `number` to the URL query string + if (getNumber() != null) { + joiner.add( + String.format( + "%snumber%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getNumber()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `float` to the URL query string + if (getFloat() != null) { + joiner.add( + String.format( + "%sfloat%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getFloat()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `double` to the URL query string + if (getDouble() != null) { + joiner.add( + String.format( + "%sdouble%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getDouble()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `decimal` to the URL query string + if (getDecimal() != null) { + joiner.add( + String.format( + "%sdecimal%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getDecimal()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `string` to the URL query string + if (getString() != null) { + joiner.add( + String.format( + "%sstring%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getString()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `byte` to the URL query string + if (getByte() != null) { + joiner.add( + String.format( + "%sbyte%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getByte()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `binary` to the URL query string + if (getBinary() != null) { + joiner.add( + String.format( + "%sbinary%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getBinary()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `date` to the URL query string + if (getDate() != null) { + joiner.add( + String.format( + "%sdate%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getDate()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `dateTime` to the URL query string + if (getDateTime() != null) { + joiner.add( + String.format( + "%sdateTime%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getDateTime()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `uuid` to the URL query string + if (getUuid() != null) { + joiner.add( + String.format( + "%suuid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add( + String.format( + "%spassword%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getPassword()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `pattern_with_digits` to the URL query string + if (getPatternWithDigits() != null) { + joiner.add( + String.format( + "%spattern_with_digits%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getPatternWithDigits()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `pattern_with_digits_and_delimiter` to the URL query string + if (getPatternWithDigitsAndDelimiter() != null) { + joiner.add( + String.format( + "%spattern_with_digits_and_delimiter%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getPatternWithDigitsAndDelimiter()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 29d345c4345f..cbd31187dee0 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 @@ -3,41 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.openapitools.client.model.Apple; -import org.openapitools.client.model.Banana; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import com.fasterxml.jackson.core.type.TypeReference; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -52,6 +26,14 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -70,7 +52,8 @@ public class Fruit extends AbstractOpenApiSchema { } @Override - public void serialize(Fruit value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize(Fruit value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { jgen.writeObject(value.getActualInstance()); } } @@ -85,7 +68,8 @@ public class Fruit extends AbstractOpenApiSchema { } @Override - public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public Fruit deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); @@ -95,13 +79,29 @@ public class Fruit extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Apple.class.equals(Integer.class) || Apple.class.equals(Long.class) || Apple.class.equals(Float.class) || Apple.class.equals(Double.class) || Apple.class.equals(Boolean.class) || Apple.class.equals(String.class)) { + if (Apple.class.equals(Integer.class) + || Apple.class.equals(Long.class) + || Apple.class.equals(Float.class) + || Apple.class.equals(Double.class) + || Apple.class.equals(Boolean.class) + || Apple.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Apple.class.equals(Integer.class) || Apple.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Apple.class.equals(Float.class) || Apple.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Apple.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Apple.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Apple.class.equals(Integer.class) + || Apple.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Apple.class.equals(Float.class) + || Apple.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Apple.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Apple.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -121,13 +121,29 @@ public class Fruit extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Banana.class.equals(Integer.class) || Banana.class.equals(Long.class) || Banana.class.equals(Float.class) || Banana.class.equals(Double.class) || Banana.class.equals(Boolean.class) || Banana.class.equals(String.class)) { + if (Banana.class.equals(Integer.class) + || Banana.class.equals(Long.class) + || Banana.class.equals(Float.class) + || Banana.class.equals(Double.class) + || Banana.class.equals(Boolean.class) + || Banana.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Banana.class.equals(Integer.class) || Banana.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Banana.class.equals(Float.class) || Banana.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Banana.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Banana.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Banana.class.equals(Integer.class) + || Banana.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Banana.class.equals(Float.class) + || Banana.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Banana.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Banana.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -148,12 +164,13 @@ public class Fruit extends AbstractOpenApiSchema { ret.setActualInstance(deserialized); return ret; } - throw new IOException(String.format("Failed deserialization for Fruit: %d classes match result, expected 1", match)); + throw new IOException( + String.format( + "Failed deserialization for Fruit: %d classes match result, expected 1", + match)); } - /** - * Handle deserialization of the 'null' value. - */ + /** Handle deserialization of the 'null' value. */ @Override public Fruit getNullValue(DeserializationContext ctxt) throws JsonMappingException { throw new JsonMappingException(ctxt.getParser(), "Fruit cannot be null"); @@ -189,12 +206,11 @@ public class Fruit extends AbstractOpenApiSchema { } /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * Apple, Banana + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Apple, Banana * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be + * a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { @@ -212,8 +228,7 @@ public class Fruit extends AbstractOpenApiSchema { } /** - * Get the actual instance, which can be the following: - * Apple, Banana + * Get the actual instance, which can be the following: Apple, Banana * * @return The actual instance (Apple, Banana) */ @@ -223,75 +238,75 @@ public class Fruit extends AbstractOpenApiSchema { } /** - * Get the actual instance of `Apple`. If the actual instance is not `Apple`, - * the ClassCastException will be thrown. + * Get the actual instance of `Apple`. If the actual instance is not `Apple`, the + * ClassCastException will be thrown. * * @return The actual instance of `Apple` * @throws ClassCastException if the instance is not `Apple` */ public Apple getApple() throws ClassCastException { - return (Apple)super.getActualInstance(); + return (Apple) super.getActualInstance(); } /** - * Get the actual instance of `Banana`. If the actual instance is not `Banana`, - * the ClassCastException will be thrown. + * Get the actual instance of `Banana`. If the actual instance is not `Banana`, the + * ClassCastException will be thrown. * * @return The actual instance of `Banana` * @throws ClassCastException if the instance is not `Banana` */ public Banana getBanana() throws ClassCastException { - return (Banana)super.getActualInstance(); + return (Banana) super.getActualInstance(); } - - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - StringJoiner joiner = new StringJoiner("&"); - - if (getActualInstance() instanceof Apple) { - if (getActualInstance() != null) { - joiner.add(((Apple)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - return joiner.toString(); - } - if (getActualInstance() instanceof Banana) { - if (getActualInstance() != null) { - joiner.add(((Banana)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); - } - return joiner.toString(); - } - return null; - } + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Apple) { + if (getActualInstance() != null) { + joiner.add( + ((Apple) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Banana) { + if (getActualInstance() != null) { + joiner.add( + ((Banana) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } } - 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 39bd83cf9f24..6cefdccc9160 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 @@ -3,41 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.openapitools.client.model.AppleReq; -import org.openapitools.client.model.BananaReq; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import com.fasterxml.jackson.core.type.TypeReference; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -52,6 +26,14 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -70,7 +52,8 @@ public class FruitReq extends AbstractOpenApiSchema { } @Override - public void serialize(FruitReq value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize(FruitReq value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { jgen.writeObject(value.getActualInstance()); } } @@ -85,7 +68,8 @@ public class FruitReq extends AbstractOpenApiSchema { } @Override - public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public FruitReq deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); @@ -95,13 +79,29 @@ public class FruitReq extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class) || AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class) || AppleReq.class.equals(Boolean.class) || AppleReq.class.equals(String.class)) { + if (AppleReq.class.equals(Integer.class) + || AppleReq.class.equals(Long.class) + || AppleReq.class.equals(Float.class) + || AppleReq.class.equals(Double.class) + || AppleReq.class.equals(Boolean.class) + || AppleReq.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((AppleReq.class.equals(Integer.class) || AppleReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((AppleReq.class.equals(Float.class) || AppleReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (AppleReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (AppleReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((AppleReq.class.equals(Integer.class) + || AppleReq.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((AppleReq.class.equals(Float.class) + || AppleReq.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (AppleReq.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (AppleReq.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -121,13 +121,29 @@ public class FruitReq extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class) || BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class) || BananaReq.class.equals(Boolean.class) || BananaReq.class.equals(String.class)) { + if (BananaReq.class.equals(Integer.class) + || BananaReq.class.equals(Long.class) + || BananaReq.class.equals(Float.class) + || BananaReq.class.equals(Double.class) + || BananaReq.class.equals(Boolean.class) + || BananaReq.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((BananaReq.class.equals(Integer.class) || BananaReq.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((BananaReq.class.equals(Float.class) || BananaReq.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (BananaReq.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (BananaReq.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((BananaReq.class.equals(Integer.class) + || BananaReq.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((BananaReq.class.equals(Float.class) + || BananaReq.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (BananaReq.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (BananaReq.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -148,12 +164,14 @@ public class FruitReq extends AbstractOpenApiSchema { ret.setActualInstance(deserialized); return ret; } - throw new IOException(String.format("Failed deserialization for FruitReq: %d classes match result, expected 1", match)); + throw new IOException( + String.format( + "Failed deserialization for FruitReq: %d classes match result," + + " expected 1", + match)); } - /** - * Handle deserialization of the 'null' value. - */ + /** Handle deserialization of the 'null' value. */ @Override public FruitReq getNullValue(DeserializationContext ctxt) throws JsonMappingException { throw new JsonMappingException(ctxt.getParser(), "FruitReq cannot be null"); @@ -189,12 +207,11 @@ public class FruitReq extends AbstractOpenApiSchema { } /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * AppleReq, BananaReq + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: AppleReq, BananaReq * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be + * a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { @@ -212,8 +229,7 @@ public class FruitReq extends AbstractOpenApiSchema { } /** - * Get the actual instance, which can be the following: - * AppleReq, BananaReq + * Get the actual instance, which can be the following: AppleReq, BananaReq * * @return The actual instance (AppleReq, BananaReq) */ @@ -223,75 +239,75 @@ public class FruitReq extends AbstractOpenApiSchema { } /** - * Get the actual instance of `AppleReq`. If the actual instance is not `AppleReq`, - * the ClassCastException will be thrown. + * Get the actual instance of `AppleReq`. If the actual instance is not `AppleReq`, the + * ClassCastException will be thrown. * * @return The actual instance of `AppleReq` * @throws ClassCastException if the instance is not `AppleReq` */ public AppleReq getAppleReq() throws ClassCastException { - return (AppleReq)super.getActualInstance(); + return (AppleReq) super.getActualInstance(); } /** - * Get the actual instance of `BananaReq`. If the actual instance is not `BananaReq`, - * the ClassCastException will be thrown. + * Get the actual instance of `BananaReq`. If the actual instance is not `BananaReq`, the + * ClassCastException will be thrown. * * @return The actual instance of `BananaReq` * @throws ClassCastException if the instance is not `BananaReq` */ public BananaReq getBananaReq() throws ClassCastException { - return (BananaReq)super.getActualInstance(); + return (BananaReq) super.getActualInstance(); } - - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - StringJoiner joiner = new StringJoiner("&"); - - if (getActualInstance() instanceof AppleReq) { - if (getActualInstance() != null) { - joiner.add(((AppleReq)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - return joiner.toString(); - } - if (getActualInstance() instanceof BananaReq) { - if (getActualInstance() != null) { - joiner.add(((BananaReq)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); - } - return joiner.toString(); - } - return null; - } + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof AppleReq) { + if (getActualInstance() != null) { + joiner.add( + ((AppleReq) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof BananaReq) { + if (getActualInstance() != null) { + joiner.add( + ((BananaReq) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } } - 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 7f6ac4516512..e54cac82e493 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 @@ -3,40 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.openapitools.client.model.Apple; -import org.openapitools.client.model.Banana; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -49,10 +24,17 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") -@JsonDeserialize(using=GmFruit.GmFruitDeserializer.class) +@JsonDeserialize(using = GmFruit.GmFruitDeserializer.class) @JsonSerialize(using = GmFruit.GmFruitSerializer.class) public class GmFruit extends AbstractOpenApiSchema { private static final Logger log = Logger.getLogger(GmFruit.class.getName()); @@ -67,7 +49,8 @@ public class GmFruit extends AbstractOpenApiSchema { } @Override - public void serialize(GmFruit value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize(GmFruit value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { jgen.writeObject(value.getActualInstance()); } } @@ -82,7 +65,8 @@ public class GmFruit extends AbstractOpenApiSchema { } @Override - public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public GmFruit deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; @@ -108,12 +92,11 @@ public class GmFruit extends AbstractOpenApiSchema { log.log(Level.FINER, "Input data does not match 'GmFruit'", e); } - throw new IOException(String.format("Failed deserialization for GmFruit: no match found")); + throw new IOException( + String.format("Failed deserialization for GmFruit: no match found")); } - /** - * Handle deserialization of the 'null' value. - */ + /** Handle deserialization of the 'null' value. */ @Override public GmFruit getNullValue(DeserializationContext ctxt) throws JsonMappingException { throw new JsonMappingException(ctxt.getParser(), "GmFruit cannot be null"); @@ -149,12 +132,11 @@ public class GmFruit extends AbstractOpenApiSchema { } /** - * Set the instance that matches the anyOf child schema, check - * the instance parameter is valid against the anyOf child schemas: - * Apple, Banana + * Set the instance that matches the anyOf child schema, check the instance parameter is valid + * against the anyOf child schemas: Apple, Banana * - * It could be an instance of the 'anyOf' schemas. - * The anyOf child schemas may themselves be a composed schema (allOf, anyOf, anyOf). + *

It could be an instance of the 'anyOf' schemas. The anyOf child schemas may themselves be + * a composed schema (allOf, anyOf, anyOf). */ @Override public void setActualInstance(Object instance) { @@ -172,8 +154,7 @@ public class GmFruit extends AbstractOpenApiSchema { } /** - * Get the actual instance, which can be the following: - * Apple, Banana + * Get the actual instance, which can be the following: Apple, Banana * * @return The actual instance (Apple, Banana) */ @@ -183,26 +164,24 @@ public class GmFruit extends AbstractOpenApiSchema { } /** - * Get the actual instance of `Apple`. If the actual instance is not `Apple`, - * the ClassCastException will be thrown. + * Get the actual instance of `Apple`. If the actual instance is not `Apple`, the + * ClassCastException will be thrown. * * @return The actual instance of `Apple` * @throws ClassCastException if the instance is not `Apple` */ public Apple getApple() throws ClassCastException { - return (Apple)super.getActualInstance(); + return (Apple) super.getActualInstance(); } /** - * Get the actual instance of `Banana`. If the actual instance is not `Banana`, - * the ClassCastException will be thrown. + * Get the actual instance of `Banana`. If the actual instance is not `Banana`, the + * ClassCastException will be thrown. * * @return The actual instance of `Banana` * @throws ClassCastException if the instance is not `Banana` */ public Banana getBanana() throws ClassCastException { - return (Banana)super.getActualInstance(); + return (Banana) super.getActualInstance(); } - } - 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 53cf95c9c15e..abddbb0559f3 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 @@ -3,172 +3,166 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; -import org.openapitools.client.model.ParentPet; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; import org.openapitools.client.JSON; -/** - * GrandparentAnimal - */ -@JsonPropertyOrder({ - GrandparentAnimal.JSON_PROPERTY_PET_TYPE -}) + +/** GrandparentAnimal */ +@JsonPropertyOrder({GrandparentAnimal.JSON_PROPERTY_PET_TYPE}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonIgnoreProperties( - value = "pet_type", // ignore manually set pet_type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the pet_type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "pet_type", visible = true) + value = "pet_type", // ignore manually set pet_type, it will be automatically generated by + // Jackson during serialization + allowSetters = true // allows the pet_type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "pet_type", + visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"), - @JsonSubTypes.Type(value = ParentPet.class, name = "ParentPet"), + @JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"), + @JsonSubTypes.Type(value = ParentPet.class, name = "ParentPet"), }) - public class GrandparentAnimal { - public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; - private String petType; + public static final String JSON_PROPERTY_PET_TYPE = "pet_type"; + private String petType; - public GrandparentAnimal() { - } + public GrandparentAnimal() {} - public GrandparentAnimal petType(String petType) { - this.petType = petType; - return this; - } - - /** - * Get petType - * @return petType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_PET_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getPetType() { - return petType; - } - - - @JsonProperty(JSON_PROPERTY_PET_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPetType(String petType) { - this.petType = petType; - } - - - /** - * Return true if this GrandparentAnimal object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(petType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class GrandparentAnimal {\n"); - sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public GrandparentAnimal petType(String petType) { + this.petType = petType; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `pet_type` to the URL query string - if (getPetType() != null) { - joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get petType + * + * @return petType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PET_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getPetType() { + return petType; } - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildCat", ChildCat.class); - mappings.put("ParentPet", ParentPet.class); - mappings.put("GrandparentAnimal", GrandparentAnimal.class); - JSON.registerDiscriminator(GrandparentAnimal.class, "pet_type", mappings); + @JsonProperty(JSON_PROPERTY_PET_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPetType(String petType) { + this.petType = petType; + } + + /** Return true if this GrandparentAnimal object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(petType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GrandparentAnimal {\n"); + sb.append(" petType: ").append(toIndentedString(petType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `pet_type` to the URL query string + if (getPetType() != null) { + joiner.add( + String.format( + "%spet_type%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ChildCat", ChildCat.class); + mappings.put("ParentPet", ParentPet.class); + mappings.put("GrandparentAnimal", GrandparentAnimal.class); + JSON.registerDiscriminator(GrandparentAnimal.class, "pet_type", mappings); + } } -} - 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 f6c4d6a7eb54..03d449f39599 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 @@ -3,174 +3,164 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * HasOnlyReadOnly - */ -@JsonPropertyOrder({ - HasOnlyReadOnly.JSON_PROPERTY_BAR, - HasOnlyReadOnly.JSON_PROPERTY_FOO -}) +/** HasOnlyReadOnly */ +@JsonPropertyOrder({HasOnlyReadOnly.JSON_PROPERTY_BAR, HasOnlyReadOnly.JSON_PROPERTY_FOO}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HasOnlyReadOnly { - public static final String JSON_PROPERTY_BAR = "bar"; - private String bar; + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; - public static final String JSON_PROPERTY_FOO = "foo"; - private String foo; + public static final String JSON_PROPERTY_FOO = "foo"; + private String foo; - public HasOnlyReadOnly() { - } + public HasOnlyReadOnly() {} - @JsonCreator - public HasOnlyReadOnly( - @JsonProperty(JSON_PROPERTY_BAR) String bar, - @JsonProperty(JSON_PROPERTY_FOO) String foo - ) { - this(); - this.bar = bar; - this.foo = foo; - } - - /** - * Get bar - * @return bar - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BAR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getBar() { - return bar; - } - - - - - /** - * Get foo - * @return foo - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FOO) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getFoo() { - return foo; - } - - - - - /** - * Return true if this hasOnlyReadOnly object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + @JsonCreator + public HasOnlyReadOnly( + @JsonProperty(JSON_PROPERTY_BAR) String bar, + @JsonProperty(JSON_PROPERTY_FOO) String foo) { + this(); + this.bar = bar; + this.foo = foo; } - StringJoiner joiner = new StringJoiner("&"); - - // add `bar` to the URL query string - if (getBar() != null) { - joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get bar + * + * @return bar + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; } - // add `foo` to the URL query string - if (getFoo() != null) { - joiner.add(String.format("%sfoo%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFoo()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get foo + * + * @return foo + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FOO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFoo() { + return foo; } - return joiner.toString(); - } + /** Return true if this hasOnlyReadOnly object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(bar, foo); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HasOnlyReadOnly {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bar` to the URL query string + if (getBar() != null) { + joiner.add( + String.format( + "%sbar%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `foo` to the URL query string + if (getFoo() != null) { + joiner.add( + String.format( + "%sfoo%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getFoo()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 51e41ec085c7..c40c20444a65 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 @@ -3,171 +3,169 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; - +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Objects; +import java.util.StringJoiner; +import org.openapitools.jackson.nullable.JsonNullable; /** - * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + * Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer + * in generated model. */ -@JsonPropertyOrder({ - HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE -}) +@JsonPropertyOrder({HealthCheckResult.JSON_PROPERTY_NULLABLE_MESSAGE}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class HealthCheckResult { - public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; - private JsonNullable nullableMessage = JsonNullable.undefined(); + public static final String JSON_PROPERTY_NULLABLE_MESSAGE = "NullableMessage"; + private JsonNullable nullableMessage = JsonNullable.undefined(); - public HealthCheckResult() { - } + public HealthCheckResult() {} - public HealthCheckResult nullableMessage(String nullableMessage) { - this.nullableMessage = JsonNullable.of(nullableMessage); - return this; - } + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + return this; + } - /** - * Get nullableMessage - * @return nullableMessage - **/ - @javax.annotation.Nullable - @JsonIgnore - - public String getNullableMessage() { + /** + * Get nullableMessage + * + * @return nullableMessage + */ + @javax.annotation.Nullable + @JsonIgnore + public String getNullableMessage() { return nullableMessage.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable getNullableMessage_JsonNullable() { - return nullableMessage; - } - - @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) - public void setNullableMessage_JsonNullable(JsonNullable nullableMessage) { - this.nullableMessage = nullableMessage; - } - - public void setNullableMessage(String nullableMessage) { - this.nullableMessage = JsonNullable.of(nullableMessage); - } - - - /** - * Return true if this HealthCheckResult object is equal to o. - */ - @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); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(hashCodeNullable(nullableMessage)); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HealthCheckResult {\n"); - sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; } - StringJoiner joiner = new StringJoiner("&"); - - // add `NullableMessage` to the URL query string - if (getNullableMessage() != null) { - joiner.add(String.format("%sNullableMessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNullableMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNullableMessage_JsonNullable() { + return nullableMessage; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_NULLABLE_MESSAGE) + public void setNullableMessage_JsonNullable(JsonNullable nullableMessage) { + this.nullableMessage = nullableMessage; + } + + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = JsonNullable.of(nullableMessage); + } + + /** Return true if this HealthCheckResult object is equal to o. */ + @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); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableMessage)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `NullableMessage` to the URL query string + if (getNullableMessage() != null) { + joiner.add( + String.format( + "%sNullableMessage%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getNullableMessage()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 6aa060fe25de..538784736841 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 @@ -3,184 +3,182 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * IsoscelesTriangle - */ +/** IsoscelesTriangle */ @JsonPropertyOrder({ - IsoscelesTriangle.JSON_PROPERTY_SHAPE_TYPE, - IsoscelesTriangle.JSON_PROPERTY_TRIANGLE_TYPE + IsoscelesTriangle.JSON_PROPERTY_SHAPE_TYPE, + IsoscelesTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class IsoscelesTriangle { - public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - private String shapeType; + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; - public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; - private String triangleType; + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + private String triangleType; - public IsoscelesTriangle() { - } + public IsoscelesTriangle() {} - public IsoscelesTriangle shapeType(String shapeType) { - this.shapeType = shapeType; - return this; - } - - /** - * Get shapeType - * @return shapeType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getShapeType() { - return shapeType; - } - - - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(String shapeType) { - this.shapeType = shapeType; - } - - - public IsoscelesTriangle triangleType(String triangleType) { - this.triangleType = triangleType; - return this; - } - - /** - * Get triangleType - * @return triangleType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getTriangleType() { - return triangleType; - } - - - @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriangleType(String triangleType) { - this.triangleType = triangleType; - } - - - /** - * Return true if this IsoscelesTriangle object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(shapeType, triangleType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class IsoscelesTriangle {\n"); - sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); - sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public IsoscelesTriangle shapeType(String shapeType) { + this.shapeType = shapeType; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `shapeType` to the URL query string - if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get shapeType + * + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; } - // add `triangleType` to the URL query string - if (getTriangleType() != null) { - joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(String shapeType) { + this.shapeType = shapeType; } - return joiner.toString(); - } + public IsoscelesTriangle triangleType(String triangleType) { + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * + * @return triangleType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriangleType() { + return triangleType; + } + + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + /** Return true if this IsoscelesTriangle object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, triangleType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsoscelesTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add( + String.format( + "%sshapeType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getShapeType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `triangleType` to the URL query string + if (getTriangleType() != null) { + joiner.add( + String.format( + "%striangleType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getTriangleType()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 a19cc8509188..578dd1c4c246 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 @@ -3,44 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Pig; -import org.openapitools.client.model.Whale; -import org.openapitools.client.model.Zebra; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import com.fasterxml.jackson.core.type.TypeReference; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -55,6 +26,16 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -73,7 +54,8 @@ public class Mammal extends AbstractOpenApiSchema { } @Override - public void serialize(Mammal value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize(Mammal value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { jgen.writeObject(value.getActualInstance()); } } @@ -88,7 +70,8 @@ public class Mammal extends AbstractOpenApiSchema { } @Override - public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public Mammal deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); @@ -98,13 +81,26 @@ public class Mammal extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Pig.class.equals(Integer.class) || Pig.class.equals(Long.class) || Pig.class.equals(Float.class) || Pig.class.equals(Double.class) || Pig.class.equals(Boolean.class) || Pig.class.equals(String.class)) { + if (Pig.class.equals(Integer.class) + || Pig.class.equals(Long.class) + || Pig.class.equals(Float.class) + || Pig.class.equals(Double.class) + || Pig.class.equals(Boolean.class) + || Pig.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Pig.class.equals(Integer.class) || Pig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Pig.class.equals(Float.class) || Pig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Pig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Pig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Pig.class.equals(Integer.class) || Pig.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Pig.class.equals(Float.class) || Pig.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Pig.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Pig.class.equals(String.class) && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -124,13 +120,29 @@ public class Mammal extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Whale.class.equals(Integer.class) || Whale.class.equals(Long.class) || Whale.class.equals(Float.class) || Whale.class.equals(Double.class) || Whale.class.equals(Boolean.class) || Whale.class.equals(String.class)) { + if (Whale.class.equals(Integer.class) + || Whale.class.equals(Long.class) + || Whale.class.equals(Float.class) + || Whale.class.equals(Double.class) + || Whale.class.equals(Boolean.class) + || Whale.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Whale.class.equals(Integer.class) || Whale.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Whale.class.equals(Float.class) || Whale.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Whale.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Whale.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Whale.class.equals(Integer.class) + || Whale.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Whale.class.equals(Float.class) + || Whale.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Whale.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Whale.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -150,13 +162,29 @@ public class Mammal extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class) || Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class) || Zebra.class.equals(Boolean.class) || Zebra.class.equals(String.class)) { + if (Zebra.class.equals(Integer.class) + || Zebra.class.equals(Long.class) + || Zebra.class.equals(Float.class) + || Zebra.class.equals(Double.class) + || Zebra.class.equals(Boolean.class) + || Zebra.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Zebra.class.equals(Integer.class) || Zebra.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Zebra.class.equals(Float.class) || Zebra.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Zebra.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Zebra.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Zebra.class.equals(Integer.class) + || Zebra.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Zebra.class.equals(Float.class) + || Zebra.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Zebra.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Zebra.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -177,12 +205,14 @@ public class Mammal extends AbstractOpenApiSchema { ret.setActualInstance(deserialized); return ret; } - throw new IOException(String.format("Failed deserialization for Mammal: %d classes match result, expected 1", match)); + throw new IOException( + String.format( + "Failed deserialization for Mammal: %d classes match result, expected" + + " 1", + match)); } - /** - * Handle deserialization of the 'null' value. - */ + /** Handle deserialization of the 'null' value. */ @Override public Mammal getNullValue(DeserializationContext ctxt) throws JsonMappingException { throw new JsonMappingException(ctxt.getParser(), "Mammal cannot be null"); @@ -231,12 +261,11 @@ public class Mammal extends AbstractOpenApiSchema { } /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * Pig, Whale, Zebra + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Pig, Whale, Zebra * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be + * a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { @@ -259,8 +288,7 @@ public class Mammal extends AbstractOpenApiSchema { } /** - * Get the actual instance, which can be the following: - * Pig, Whale, Zebra + * Get the actual instance, which can be the following: Pig, Whale, Zebra * * @return The actual instance (Pig, Whale, Zebra) */ @@ -270,92 +298,99 @@ public class Mammal extends AbstractOpenApiSchema { } /** - * Get the actual instance of `Pig`. If the actual instance is not `Pig`, - * the ClassCastException will be thrown. + * Get the actual instance of `Pig`. If the actual instance is not `Pig`, the ClassCastException + * will be thrown. * * @return The actual instance of `Pig` * @throws ClassCastException if the instance is not `Pig` */ public Pig getPig() throws ClassCastException { - return (Pig)super.getActualInstance(); + return (Pig) super.getActualInstance(); } /** - * Get the actual instance of `Whale`. If the actual instance is not `Whale`, - * the ClassCastException will be thrown. + * Get the actual instance of `Whale`. If the actual instance is not `Whale`, the + * ClassCastException will be thrown. * * @return The actual instance of `Whale` * @throws ClassCastException if the instance is not `Whale` */ public Whale getWhale() throws ClassCastException { - return (Whale)super.getActualInstance(); + return (Whale) super.getActualInstance(); } /** - * Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, - * the ClassCastException will be thrown. + * Get the actual instance of `Zebra`. If the actual instance is not `Zebra`, the + * ClassCastException will be thrown. * * @return The actual instance of `Zebra` * @throws ClassCastException if the instance is not `Zebra` */ public Zebra getZebra() throws ClassCastException { - return (Zebra)super.getActualInstance(); + return (Zebra) super.getActualInstance(); } - - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - StringJoiner joiner = new StringJoiner("&"); - - if (getActualInstance() instanceof Whale) { - if (getActualInstance() != null) { - joiner.add(((Whale)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - return joiner.toString(); - } - if (getActualInstance() instanceof Zebra) { - if (getActualInstance() != null) { - joiner.add(String.format("%sone_of_1%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getActualInstance()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } - return joiner.toString(); - } - if (getActualInstance() instanceof Pig) { - if (getActualInstance() != null) { - joiner.add(((Pig)getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); - } - return joiner.toString(); - } - return null; - } + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Whale) { + if (getActualInstance() != null) { + joiner.add( + ((Whale) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Zebra) { + if (getActualInstance() != null) { + joiner.add( + String.format( + "%sone_of_1%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getActualInstance()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Pig) { + if (getActualInstance() != null) { + joiner.add( + ((Pig) getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + return null; + } } - 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 8568cbb7163c..ad5dec8cf329 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 @@ -3,341 +3,364 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * MapTest - */ +/** MapTest */ @JsonPropertyOrder({ - MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, - MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, - MapTest.JSON_PROPERTY_DIRECT_MAP, - MapTest.JSON_PROPERTY_INDIRECT_MAP + MapTest.JSON_PROPERTY_MAP_MAP_OF_STRING, + MapTest.JSON_PROPERTY_MAP_OF_ENUM_STRING, + MapTest.JSON_PROPERTY_DIRECT_MAP, + MapTest.JSON_PROPERTY_INDIRECT_MAP }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MapTest { - public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; - private Map> mapMapOfString = new HashMap<>(); + public static final String JSON_PROPERTY_MAP_MAP_OF_STRING = "map_map_of_string"; + private Map> mapMapOfString = new HashMap<>(); - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); + /** Gets or Sets inner */ + public enum InnerEnum { + UPPER("UPPER"), - private String value; + LOWER("lower"); - InnerEnum(String value) { - this.value = value; + private String value; + + InnerEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static InnerEnum fromValue(String value) { + for (InnerEnum b : InnerEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; + private Map mapOfEnumString = new HashMap<>(); + + public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; + private Map directMap = new HashMap<>(); + + public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; + private Map indirectMap = new HashMap<>(); + + public MapTest() {} + + public MapTest mapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + return this; + } + + public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { + if (this.mapMapOfString == null) { + this.mapMapOfString = new HashMap<>(); + } + this.mapMapOfString.put(key, mapMapOfStringItem); + return this; + } + + /** + * Get mapMapOfString + * + * @return mapMapOfString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getMapMapOfString() { + return mapMapOfString; + } + + @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapMapOfString(Map> mapMapOfString) { + this.mapMapOfString = mapMapOfString; + } + + public MapTest mapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + return this; + } + + public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { + if (this.mapOfEnumString == null) { + this.mapOfEnumString = new HashMap<>(); + } + this.mapOfEnumString.put(key, mapOfEnumStringItem); + return this; + } + + /** + * Get mapOfEnumString + * + * @return mapOfEnumString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMapOfEnumString() { + return mapOfEnumString; + } + + @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMapOfEnumString(Map mapOfEnumString) { + this.mapOfEnumString = mapOfEnumString; + } + + public MapTest directMap(Map directMap) { + this.directMap = directMap; + return this; + } + + public MapTest putDirectMapItem(String key, Boolean directMapItem) { + if (this.directMap == null) { + this.directMap = new HashMap<>(); + } + this.directMap.put(key, directMapItem); + return this; + } + + /** + * Get directMap + * + * @return directMap + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getDirectMap() { + return directMap; + } + + @JsonProperty(JSON_PROPERTY_DIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDirectMap(Map directMap) { + this.directMap = directMap; + } + + public MapTest indirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + return this; + } + + public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { + if (this.indirectMap == null) { + this.indirectMap = new HashMap<>(); + } + this.indirectMap.put(key, indirectMapItem); + return this; + } + + /** + * Get indirectMap + * + * @return indirectMap + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getIndirectMap() { + return indirectMap; + } + + @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setIndirectMap(Map indirectMap) { + this.indirectMap = indirectMap; + } + + /** Return true if this MapTest object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class MapTest {\n"); + sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); + sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); + sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); + sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_MAP_OF_ENUM_STRING = "map_of_enum_string"; - private Map mapOfEnumString = new HashMap<>(); - - public static final String JSON_PROPERTY_DIRECT_MAP = "direct_map"; - private Map directMap = new HashMap<>(); - - public static final String JSON_PROPERTY_INDIRECT_MAP = "indirect_map"; - private Map indirectMap = new HashMap<>(); - - public MapTest() { - } - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map> getMapMapOfString() { - return mapMapOfString; - } - - - @JsonProperty(JSON_PROPERTY_MAP_MAP_OF_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - - @JsonProperty(JSON_PROPERTY_MAP_OF_ENUM_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map getDirectMap() { - return directMap; - } - - - @JsonProperty(JSON_PROPERTY_DIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - - public MapTest indirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap<>(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map getIndirectMap() { - return indirectMap; - } - - - @JsonProperty(JSON_PROPERTY_INDIRECT_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - - /** - * Return true if this MapTest object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + return o.toString().replace("\n", "\n "); } - StringJoiner joiner = new StringJoiner("&"); - - // add `map_map_of_string` to the URL query string - if (getMapMapOfString() != null) { - for (String _key : getMapMapOfString().keySet()) { - joiner.add(String.format("%smap_map_of_string%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapMapOfString().get(_key), URLEncoder.encode(String.valueOf(getMapMapOfString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - // add `map_of_enum_string` to the URL query string - if (getMapOfEnumString() != null) { - for (String _key : getMapOfEnumString().keySet()) { - joiner.add(String.format("%smap_of_enum_string%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getMapOfEnumString().get(_key), URLEncoder.encode(String.valueOf(getMapOfEnumString().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } - } + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } - // add `direct_map` to the URL query string - if (getDirectMap() != null) { - for (String _key : getDirectMap().keySet()) { - joiner.add(String.format("%sdirect_map%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getDirectMap().get(_key), URLEncoder.encode(String.valueOf(getDirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } - } + StringJoiner joiner = new StringJoiner("&"); - // add `indirect_map` to the URL query string - if (getIndirectMap() != null) { - for (String _key : getIndirectMap().keySet()) { - joiner.add(String.format("%sindirect_map%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getIndirectMap().get(_key), URLEncoder.encode(String.valueOf(getIndirectMap().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } - } + // add `map_map_of_string` to the URL query string + if (getMapMapOfString() != null) { + for (String _key : getMapMapOfString().keySet()) { + joiner.add( + String.format( + "%smap_map_of_string%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getMapMapOfString().get(_key), + URLEncoder.encode( + String.valueOf(getMapMapOfString().get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } - return joiner.toString(); - } + // add `map_of_enum_string` to the URL query string + if (getMapOfEnumString() != null) { + for (String _key : getMapOfEnumString().keySet()) { + joiner.add( + String.format( + "%smap_of_enum_string%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getMapOfEnumString().get(_key), + URLEncoder.encode( + String.valueOf(getMapOfEnumString().get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `direct_map` to the URL query string + if (getDirectMap() != null) { + for (String _key : getDirectMap().keySet()) { + joiner.add( + String.format( + "%sdirect_map%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getDirectMap().get(_key), + URLEncoder.encode( + String.valueOf(getDirectMap().get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `indirect_map` to the URL query string + if (getIndirectMap() != null) { + for (String _key : getIndirectMap().keySet()) { + joiner.add( + String.format( + "%sindirect_map%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getIndirectMap().get(_key), + URLEncoder.encode( + String.valueOf(getIndirectMap().get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + return joiner.toString(); + } } - 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 adf7bfa2ce32..d044e1e08e40 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 @@ -3,238 +3,244 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import java.util.HashMap; import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; import java.util.UUID; -import org.openapitools.client.model.Animal; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ +/** MixedPropertiesAndAdditionalPropertiesClass */ @JsonPropertyOrder({ - MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, - MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, - MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_UUID, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_DATE_TIME, + MixedPropertiesAndAdditionalPropertiesClass.JSON_PROPERTY_MAP }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class MixedPropertiesAndAdditionalPropertiesClass { - public static final String JSON_PROPERTY_UUID = "uuid"; - private UUID uuid; + public static final String JSON_PROPERTY_UUID = "uuid"; + private UUID uuid; - public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; - private OffsetDateTime dateTime; + public static final String JSON_PROPERTY_DATE_TIME = "dateTime"; + private OffsetDateTime dateTime; - public static final String JSON_PROPERTY_MAP = "map"; - private Map map = new HashMap<>(); + public static final String JSON_PROPERTY_MAP = "map"; + private Map map = new HashMap<>(); - public MixedPropertiesAndAdditionalPropertiesClass() { - } + public MixedPropertiesAndAdditionalPropertiesClass() {} - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public UUID getUuid() { - return uuid; - } - - - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public OffsetDateTime getDateTime() { - return dateTime; - } - - - @JsonProperty(JSON_PROPERTY_DATE_TIME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Map getMap() { - return map; - } - - - @JsonProperty(JSON_PROPERTY_MAP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMap(Map map) { - this.map = map; - } - - - /** - * Return true if this MixedPropertiesAndAdditionalPropertiesClass object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { + this.uuid = uuid; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `uuid` to the URL query string - if (getUuid() != null) { - joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get uuid + * + * @return uuid + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public UUID getUuid() { + return uuid; } - // add `dateTime` to the URL query string - if (getDateTime() != null) { - joiner.add(String.format("%sdateTime%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDateTime()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(UUID uuid) { + this.uuid = uuid; } - // add `map` to the URL query string - if (getMap() != null) { - for (String _key : getMap().keySet()) { - if (getMap().get(_key) != null) { - joiner.add(getMap().get(_key).toUrlQueryString(String.format("%smap%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix)))); + public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + return this; + } + + /** + * Get dateTime + * + * @return dateTime + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getDateTime() { + return dateTime; + } + + @JsonProperty(JSON_PROPERTY_DATE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDateTime(OffsetDateTime dateTime) { + this.dateTime = dateTime; + } + + public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { + this.map = map; + return this; + } + + public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { + if (this.map == null) { + this.map = new HashMap<>(); } - } + this.map.put(key, mapItem); + return this; } - return joiner.toString(); - } -} + /** + * Get map + * + * @return map + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getMap() { + return map; + } + @JsonProperty(JSON_PROPERTY_MAP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMap(Map map) { + this.map = map; + } + + /** Return true if this MixedPropertiesAndAdditionalPropertiesClass object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, dateTime, map); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); + sb.append(" map: ").append(toIndentedString(map)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `uuid` to the URL query string + if (getUuid() != null) { + joiner.add( + String.format( + "%suuid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `dateTime` to the URL query string + if (getDateTime() != null) { + joiner.add( + String.format( + "%sdateTime%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getDateTime()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `map` to the URL query string + if (getMap() != null) { + for (String _key : getMap().keySet()) { + if (getMap().get(_key) != null) { + joiner.add( + getMap().get(_key) + .toUrlQueryString( + String.format( + "%smap%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", + containerPrefix, + _key, + containerSuffix)))); + } + } + } + + return joiner.toString(); + } +} 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 15c576c91da1..b7a40aeeebe7 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 @@ -3,184 +3,181 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Model for testing model name starting with number - */ +/** Model for testing model name starting with number */ @JsonPropertyOrder({ - Model200Response.JSON_PROPERTY_NAME, - Model200Response.JSON_PROPERTY_PROPERTY_CLASS + Model200Response.JSON_PROPERTY_NAME, + Model200Response.JSON_PROPERTY_PROPERTY_CLASS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Model200Response { - public static final String JSON_PROPERTY_NAME = "name"; - private Integer name; + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; - public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; - private String propertyClass; + public static final String JSON_PROPERTY_PROPERTY_CLASS = "class"; + private String propertyClass; - public Model200Response() { - } + public Model200Response() {} - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(Integer name) { - this.name = name; - } - - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPropertyClass() { - return propertyClass; - } - - - @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - - /** - * Return true if this 200_response object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Model200Response name(Integer name) { + this.name = name; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `name` to the URL query string - if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getName() { + return name; } - // add `class` to the URL query string - if (getPropertyClass() != null) { - joiner.add(String.format("%sclass%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPropertyClass()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(Integer name) { + this.name = name; } - return joiner.toString(); - } + public Model200Response propertyClass(String propertyClass) { + this.propertyClass = propertyClass; + return this; + } + + /** + * Get propertyClass + * + * @return propertyClass + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPropertyClass() { + return propertyClass; + } + + @JsonProperty(JSON_PROPERTY_PROPERTY_CLASS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPropertyClass(String propertyClass) { + this.propertyClass = propertyClass; + } + + /** Return true if this 200_response object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(name, propertyClass); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Model200Response {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `class` to the URL query string + if (getPropertyClass() != null) { + joiner.add( + String.format( + "%sclass%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getPropertyClass()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 6f74d3ca9628..d96b8f9ead23 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 @@ -3,220 +3,219 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * ModelApiResponse - */ +/** ModelApiResponse */ @JsonPropertyOrder({ - ModelApiResponse.JSON_PROPERTY_CODE, - ModelApiResponse.JSON_PROPERTY_TYPE, - ModelApiResponse.JSON_PROPERTY_MESSAGE + ModelApiResponse.JSON_PROPERTY_CODE, + ModelApiResponse.JSON_PROPERTY_TYPE, + ModelApiResponse.JSON_PROPERTY_MESSAGE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelApiResponse { - public static final String JSON_PROPERTY_CODE = "code"; - private Integer code; + public static final String JSON_PROPERTY_CODE = "code"; + private Integer code; - public static final String JSON_PROPERTY_TYPE = "type"; - private String type; + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; - public static final String JSON_PROPERTY_MESSAGE = "message"; - private String message; + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; - public ModelApiResponse() { - } + public ModelApiResponse() {} - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getCode() { - return code; - } - - - @JsonProperty(JSON_PROPERTY_CODE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCode(Integer code) { - this.code = code; - } - - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(String type) { - this.type = type; - } - - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMessage() { - return message; - } - - - @JsonProperty(JSON_PROPERTY_MESSAGE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMessage(String message) { - this.message = message; - } - - - /** - * Return true if this ApiResponse object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ModelApiResponse code(Integer code) { + this.code = code; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `code` to the URL query string - if (getCode() != null) { - joiner.add(String.format("%scode%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getCode()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get code + * + * @return code + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getCode() { + return code; } - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCode(Integer code) { + this.code = code; } - // add `message` to the URL query string - if (getMessage() != null) { - joiner.add(String.format("%smessage%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMessage()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public ModelApiResponse type(String type) { + this.type = type; + return this; } - return joiner.toString(); - } + /** + * Get type + * + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + } + + public ModelApiResponse message(String message) { + this.message = message; + return this; + } + + /** + * Get message + * + * @return message + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + } + + /** Return true if this ApiResponse object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(code, type, message); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelApiResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `code` to the URL query string + if (getCode() != null) { + joiner.add( + String.format( + "%scode%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getCode()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `type` to the URL query string + if (getType() != null) { + joiner.add( + String.format( + "%stype%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `message` to the URL query string + if (getMessage() != null) { + joiner.add( + String.format( + "%smessage%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getMessage()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 61ada7082fd5..d9d8da1a6504 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 @@ -3,148 +3,138 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Must be named `File` for test. - */ -@JsonPropertyOrder({ - ModelFile.JSON_PROPERTY_SOURCE_U_R_I -}) +/** Must be named `File` for test. */ +@JsonPropertyOrder({ModelFile.JSON_PROPERTY_SOURCE_U_R_I}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelFile { - public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; - private String sourceURI; + public static final String JSON_PROPERTY_SOURCE_U_R_I = "sourceURI"; + private String sourceURI; - public ModelFile() { - } + public ModelFile() {} - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSourceURI() { - return sourceURI; - } - - - @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - /** - * Return true if this File object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ModelFile sourceURI(String sourceURI) { + this.sourceURI = sourceURI; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `sourceURI` to the URL query string - if (getSourceURI() != null) { - joiner.add(String.format("%ssourceURI%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSourceURI()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Test capitalization + * + * @return sourceURI + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceURI() { + return sourceURI; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_SOURCE_U_R_I) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSourceURI(String sourceURI) { + this.sourceURI = sourceURI; + } + + /** Return true if this File object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(sourceURI); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelFile {\n"); + sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `sourceURI` to the URL query string + if (getSourceURI() != null) { + joiner.add( + String.format( + "%ssourceURI%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getSourceURI()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 7e3e24c2d689..e3e82ed8c834 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 @@ -3,148 +3,137 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * ModelList - */ -@JsonPropertyOrder({ - ModelList.JSON_PROPERTY_123LIST -}) +/** ModelList */ +@JsonPropertyOrder({ModelList.JSON_PROPERTY_123LIST}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelList { - public static final String JSON_PROPERTY_123LIST = "123-list"; - private String _123list; + public static final String JSON_PROPERTY_123LIST = "123-list"; + private String _123list; - public ModelList() { - } + public ModelList() {} - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_123LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String get123list() { - return _123list; - } - - - @JsonProperty(JSON_PROPERTY_123LIST) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void set123list(String _123list) { - this._123list = _123list; - } - - - /** - * Return true if this List object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ModelList _123list(String _123list) { + this._123list = _123list; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `123-list` to the URL query string - if (get123list() != null) { - joiner.add(String.format("%s123-list%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(get123list()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get _123list + * + * @return _123list + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String get123list() { + return _123list; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_123LIST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set123list(String _123list) { + this._123list = _123list; + } + + /** Return true if this List object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(_123list); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `123-list` to the URL query string + if (get123list() != null) { + joiner.add( + String.format( + "%s123-list%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(get123list()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 8c442eaeef11..6099d8451ae2 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 @@ -3,148 +3,137 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Model for testing reserved words - */ -@JsonPropertyOrder({ - ModelReturn.JSON_PROPERTY_RETURN -}) +/** Model for testing reserved words */ +@JsonPropertyOrder({ModelReturn.JSON_PROPERTY_RETURN}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ModelReturn { - public static final String JSON_PROPERTY_RETURN = "return"; - private Integer _return; + public static final String JSON_PROPERTY_RETURN = "return"; + private Integer _return; - public ModelReturn() { - } + public ModelReturn() {} - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_RETURN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getReturn() { - return _return; - } - - - @JsonProperty(JSON_PROPERTY_RETURN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setReturn(Integer _return) { - this._return = _return; - } - - - /** - * Return true if this Return object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ModelReturn _return(Integer _return) { + this._return = _return; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `return` to the URL query string - if (getReturn() != null) { - joiner.add(String.format("%sreturn%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getReturn()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get _return + * + * @return _return + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getReturn() { + return _return; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_RETURN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setReturn(Integer _return) { + this._return = _return; + } + + /** Return true if this Return object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(_return); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelReturn {\n"); + sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `return` to the URL query string + if (getReturn() != null) { + joiner.add( + String.format( + "%sreturn%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getReturn()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 ae795ee5c5d3..5d7835da597b 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 @@ -3,246 +3,249 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Model for testing model name same as property name - */ +/** Model for testing model name same as property name */ @JsonPropertyOrder({ - Name.JSON_PROPERTY_NAME, - Name.JSON_PROPERTY_SNAKE_CASE, - Name.JSON_PROPERTY_PROPERTY, - Name.JSON_PROPERTY_123NUMBER + Name.JSON_PROPERTY_NAME, + Name.JSON_PROPERTY_SNAKE_CASE, + Name.JSON_PROPERTY_PROPERTY, + Name.JSON_PROPERTY_123NUMBER }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Name { - public static final String JSON_PROPERTY_NAME = "name"; - private Integer name; + public static final String JSON_PROPERTY_NAME = "name"; + private Integer name; - public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; - private Integer snakeCase; + public static final String JSON_PROPERTY_SNAKE_CASE = "snake_case"; + private Integer snakeCase; - public static final String JSON_PROPERTY_PROPERTY = "property"; - private String property; + public static final String JSON_PROPERTY_PROPERTY = "property"; + private String property; - public static final String JSON_PROPERTY_123NUMBER = "123Number"; - private Integer _123number; + public static final String JSON_PROPERTY_123NUMBER = "123Number"; + private Integer _123number; - public Name() { - } + public Name() {} - @JsonCreator - public Name( - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, - @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number - ) { - this(); - this.snakeCase = snakeCase; - this._123number = _123number; - } - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(Integer name) { - this.name = name; - } - - - /** - * Get snakeCase - * @return snakeCase - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SNAKE_CASE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getSnakeCase() { - return snakeCase; - } - - - - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PROPERTY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getProperty() { - return property; - } - - - @JsonProperty(JSON_PROPERTY_PROPERTY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setProperty(String property) { - this.property = property; - } - - - /** - * Get _123number - * @return _123number - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_123NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer get123number() { - return _123number; - } - - - - - /** - * Return true if this Name object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + @JsonCreator + public Name( + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase, + @JsonProperty(JSON_PROPERTY_123NUMBER) Integer _123number) { + this(); + this.snakeCase = snakeCase; + this._123number = _123number; } - StringJoiner joiner = new StringJoiner("&"); - - // add `name` to the URL query string - if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public Name name(Integer name) { + this.name = name; + return this; } - // add `snake_case` to the URL query string - if (getSnakeCase() != null) { - joiner.add(String.format("%ssnake_case%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSnakeCase()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get name + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getName() { + return name; } - // add `property` to the URL query string - if (getProperty() != null) { - joiner.add(String.format("%sproperty%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getProperty()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(Integer name) { + this.name = name; } - // add `123Number` to the URL query string - if (get123number() != null) { - joiner.add(String.format("%s123Number%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(get123number()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get snakeCase + * + * @return snakeCase + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SNAKE_CASE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getSnakeCase() { + return snakeCase; } - return joiner.toString(); - } + public Name property(String property) { + this.property = property; + return this; + } + + /** + * Get property + * + * @return property + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getProperty() { + return property; + } + + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setProperty(String property) { + this.property = property; + } + + /** + * Get _123number + * + * @return _123number + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_123NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer get123number() { + return _123number; + } + + /** Return true if this Name object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(name, snakeCase, property, _123number); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Name {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `snake_case` to the URL query string + if (getSnakeCase() != null) { + joiner.add( + String.format( + "%ssnake_case%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getSnakeCase()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `property` to the URL query string + if (getProperty() != null) { + joiner.add( + String.format( + "%sproperty%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getProperty()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `123Number` to the URL query string + if (get123number() != null) { + joiner.add( + String.format( + "%s123Number%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(get123number()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 e4b797da53ad..6dfac3976e8a 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 @@ -3,785 +3,905 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.time.LocalDate; import java.time.OffsetDateTime; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -/** - * NullableClass - */ +/** NullableClass */ @JsonPropertyOrder({ - NullableClass.JSON_PROPERTY_INTEGER_PROP, - NullableClass.JSON_PROPERTY_NUMBER_PROP, - NullableClass.JSON_PROPERTY_BOOLEAN_PROP, - NullableClass.JSON_PROPERTY_STRING_PROP, - NullableClass.JSON_PROPERTY_DATE_PROP, - NullableClass.JSON_PROPERTY_DATETIME_PROP, - NullableClass.JSON_PROPERTY_ARRAY_NULLABLE_PROP, - NullableClass.JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, - NullableClass.JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, - NullableClass.JSON_PROPERTY_OBJECT_NULLABLE_PROP, - NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, - NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE + NullableClass.JSON_PROPERTY_INTEGER_PROP, + NullableClass.JSON_PROPERTY_NUMBER_PROP, + NullableClass.JSON_PROPERTY_BOOLEAN_PROP, + NullableClass.JSON_PROPERTY_STRING_PROP, + NullableClass.JSON_PROPERTY_DATE_PROP, + NullableClass.JSON_PROPERTY_DATETIME_PROP, + NullableClass.JSON_PROPERTY_ARRAY_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_ARRAY_ITEMS_NULLABLE, + NullableClass.JSON_PROPERTY_OBJECT_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP, + NullableClass.JSON_PROPERTY_OBJECT_ITEMS_NULLABLE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NullableClass extends HashMap { - public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; - private JsonNullable integerProp = JsonNullable.undefined(); + public static final String JSON_PROPERTY_INTEGER_PROP = "integer_prop"; + private JsonNullable integerProp = JsonNullable.undefined(); - public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; - private JsonNullable numberProp = JsonNullable.undefined(); + public static final String JSON_PROPERTY_NUMBER_PROP = "number_prop"; + private JsonNullable numberProp = JsonNullable.undefined(); - public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; - private JsonNullable booleanProp = JsonNullable.undefined(); + public static final String JSON_PROPERTY_BOOLEAN_PROP = "boolean_prop"; + private JsonNullable booleanProp = JsonNullable.undefined(); - public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; - private JsonNullable stringProp = JsonNullable.undefined(); + public static final String JSON_PROPERTY_STRING_PROP = "string_prop"; + private JsonNullable stringProp = JsonNullable.undefined(); - public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; - private JsonNullable dateProp = JsonNullable.undefined(); + public static final String JSON_PROPERTY_DATE_PROP = "date_prop"; + private JsonNullable dateProp = JsonNullable.undefined(); - public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; - private JsonNullable datetimeProp = JsonNullable.undefined(); + public static final String JSON_PROPERTY_DATETIME_PROP = "datetime_prop"; + private JsonNullable datetimeProp = JsonNullable.undefined(); - public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; - private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); + public static final String JSON_PROPERTY_ARRAY_NULLABLE_PROP = "array_nullable_prop"; + private JsonNullable> arrayNullableProp = JsonNullable.>undefined(); - public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = "array_and_items_nullable_prop"; - private JsonNullable> arrayAndItemsNullableProp = JsonNullable.>undefined(); + public static final String JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP = + "array_and_items_nullable_prop"; + private JsonNullable> arrayAndItemsNullableProp = + JsonNullable.>undefined(); - public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; - private List arrayItemsNullable = new ArrayList<>(); + public static final String JSON_PROPERTY_ARRAY_ITEMS_NULLABLE = "array_items_nullable"; + private List arrayItemsNullable = new ArrayList<>(); - public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; - private JsonNullable> objectNullableProp = JsonNullable.>undefined(); + public static final String JSON_PROPERTY_OBJECT_NULLABLE_PROP = "object_nullable_prop"; + private JsonNullable> objectNullableProp = + JsonNullable.>undefined(); - public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = "object_and_items_nullable_prop"; - private JsonNullable> objectAndItemsNullableProp = JsonNullable.>undefined(); + public static final String JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP = + "object_and_items_nullable_prop"; + private JsonNullable> objectAndItemsNullableProp = + JsonNullable.>undefined(); - public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; - private Map objectItemsNullable = new HashMap<>(); + public static final String JSON_PROPERTY_OBJECT_ITEMS_NULLABLE = "object_items_nullable"; + private Map objectItemsNullable = new HashMap<>(); - public NullableClass() { - } + public NullableClass() {} - public NullableClass integerProp(Integer integerProp) { - this.integerProp = JsonNullable.of(integerProp); - return this; - } + public NullableClass integerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + return this; + } - /** - * Get integerProp - * @return integerProp - **/ - @javax.annotation.Nullable - @JsonIgnore - - public Integer getIntegerProp() { + /** + * Get integerProp + * + * @return integerProp + */ + @javax.annotation.Nullable + @JsonIgnore + public Integer getIntegerProp() { return integerProp.orElse(null); - } + } - @JsonProperty(JSON_PROPERTY_INTEGER_PROP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getIntegerProp_JsonNullable() { + return integerProp; + } - public JsonNullable getIntegerProp_JsonNullable() { - return integerProp; - } - - @JsonProperty(JSON_PROPERTY_INTEGER_PROP) - public void setIntegerProp_JsonNullable(JsonNullable integerProp) { - this.integerProp = integerProp; - } + @JsonProperty(JSON_PROPERTY_INTEGER_PROP) + public void setIntegerProp_JsonNullable(JsonNullable integerProp) { + this.integerProp = integerProp; + } - public void setIntegerProp(Integer integerProp) { - this.integerProp = JsonNullable.of(integerProp); - } + public void setIntegerProp(Integer integerProp) { + this.integerProp = JsonNullable.of(integerProp); + } + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + return this; + } - public NullableClass numberProp(BigDecimal numberProp) { - this.numberProp = JsonNullable.of(numberProp); - return this; - } - - /** - * Get numberProp - * @return numberProp - **/ - @javax.annotation.Nullable - @JsonIgnore - - public BigDecimal getNumberProp() { + /** + * Get numberProp + * + * @return numberProp + */ + @javax.annotation.Nullable + @JsonIgnore + public BigDecimal getNumberProp() { return numberProp.orElse(null); - } + } - @JsonProperty(JSON_PROPERTY_NUMBER_PROP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getNumberProp_JsonNullable() { + return numberProp; + } - public JsonNullable getNumberProp_JsonNullable() { - return numberProp; - } - - @JsonProperty(JSON_PROPERTY_NUMBER_PROP) - public void setNumberProp_JsonNullable(JsonNullable numberProp) { - this.numberProp = numberProp; - } + @JsonProperty(JSON_PROPERTY_NUMBER_PROP) + public void setNumberProp_JsonNullable(JsonNullable numberProp) { + this.numberProp = numberProp; + } - public void setNumberProp(BigDecimal numberProp) { - this.numberProp = JsonNullable.of(numberProp); - } + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = JsonNullable.of(numberProp); + } + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + return this; + } - public NullableClass booleanProp(Boolean booleanProp) { - this.booleanProp = JsonNullable.of(booleanProp); - return this; - } - - /** - * Get booleanProp - * @return booleanProp - **/ - @javax.annotation.Nullable - @JsonIgnore - - public Boolean getBooleanProp() { + /** + * Get booleanProp + * + * @return booleanProp + */ + @javax.annotation.Nullable + @JsonIgnore + public Boolean getBooleanProp() { return booleanProp.orElse(null); - } + } - @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getBooleanProp_JsonNullable() { + return booleanProp; + } - public JsonNullable getBooleanProp_JsonNullable() { - return booleanProp; - } - - @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) - public void setBooleanProp_JsonNullable(JsonNullable booleanProp) { - this.booleanProp = booleanProp; - } + @JsonProperty(JSON_PROPERTY_BOOLEAN_PROP) + public void setBooleanProp_JsonNullable(JsonNullable booleanProp) { + this.booleanProp = booleanProp; + } - public void setBooleanProp(Boolean booleanProp) { - this.booleanProp = JsonNullable.of(booleanProp); - } + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = JsonNullable.of(booleanProp); + } + public NullableClass stringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + return this; + } - public NullableClass stringProp(String stringProp) { - this.stringProp = JsonNullable.of(stringProp); - return this; - } - - /** - * Get stringProp - * @return stringProp - **/ - @javax.annotation.Nullable - @JsonIgnore - - public String getStringProp() { + /** + * Get stringProp + * + * @return stringProp + */ + @javax.annotation.Nullable + @JsonIgnore + public String getStringProp() { return stringProp.orElse(null); - } + } - @JsonProperty(JSON_PROPERTY_STRING_PROP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_STRING_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getStringProp_JsonNullable() { + return stringProp; + } - public JsonNullable getStringProp_JsonNullable() { - return stringProp; - } - - @JsonProperty(JSON_PROPERTY_STRING_PROP) - public void setStringProp_JsonNullable(JsonNullable stringProp) { - this.stringProp = stringProp; - } + @JsonProperty(JSON_PROPERTY_STRING_PROP) + public void setStringProp_JsonNullable(JsonNullable stringProp) { + this.stringProp = stringProp; + } - public void setStringProp(String stringProp) { - this.stringProp = JsonNullable.of(stringProp); - } + public void setStringProp(String stringProp) { + this.stringProp = JsonNullable.of(stringProp); + } + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + return this; + } - public NullableClass dateProp(LocalDate dateProp) { - this.dateProp = JsonNullable.of(dateProp); - return this; - } - - /** - * Get dateProp - * @return dateProp - **/ - @javax.annotation.Nullable - @JsonIgnore - - public LocalDate getDateProp() { + /** + * Get dateProp + * + * @return dateProp + */ + @javax.annotation.Nullable + @JsonIgnore + public LocalDate getDateProp() { return dateProp.orElse(null); - } + } - @JsonProperty(JSON_PROPERTY_DATE_PROP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_DATE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDateProp_JsonNullable() { + return dateProp; + } - public JsonNullable getDateProp_JsonNullable() { - return dateProp; - } - - @JsonProperty(JSON_PROPERTY_DATE_PROP) - public void setDateProp_JsonNullable(JsonNullable dateProp) { - this.dateProp = dateProp; - } + @JsonProperty(JSON_PROPERTY_DATE_PROP) + public void setDateProp_JsonNullable(JsonNullable dateProp) { + this.dateProp = dateProp; + } - public void setDateProp(LocalDate dateProp) { - this.dateProp = JsonNullable.of(dateProp); - } + public void setDateProp(LocalDate dateProp) { + this.dateProp = JsonNullable.of(dateProp); + } + public NullableClass datetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + return this; + } - public NullableClass datetimeProp(OffsetDateTime datetimeProp) { - this.datetimeProp = JsonNullable.of(datetimeProp); - return this; - } - - /** - * Get datetimeProp - * @return datetimeProp - **/ - @javax.annotation.Nullable - @JsonIgnore - - public OffsetDateTime getDatetimeProp() { + /** + * Get datetimeProp + * + * @return datetimeProp + */ + @javax.annotation.Nullable + @JsonIgnore + public OffsetDateTime getDatetimeProp() { return datetimeProp.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_DATETIME_PROP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable getDatetimeProp_JsonNullable() { - return datetimeProp; - } - - @JsonProperty(JSON_PROPERTY_DATETIME_PROP) - public void setDatetimeProp_JsonNullable(JsonNullable datetimeProp) { - this.datetimeProp = datetimeProp; - } - - public void setDatetimeProp(OffsetDateTime datetimeProp) { - this.datetimeProp = JsonNullable.of(datetimeProp); - } - - - public NullableClass arrayNullableProp(List arrayNullableProp) { - this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); - return this; - } - - public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { - if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) { - this.arrayNullableProp = JsonNullable.>of(null); } - try { - this.arrayNullableProp.get().add(arrayNullablePropItem); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present + + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getDatetimeProp_JsonNullable() { + return datetimeProp; } - return this; - } - /** - * Get arrayNullableProp - * @return arrayNullableProp - **/ - @javax.annotation.Nullable - @JsonIgnore + @JsonProperty(JSON_PROPERTY_DATETIME_PROP) + public void setDatetimeProp_JsonNullable(JsonNullable datetimeProp) { + this.datetimeProp = datetimeProp; + } - public List getArrayNullableProp() { + public void setDatetimeProp(OffsetDateTime datetimeProp) { + this.datetimeProp = JsonNullable.of(datetimeProp); + } + + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + return this; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null || !this.arrayNullableProp.isPresent()) { + this.arrayNullableProp = JsonNullable.>of(null); + } + try { + this.arrayNullableProp.get().add(arrayNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayNullableProp + * + * @return arrayNullableProp + */ + @javax.annotation.Nullable + @JsonIgnore + public List getArrayNullableProp() { return arrayNullableProp.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable> getArrayNullableProp_JsonNullable() { - return arrayNullableProp; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) - public void setArrayNullableProp_JsonNullable(JsonNullable> arrayNullableProp) { - this.arrayNullableProp = arrayNullableProp; - } - - public void setArrayNullableProp(List arrayNullableProp) { - this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); - } - - - public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { - this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); - return this; - } - - public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { - if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) { - this.arrayAndItemsNullableProp = JsonNullable.>of(null); } - try { - this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present + + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getArrayNullableProp_JsonNullable() { + return arrayNullableProp; } - return this; - } - /** - * Get arrayAndItemsNullableProp - * @return arrayAndItemsNullableProp - **/ - @javax.annotation.Nullable - @JsonIgnore + @JsonProperty(JSON_PROPERTY_ARRAY_NULLABLE_PROP) + public void setArrayNullableProp_JsonNullable(JsonNullable> arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } - public List getArrayAndItemsNullableProp() { + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = JsonNullable.>of(arrayNullableProp); + } + + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + return this; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null || !this.arrayAndItemsNullableProp.isPresent()) { + this.arrayAndItemsNullableProp = JsonNullable.>of(null); + } + try { + this.arrayAndItemsNullableProp.get().add(arrayAndItemsNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get arrayAndItemsNullableProp + * + * @return arrayAndItemsNullableProp + */ + @javax.annotation.Nullable + @JsonIgnore + public List getArrayAndItemsNullableProp() { return arrayAndItemsNullableProp.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable> getArrayAndItemsNullableProp_JsonNullable() { - return arrayAndItemsNullableProp; - } - - @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) - public void setArrayAndItemsNullableProp_JsonNullable(JsonNullable> arrayAndItemsNullableProp) { - this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; - } - - public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { - this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); - } - - - public NullableClass arrayItemsNullable(List arrayItemsNullable) { - this.arrayItemsNullable = arrayItemsNullable; - return this; - } - - public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { - if (this.arrayItemsNullable == null) { - this.arrayItemsNullable = new ArrayList<>(); } - this.arrayItemsNullable.add(arrayItemsNullableItem); - return this; - } - /** - * Get arrayItemsNullable - * @return arrayItemsNullable - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getArrayItemsNullable() { - return arrayItemsNullable; - } - - - @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setArrayItemsNullable(List arrayItemsNullable) { - this.arrayItemsNullable = arrayItemsNullable; - } - - - public NullableClass objectNullableProp(Map objectNullableProp) { - this.objectNullableProp = JsonNullable.>of(objectNullableProp); - return this; - } - - public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { - if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) { - this.objectNullableProp = JsonNullable.>of(null); + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getArrayAndItemsNullableProp_JsonNullable() { + return arrayAndItemsNullableProp; } - try { - this.objectNullableProp.get().put(key, objectNullablePropItem); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present + + @JsonProperty(JSON_PROPERTY_ARRAY_AND_ITEMS_NULLABLE_PROP) + public void setArrayAndItemsNullableProp_JsonNullable( + JsonNullable> arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; } - return this; - } - /** - * Get objectNullableProp - * @return objectNullableProp - **/ - @javax.annotation.Nullable - @JsonIgnore + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp); + } - public Map getObjectNullableProp() { + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + /** + * Get arrayItemsNullable + * + * @return arrayItemsNullable + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ITEMS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.>of(objectNullableProp); + return this; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null || !this.objectNullableProp.isPresent()) { + this.objectNullableProp = JsonNullable.>of(null); + } + try { + this.objectNullableProp.get().put(key, objectNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get objectNullableProp + * + * @return objectNullableProp + */ + @javax.annotation.Nullable + @JsonIgnore + public Map getObjectNullableProp() { return objectNullableProp.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable> getObjectNullableProp_JsonNullable() { - return objectNullableProp; - } - - @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) - public void setObjectNullableProp_JsonNullable(JsonNullable> objectNullableProp) { - this.objectNullableProp = objectNullableProp; - } - - public void setObjectNullableProp(Map objectNullableProp) { - this.objectNullableProp = JsonNullable.>of(objectNullableProp); - } - - - public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { - this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); - return this; - } - - public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { - if (this.objectAndItemsNullableProp == null || !this.objectAndItemsNullableProp.isPresent()) { - this.objectAndItemsNullableProp = JsonNullable.>of(null); } - try { - this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem); - } catch (java.util.NoSuchElementException e) { - // this can never happen, as we make sure above that the value is present + + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getObjectNullableProp_JsonNullable() { + return objectNullableProp; } - return this; - } - /** - * Get objectAndItemsNullableProp - * @return objectAndItemsNullableProp - **/ - @javax.annotation.Nullable - @JsonIgnore + @JsonProperty(JSON_PROPERTY_OBJECT_NULLABLE_PROP) + public void setObjectNullableProp_JsonNullable( + JsonNullable> objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } - public Map getObjectAndItemsNullableProp() { + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = JsonNullable.>of(objectNullableProp); + } + + public NullableClass objectAndItemsNullableProp( + Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = + JsonNullable.>of(objectAndItemsNullableProp); + return this; + } + + public NullableClass putObjectAndItemsNullablePropItem( + String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null + || !this.objectAndItemsNullableProp.isPresent()) { + this.objectAndItemsNullableProp = JsonNullable.>of(null); + } + try { + this.objectAndItemsNullableProp.get().put(key, objectAndItemsNullablePropItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Get objectAndItemsNullableProp + * + * @return objectAndItemsNullableProp + */ + @javax.annotation.Nullable + @JsonIgnore + public Map getObjectAndItemsNullableProp() { return objectAndItemsNullableProp.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable> getObjectAndItemsNullableProp_JsonNullable() { - return objectAndItemsNullableProp; - } - - @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) - public void setObjectAndItemsNullableProp_JsonNullable(JsonNullable> objectAndItemsNullableProp) { - this.objectAndItemsNullableProp = objectAndItemsNullableProp; - } - - public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { - this.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp); - } - - - public NullableClass objectItemsNullable(Map objectItemsNullable) { - this.objectItemsNullable = objectItemsNullable; - return this; - } - - public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { - if (this.objectItemsNullable == null) { - this.objectItemsNullable = new HashMap<>(); - } - this.objectItemsNullable.put(key, objectItemsNullableItem); - return this; - } - - /** - * Get objectItemsNullable - * @return objectItemsNullable - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - - public Map getObjectItemsNullable() { - return objectItemsNullable; - } - - - @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) - @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) - public void setObjectItemsNullable(Map objectItemsNullable) { - this.objectItemsNullable = objectItemsNullable; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * @param key the name of the property - * @param value the value of the property - * @return self reference - */ - @JsonAnySetter - public NullableClass putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) properties. - * @return the additional (undeclared) properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * @param key the name of the property - * @return the additional (undeclared) property with the specified name - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** - * Return true if this NullableClass object is equal to o. - */ - @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); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @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); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NullableClass {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); - sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); - sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); - sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); - sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); - sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); - sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); - sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); - sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); - sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); - sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); - sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; } - StringJoiner joiner = new StringJoiner("&"); - - // add `integer_prop` to the URL query string - if (getIntegerProp() != null) { - joiner.add(String.format("%sinteger_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getIntegerProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getObjectAndItemsNullableProp_JsonNullable() { + return objectAndItemsNullableProp; } - // add `number_prop` to the URL query string - if (getNumberProp() != null) { - joiner.add(String.format("%snumber_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getNumberProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_OBJECT_AND_ITEMS_NULLABLE_PROP) + public void setObjectAndItemsNullableProp_JsonNullable( + JsonNullable> objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; } - // add `boolean_prop` to the URL query string - if (getBooleanProp() != null) { - joiner.add(String.format("%sboolean_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBooleanProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = + JsonNullable.>of(objectAndItemsNullableProp); } - // add `string_prop` to the URL query string - if (getStringProp() != null) { - joiner.add(String.format("%sstring_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStringProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; } - // add `date_prop` to the URL query string - if (getDateProp() != null) { - joiner.add(String.format("%sdate_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDateProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; } - // add `datetime_prop` to the URL query string - if (getDatetimeProp() != null) { - joiner.add(String.format("%sdatetime_prop%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getDatetimeProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get objectItemsNullable + * + * @return objectItemsNullable + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getObjectItemsNullable() { + return objectItemsNullable; } - // add `array_nullable_prop` to the URL query string - if (getArrayNullableProp() != null) { - for (int i = 0; i < getArrayNullableProp().size(); i++) { - joiner.add(String.format("%sarray_nullable_prop%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + @JsonProperty(JSON_PROPERTY_OBJECT_ITEMS_NULLABLE) + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; } - // add `array_and_items_nullable_prop` to the URL query string - if (getArrayAndItemsNullableProp() != null) { - for (int i = 0; i < getArrayAndItemsNullableProp().size(); i++) { - joiner.add(String.format("%sarray_and_items_nullable_prop%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayAndItemsNullableProp().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public NullableClass putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; } - // add `array_items_nullable` to the URL query string - if (getArrayItemsNullable() != null) { - for (int i = 0; i < getArrayItemsNullable().size(); i++) { - joiner.add(String.format("%sarray_items_nullable%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getArrayItemsNullable().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; } - // add `object_nullable_prop` to the URL query string - if (getObjectNullableProp() != null) { - for (String _key : getObjectNullableProp().keySet()) { - joiner.add(String.format("%sobject_nullable_prop%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getObjectNullableProp().get(_key), URLEncoder.encode(String.valueOf(getObjectNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); } - // add `object_and_items_nullable_prop` to the URL query string - if (getObjectAndItemsNullableProp() != null) { - for (String _key : getObjectAndItemsNullableProp().keySet()) { - joiner.add(String.format("%sobject_and_items_nullable_prop%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getObjectAndItemsNullableProp().get(_key), URLEncoder.encode(String.valueOf(getObjectAndItemsNullableProp().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + /** Return true if this NullableClass object is equal to o. */ + @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); } - // add `object_items_nullable` to the URL query string - if (getObjectItemsNullable() != null) { - for (String _key : getObjectItemsNullable().keySet()) { - joiner.add(String.format("%sobject_items_nullable%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, _key, containerSuffix), - getObjectItemsNullable().get(_key), URLEncoder.encode(String.valueOf(getObjectItemsNullable().get(_key)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); } - return joiner.toString(); - } + @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); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ") + .append(toIndentedString(arrayNullableProp)) + .append("\n"); + sb.append(" arrayAndItemsNullableProp: ") + .append(toIndentedString(arrayAndItemsNullableProp)) + .append("\n"); + sb.append(" arrayItemsNullable: ") + .append(toIndentedString(arrayItemsNullable)) + .append("\n"); + sb.append(" objectNullableProp: ") + .append(toIndentedString(objectNullableProp)) + .append("\n"); + sb.append(" objectAndItemsNullableProp: ") + .append(toIndentedString(objectAndItemsNullableProp)) + .append("\n"); + sb.append(" objectItemsNullable: ") + .append(toIndentedString(objectItemsNullable)) + .append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `integer_prop` to the URL query string + if (getIntegerProp() != null) { + joiner.add( + String.format( + "%sinteger_prop%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getIntegerProp()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `number_prop` to the URL query string + if (getNumberProp() != null) { + joiner.add( + String.format( + "%snumber_prop%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getNumberProp()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `boolean_prop` to the URL query string + if (getBooleanProp() != null) { + joiner.add( + String.format( + "%sboolean_prop%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getBooleanProp()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `string_prop` to the URL query string + if (getStringProp() != null) { + joiner.add( + String.format( + "%sstring_prop%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getStringProp()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `date_prop` to the URL query string + if (getDateProp() != null) { + joiner.add( + String.format( + "%sdate_prop%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getDateProp()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `datetime_prop` to the URL query string + if (getDatetimeProp() != null) { + joiner.add( + String.format( + "%sdatetime_prop%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getDatetimeProp()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `array_nullable_prop` to the URL query string + if (getArrayNullableProp() != null) { + for (int i = 0; i < getArrayNullableProp().size(); i++) { + joiner.add( + String.format( + "%sarray_nullable_prop%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getArrayNullableProp().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `array_and_items_nullable_prop` to the URL query string + if (getArrayAndItemsNullableProp() != null) { + for (int i = 0; i < getArrayAndItemsNullableProp().size(); i++) { + joiner.add( + String.format( + "%sarray_and_items_nullable_prop%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf( + getArrayAndItemsNullableProp().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `array_items_nullable` to the URL query string + if (getArrayItemsNullable() != null) { + for (int i = 0; i < getArrayItemsNullable().size(); i++) { + joiner.add( + String.format( + "%sarray_items_nullable%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getArrayItemsNullable().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `object_nullable_prop` to the URL query string + if (getObjectNullableProp() != null) { + for (String _key : getObjectNullableProp().keySet()) { + joiner.add( + String.format( + "%sobject_nullable_prop%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getObjectNullableProp().get(_key), + URLEncoder.encode( + String.valueOf(getObjectNullableProp().get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `object_and_items_nullable_prop` to the URL query string + if (getObjectAndItemsNullableProp() != null) { + for (String _key : getObjectAndItemsNullableProp().keySet()) { + joiner.add( + String.format( + "%sobject_and_items_nullable_prop%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getObjectAndItemsNullableProp().get(_key), + URLEncoder.encode( + String.valueOf( + getObjectAndItemsNullableProp().get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `object_items_nullable` to the URL query string + if (getObjectItemsNullable() != null) { + for (String _key : getObjectItemsNullable().keySet()) { + joiner.add( + String.format( + "%sobject_items_nullable%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, _key, containerSuffix), + getObjectItemsNullable().get(_key), + URLEncoder.encode( + String.valueOf(getObjectItemsNullable().get(_key)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + return joiner.toString(); + } } - 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 4c2de4a05132..7e96c25baebe 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 @@ -3,43 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Quadrilateral; -import org.openapitools.client.model.Triangle; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import com.fasterxml.jackson.core.type.TypeReference; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -54,6 +26,14 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -72,7 +52,8 @@ public class NullableShape extends AbstractOpenApiSchema { } @Override - public void serialize(NullableShape value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize(NullableShape value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { jgen.writeObject(value.getActualInstance()); } } @@ -87,7 +68,8 @@ public class NullableShape extends AbstractOpenApiSchema { } @Override - public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public NullableShape deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); @@ -97,13 +79,29 @@ public class NullableShape extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + if (Quadrilateral.class.equals(Integer.class) + || Quadrilateral.class.equals(Long.class) + || Quadrilateral.class.equals(Float.class) + || Quadrilateral.class.equals(Double.class) + || Quadrilateral.class.equals(Boolean.class) + || Quadrilateral.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Quadrilateral.class.equals(Integer.class) + || Quadrilateral.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Quadrilateral.class.equals(Float.class) + || Quadrilateral.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Quadrilateral.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Quadrilateral.class.equals(String.class) + && token == JsonToken.VALUE_STRING); attemptParsing |= (token == JsonToken.VALUE_NULL); } } @@ -124,13 +122,29 @@ public class NullableShape extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + if (Triangle.class.equals(Integer.class) + || Triangle.class.equals(Long.class) + || Triangle.class.equals(Float.class) + || Triangle.class.equals(Double.class) + || Triangle.class.equals(Boolean.class) + || Triangle.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Triangle.class.equals(Integer.class) + || Triangle.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Triangle.class.equals(Float.class) + || Triangle.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Triangle.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Triangle.class.equals(String.class) + && token == JsonToken.VALUE_STRING); attemptParsing |= (token == JsonToken.VALUE_NULL); } } @@ -152,12 +166,14 @@ public class NullableShape extends AbstractOpenApiSchema { ret.setActualInstance(deserialized); return ret; } - throw new IOException(String.format("Failed deserialization for NullableShape: %d classes match result, expected 1", match)); + throw new IOException( + String.format( + "Failed deserialization for NullableShape: %d classes match result," + + " expected 1", + match)); } - /** - * Handle deserialization of the 'null' value. - */ + /** Handle deserialization of the 'null' value. */ @Override public NullableShape getNullValue(DeserializationContext ctxt) throws JsonMappingException { return null; @@ -199,18 +215,17 @@ public class NullableShape extends AbstractOpenApiSchema { } /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * Quadrilateral, Triangle + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Quadrilateral, Triangle * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be + * a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { if (instance == null) { - super.setActualInstance(instance); - return; + super.setActualInstance(instance); + return; } if (JSON.isInstanceOf(Quadrilateral.class, instance, new HashSet>())) { @@ -227,8 +242,7 @@ public class NullableShape extends AbstractOpenApiSchema { } /** - * Get the actual instance, which can be the following: - * Quadrilateral, Triangle + * Get the actual instance, which can be the following: Quadrilateral, Triangle * * @return The actual instance (Quadrilateral, Triangle) */ @@ -245,68 +259,68 @@ public class NullableShape extends AbstractOpenApiSchema { * @throws ClassCastException if the instance is not `Quadrilateral` */ public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + return (Quadrilateral) super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, - * the ClassCastException will be thrown. + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, the + * ClassCastException will be thrown. * * @return The actual instance of `Triangle` * @throws ClassCastException if the instance is not `Triangle` */ public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + return (Triangle) super.getActualInstance(); } - - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - StringJoiner joiner = new StringJoiner("&"); - - if (getActualInstance() instanceof Triangle) { - if (getActualInstance() != null) { - joiner.add(((Triangle)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - return joiner.toString(); - } - if (getActualInstance() instanceof Quadrilateral) { - if (getActualInstance() != null) { - joiner.add(((Quadrilateral)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); - } - return joiner.toString(); - } - return null; - } + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Triangle) { + if (getActualInstance() != null) { + joiner.add( + ((Triangle) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Quadrilateral) { + if (getActualInstance() != null) { + joiner.add( + ((Quadrilateral) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } } - 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 55e6fb718226..9817f19b0a35 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 @@ -3,149 +3,139 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * NumberOnly - */ -@JsonPropertyOrder({ - NumberOnly.JSON_PROPERTY_JUST_NUMBER -}) +/** NumberOnly */ +@JsonPropertyOrder({NumberOnly.JSON_PROPERTY_JUST_NUMBER}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class NumberOnly { - public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; - private BigDecimal justNumber; + public static final String JSON_PROPERTY_JUST_NUMBER = "JustNumber"; + private BigDecimal justNumber; - public NumberOnly() { - } + public NumberOnly() {} - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getJustNumber() { - return justNumber; - } - - - @JsonProperty(JSON_PROPERTY_JUST_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - - /** - * Return true if this NumberOnly object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public NumberOnly justNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `JustNumber` to the URL query string - if (getJustNumber() != null) { - joiner.add(String.format("%sJustNumber%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getJustNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get justNumber + * + * @return justNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getJustNumber() { + return justNumber; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_JUST_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setJustNumber(BigDecimal justNumber) { + this.justNumber = justNumber; + } + + /** Return true if this NumberOnly object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(justNumber); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NumberOnly {\n"); + sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `JustNumber` to the URL query string + if (getJustNumber() != null) { + joiner.add( + String.format( + "%sJustNumber%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getJustNumber()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 febc37817e30..896c83f05d4c 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 @@ -3,278 +3,278 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import org.openapitools.client.model.DeprecatedObject; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * ObjectWithDeprecatedFields - */ +/** ObjectWithDeprecatedFields */ @JsonPropertyOrder({ - ObjectWithDeprecatedFields.JSON_PROPERTY_UUID, - ObjectWithDeprecatedFields.JSON_PROPERTY_ID, - ObjectWithDeprecatedFields.JSON_PROPERTY_DEPRECATED_REF, - ObjectWithDeprecatedFields.JSON_PROPERTY_BARS + ObjectWithDeprecatedFields.JSON_PROPERTY_UUID, + ObjectWithDeprecatedFields.JSON_PROPERTY_ID, + ObjectWithDeprecatedFields.JSON_PROPERTY_DEPRECATED_REF, + ObjectWithDeprecatedFields.JSON_PROPERTY_BARS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ObjectWithDeprecatedFields { - public static final String JSON_PROPERTY_UUID = "uuid"; - private String uuid; + public static final String JSON_PROPERTY_UUID = "uuid"; + private String uuid; - public static final String JSON_PROPERTY_ID = "id"; - private BigDecimal id; + public static final String JSON_PROPERTY_ID = "id"; + private BigDecimal id; - public static final String JSON_PROPERTY_DEPRECATED_REF = "deprecatedRef"; - private DeprecatedObject deprecatedRef; + public static final String JSON_PROPERTY_DEPRECATED_REF = "deprecatedRef"; + private DeprecatedObject deprecatedRef; - public static final String JSON_PROPERTY_BARS = "bars"; - private List bars = new ArrayList<>(); + public static final String JSON_PROPERTY_BARS = "bars"; + private List bars = new ArrayList<>(); - public ObjectWithDeprecatedFields() { - } + public ObjectWithDeprecatedFields() {} - public ObjectWithDeprecatedFields uuid(String uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getUuid() { - return uuid; - } - - - @JsonProperty(JSON_PROPERTY_UUID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUuid(String uuid) { - this.uuid = uuid; - } - - - public ObjectWithDeprecatedFields id(BigDecimal id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - * @deprecated - **/ - @Deprecated - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(BigDecimal id) { - this.id = id; - } - - - public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { - this.deprecatedRef = deprecatedRef; - return this; - } - - /** - * Get deprecatedRef - * @return deprecatedRef - * @deprecated - **/ - @Deprecated - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public DeprecatedObject getDeprecatedRef() { - return deprecatedRef; - } - - - @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDeprecatedRef(DeprecatedObject deprecatedRef) { - this.deprecatedRef = deprecatedRef; - } - - - public ObjectWithDeprecatedFields bars(List bars) { - this.bars = bars; - return this; - } - - public ObjectWithDeprecatedFields addBarsItem(String barsItem) { - if (this.bars == null) { - this.bars = new ArrayList<>(); - } - this.bars.add(barsItem); - return this; - } - - /** - * Get bars - * @return bars - * @deprecated - **/ - @Deprecated - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BARS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getBars() { - return bars; - } - - - @JsonProperty(JSON_PROPERTY_BARS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBars(List bars) { - this.bars = bars; - } - - - /** - * Return true if this ObjectWithDeprecatedFields object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, id, deprecatedRef, bars); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ObjectWithDeprecatedFields {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); - sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `uuid` to the URL query string - if (getUuid() != null) { - joiner.add(String.format("%suuid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get uuid + * + * @return uuid + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUuid() { + return uuid; } - // add `id` to the URL query string - if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_UUID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUuid(String uuid) { + this.uuid = uuid; } - // add `deprecatedRef` to the URL query string - if (getDeprecatedRef() != null) { - joiner.add(getDeprecatedRef().toUrlQueryString(prefix + "deprecatedRef" + suffix)); + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; } - // add `bars` to the URL query string - if (getBars() != null) { - for (int i = 0; i < getBars().size(); i++) { - joiner.add(String.format("%sbars%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getBars().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + /** + * Get id + * + * @return id + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getId() { + return id; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(BigDecimal id) { + this.id = id; + } + + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + /** + * Get deprecatedRef + * + * @return deprecatedRef + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + @JsonProperty(JSON_PROPERTY_DEPRECATED_REF) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + this.bars.add(barsItem); + return this; + } + + /** + * Get bars + * + * @return bars + * @deprecated + */ + @Deprecated + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getBars() { + return bars; + } + + @JsonProperty(JSON_PROPERTY_BARS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBars(List bars) { + this.bars = bars; + } + + /** Return true if this ObjectWithDeprecatedFields object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, id, deprecatedRef, bars); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `uuid` to the URL query string + if (getUuid() != null) { + joiner.add( + String.format( + "%suuid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getUuid()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `id` to the URL query string + if (getId() != null) { + joiner.add( + String.format( + "%sid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `deprecatedRef` to the URL query string + if (getDeprecatedRef() != null) { + joiner.add(getDeprecatedRef().toUrlQueryString(prefix + "deprecatedRef" + suffix)); + } + + // add `bars` to the URL query string + if (getBars() != null) { + for (int i = 0; i < getBars().size(); i++) { + joiner.add( + String.format( + "%sbars%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getBars().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + return joiner.toString(); + } } - 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 687b6b80ea32..bdea5f05f5b9 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 @@ -3,366 +3,377 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Order - */ +/** Order */ @JsonPropertyOrder({ - Order.JSON_PROPERTY_ID, - Order.JSON_PROPERTY_PET_ID, - Order.JSON_PROPERTY_QUANTITY, - Order.JSON_PROPERTY_SHIP_DATE, - Order.JSON_PROPERTY_STATUS, - Order.JSON_PROPERTY_COMPLETE + Order.JSON_PROPERTY_ID, + Order.JSON_PROPERTY_PET_ID, + Order.JSON_PROPERTY_QUANTITY, + Order.JSON_PROPERTY_SHIP_DATE, + Order.JSON_PROPERTY_STATUS, + Order.JSON_PROPERTY_COMPLETE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Order { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - public static final String JSON_PROPERTY_PET_ID = "petId"; - private Long petId; + public static final String JSON_PROPERTY_PET_ID = "petId"; + private Long petId; - public static final String JSON_PROPERTY_QUANTITY = "quantity"; - private Integer quantity; + public static final String JSON_PROPERTY_QUANTITY = "quantity"; + private Integer quantity; - public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; - private OffsetDateTime shipDate; + public static final String JSON_PROPERTY_SHIP_DATE = "shipDate"; + private OffsetDateTime shipDate; - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); + /** Order Status */ + public enum StatusEnum { + PLACED("placed"), - private String value; + APPROVED("approved"), - StatusEnum(String value) { - this.value = value; + DELIVERED("delivered"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public static final String JSON_PROPERTY_COMPLETE = "complete"; + private Boolean complete = false; + + public Order() {} + + public Order id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Order petId(Long petId) { + this.petId = petId; + return this; + } + + /** + * Get petId + * + * @return petId + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPetId() { + return petId; + } + + @JsonProperty(JSON_PROPERTY_PET_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPetId(Long petId) { + this.petId = petId; + } + + public Order quantity(Integer quantity) { + this.quantity = quantity; + return this; + } + + /** + * Get quantity + * + * @return quantity + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getQuantity() { + return quantity; + } + + @JsonProperty(JSON_PROPERTY_QUANTITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + public Order shipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + return this; + } + + /** + * Get shipDate + * + * @return shipDate + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getShipDate() { + return shipDate; + } + + @JsonProperty(JSON_PROPERTY_SHIP_DATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setShipDate(OffsetDateTime shipDate) { + this.shipDate = shipDate; + } + + public Order status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * Order Status + * + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + public Order complete(Boolean complete) { + this.complete = complete; + return this; + } + + /** + * Get complete + * + * @return complete + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getComplete() { + return complete; + } + + @JsonProperty(JSON_PROPERTY_COMPLETE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setComplete(Boolean complete) { + this.complete = complete; + } + + /** Return true if this Order object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, petId, quantity, shipDate, status, complete); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class Order {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); + sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); + sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_STATUS = "status"; - private StatusEnum status; - - public static final String JSON_PROPERTY_COMPLETE = "complete"; - private Boolean complete = false; - - public Order() { - } - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Long getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PET_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Long getPetId() { - return petId; - } - - - @JsonProperty(JSON_PROPERTY_PET_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPetId(Long petId) { - this.petId = petId; - } - - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_QUANTITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getQuantity() { - return quantity; - } - - - @JsonProperty(JSON_PROPERTY_QUANTITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SHIP_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public OffsetDateTime getShipDate() { - return shipDate; - } - - - @JsonProperty(JSON_PROPERTY_SHIP_DATE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public StatusEnum getStatus() { - return status; - } - - - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatus(StatusEnum status) { - this.status = status; - } - - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getComplete() { - return complete; - } - - - @JsonProperty(JSON_PROPERTY_COMPLETE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setComplete(Boolean complete) { - this.complete = complete; - } - - - /** - * Return true if this Order object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + return o.toString().replace("\n", "\n "); } - StringJoiner joiner = new StringJoiner("&"); - - // add `id` to the URL query string - if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - // add `petId` to the URL query string - if (getPetId() != null) { - joiner.add(String.format("%spetId%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } - // add `quantity` to the URL query string - if (getQuantity() != null) { - joiner.add(String.format("%squantity%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuantity()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + StringJoiner joiner = new StringJoiner("&"); - // add `shipDate` to the URL query string - if (getShipDate() != null) { - joiner.add(String.format("%sshipDate%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShipDate()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + // add `id` to the URL query string + if (getId() != null) { + joiner.add( + String.format( + "%sid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } - // add `status` to the URL query string - if (getStatus() != null) { - joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + // add `petId` to the URL query string + if (getPetId() != null) { + joiner.add( + String.format( + "%spetId%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getPetId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } - // add `complete` to the URL query string - if (getComplete() != null) { - joiner.add(String.format("%scomplete%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getComplete()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + // add `quantity` to the URL query string + if (getQuantity() != null) { + joiner.add( + String.format( + "%squantity%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getQuantity()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } - return joiner.toString(); - } + // add `shipDate` to the URL query string + if (getShipDate() != null) { + joiner.add( + String.format( + "%sshipDate%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getShipDate()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add( + String.format( + "%sstatus%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `complete` to the URL query string + if (getComplete() != null) { + joiner.add( + String.format( + "%scomplete%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getComplete()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 d07b2ad8c789..b1818bd2033d 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 @@ -3,221 +3,221 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.math.BigDecimal; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * OuterComposite - */ +/** OuterComposite */ @JsonPropertyOrder({ - OuterComposite.JSON_PROPERTY_MY_NUMBER, - OuterComposite.JSON_PROPERTY_MY_STRING, - OuterComposite.JSON_PROPERTY_MY_BOOLEAN + OuterComposite.JSON_PROPERTY_MY_NUMBER, + OuterComposite.JSON_PROPERTY_MY_STRING, + OuterComposite.JSON_PROPERTY_MY_BOOLEAN }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterComposite { - public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; - private BigDecimal myNumber; + public static final String JSON_PROPERTY_MY_NUMBER = "my_number"; + private BigDecimal myNumber; - public static final String JSON_PROPERTY_MY_STRING = "my_string"; - private String myString; + public static final String JSON_PROPERTY_MY_STRING = "my_string"; + private String myString; - public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; - private Boolean myBoolean; + public static final String JSON_PROPERTY_MY_BOOLEAN = "my_boolean"; + private Boolean myBoolean; - public OuterComposite() { - } + public OuterComposite() {} - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getMyNumber() { - return myNumber; - } - - - @JsonProperty(JSON_PROPERTY_MY_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getMyString() { - return myString; - } - - - @JsonProperty(JSON_PROPERTY_MY_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyString(String myString) { - this.myString = myString; - } - - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getMyBoolean() { - return myBoolean; - } - - - @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - - /** - * Return true if this OuterComposite object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public OuterComposite myNumber(BigDecimal myNumber) { + this.myNumber = myNumber; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `my_number` to the URL query string - if (getMyNumber() != null) { - joiner.add(String.format("%smy_number%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMyNumber()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get myNumber + * + * @return myNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getMyNumber() { + return myNumber; } - // add `my_string` to the URL query string - if (getMyString() != null) { - joiner.add(String.format("%smy_string%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMyString()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_MY_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyNumber(BigDecimal myNumber) { + this.myNumber = myNumber; } - // add `my_boolean` to the URL query string - if (getMyBoolean() != null) { - joiner.add(String.format("%smy_boolean%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getMyBoolean()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public OuterComposite myString(String myString) { + this.myString = myString; + return this; } - return joiner.toString(); - } + /** + * Get myString + * + * @return myString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMyString() { + return myString; + } + + @JsonProperty(JSON_PROPERTY_MY_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyString(String myString) { + this.myString = myString; + } + + public OuterComposite myBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + return this; + } + + /** + * Get myBoolean + * + * @return myBoolean + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getMyBoolean() { + return myBoolean; + } + + @JsonProperty(JSON_PROPERTY_MY_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMyBoolean(Boolean myBoolean) { + this.myBoolean = myBoolean; + } + + /** Return true if this OuterComposite object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(myNumber, myString, myBoolean); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterComposite {\n"); + sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); + sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); + sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `my_number` to the URL query string + if (getMyNumber() != null) { + joiner.add( + String.format( + "%smy_number%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getMyNumber()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `my_string` to the URL query string + if (getMyString() != null) { + joiner.add( + String.format( + "%smy_string%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getMyString()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `my_boolean` to the URL query string + if (getMyBoolean() != null) { + joiner.add( + String.format( + "%smy_boolean%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getMyBoolean()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 5fbedb0c365e..59115b83fa66 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 @@ -3,79 +3,64 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Gets or Sets OuterEnum - */ +/** Gets or Sets OuterEnum */ public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); + PLACED("placed"), - private String value; + APPROVED("approved"), - OuterEnum(String value) { - this.value = value; - } + DELIVERED("delivered"); - @JsonValue - public String getValue() { - return value; - } + private String value; - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - return null; - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - if (prefix == null) { - prefix = ""; + OuterEnum(String value) { + this.value = value; } - return String.format("%s=%s", prefix, this.toString()); - } + @JsonValue + public String getValue() { + return value; + } + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnum fromValue(String value) { + for (OuterEnum b : OuterEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } } - 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 e86f08c1b25d..24ebecb689f9 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 @@ -3,79 +3,64 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Gets or Sets OuterEnumDefaultValue - */ +/** Gets or Sets OuterEnumDefaultValue */ public enum OuterEnumDefaultValue { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); + PLACED("placed"), - private String value; + APPROVED("approved"), - OuterEnumDefaultValue(String value) { - this.value = value; - } + DELIVERED("delivered"); - @JsonValue - public String getValue() { - return value; - } + private String value; - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnumDefaultValue fromValue(String value) { - for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - if (prefix == null) { - prefix = ""; + OuterEnumDefaultValue(String value) { + this.value = value; } - return String.format("%s=%s", prefix, this.toString()); - } + @JsonValue + public String getValue() { + return value; + } + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } } - 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 6383087cc47c..515c00750a59 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 @@ -3,79 +3,64 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Gets or Sets OuterEnumInteger - */ +/** Gets or Sets OuterEnumInteger */ public enum OuterEnumInteger { - - NUMBER_0(0), - - NUMBER_1(1), - - NUMBER_2(2); + NUMBER_0(0), - private Integer value; + NUMBER_1(1), - OuterEnumInteger(Integer value) { - this.value = value; - } + NUMBER_2(2); - @JsonValue - public Integer getValue() { - return value; - } + private Integer value; - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnumInteger fromValue(Integer value) { - for (OuterEnumInteger b : OuterEnumInteger.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - if (prefix == null) { - prefix = ""; + OuterEnumInteger(Integer value) { + this.value = value; } - return String.format("%s=%s", prefix, this.toString()); - } + @JsonValue + public Integer getValue() { + return value; + } + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } } - 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 ead9d92d93b6..f89e1dcc8582 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 @@ -3,79 +3,64 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Gets or Sets OuterEnumIntegerDefaultValue - */ +/** Gets or Sets OuterEnumIntegerDefaultValue */ public enum OuterEnumIntegerDefaultValue { - - NUMBER_0(0), - - NUMBER_1(1), - - NUMBER_2(2); + NUMBER_0(0), - private Integer value; + NUMBER_1(1), - OuterEnumIntegerDefaultValue(Integer value) { - this.value = value; - } + NUMBER_2(2); - @JsonValue - public Integer getValue() { - return value; - } + private Integer value; - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnumIntegerDefaultValue fromValue(Integer value) { - for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - if (prefix == null) { - prefix = ""; + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; } - return String.format("%s=%s", prefix, this.toString()); - } + @JsonValue + public Integer getValue() { + return value; + } + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java index f19ffcca8af5..f91efcd306c8 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java @@ -3,149 +3,137 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.OuterEnumInteger; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * OuterObjectWithEnumProperty - */ -@JsonPropertyOrder({ - OuterObjectWithEnumProperty.JSON_PROPERTY_VALUE -}) +/** OuterObjectWithEnumProperty */ +@JsonPropertyOrder({OuterObjectWithEnumProperty.JSON_PROPERTY_VALUE}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class OuterObjectWithEnumProperty { - public static final String JSON_PROPERTY_VALUE = "value"; - private OuterEnumInteger value; + public static final String JSON_PROPERTY_VALUE = "value"; + private OuterEnumInteger value; - public OuterObjectWithEnumProperty() { - } + public OuterObjectWithEnumProperty() {} - public OuterObjectWithEnumProperty value(OuterEnumInteger value) { - this.value = value; - return this; - } - - /** - * Get value - * @return value - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public OuterEnumInteger getValue() { - return value; - } - - - @JsonProperty(JSON_PROPERTY_VALUE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setValue(OuterEnumInteger value) { - this.value = value; - } - - - /** - * Return true if this OuterObjectWithEnumProperty object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterObjectWithEnumProperty outerObjectWithEnumProperty = (OuterObjectWithEnumProperty) o; - return Objects.equals(this.value, outerObjectWithEnumProperty.value); - } - - @Override - public int hashCode() { - return Objects.hash(value); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterObjectWithEnumProperty {\n"); - sb.append(" value: ").append(toIndentedString(value)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `value` to the URL query string - if (getValue() != null) { - joiner.add(String.format("%svalue%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getValue()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get value + * + * @return value + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public OuterEnumInteger getValue() { + return value; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + /** Return true if this OuterObjectWithEnumProperty object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterObjectWithEnumProperty outerObjectWithEnumProperty = (OuterObjectWithEnumProperty) o; + return Objects.equals(this.value, outerObjectWithEnumProperty.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `value` to the URL query string + if (getValue() != null) { + joiner.add( + String.format( + "%svalue%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getValue()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 54215bdc6790..a941869915b2 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 @@ -3,140 +3,135 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; -import org.openapitools.client.model.GrandparentAnimal; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - - +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.StringJoiner; import org.openapitools.client.JSON; -/** - * ParentPet - */ -@JsonPropertyOrder({ -}) + +/** ParentPet */ +@JsonPropertyOrder({}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @JsonIgnoreProperties( - value = "pet_type", // ignore manually set pet_type, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the pet_type to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "pet_type", visible = true) + value = "pet_type", // ignore manually set pet_type, it will be automatically generated by + // Jackson during serialization + allowSetters = true // allows the pet_type to be set during deserialization + ) +@JsonTypeInfo( + use = JsonTypeInfo.Id.NAME, + include = JsonTypeInfo.As.PROPERTY, + property = "pet_type", + visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"), + @JsonSubTypes.Type(value = ChildCat.class, name = "ChildCat"), }) - public class ParentPet extends GrandparentAnimal { - public ParentPet() { - } + public ParentPet() {} - /** - * Return true if this ParentPet object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ParentPet {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + /** Return true if this ParentPet object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); } - StringJoiner joiner = new StringJoiner("&"); - - // add `pet_type` to the URL query string - if (getPetType() != null) { - joiner.add(String.format("%spet_type%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); } - return joiner.toString(); - } -static { - // Initialize and register the discriminator mappings. - Map> mappings = new HashMap>(); - mappings.put("ChildCat", ChildCat.class); - mappings.put("ParentPet", ParentPet.class); - JSON.registerDiscriminator(ParentPet.class, "pet_type", mappings); + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentPet {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `pet_type` to the URL query string + if (getPetType() != null) { + joiner.add( + String.format( + "%spet_type%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getPetType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } + + static { + // Initialize and register the discriminator mappings. + Map> mappings = new HashMap>(); + mappings.put("ChildCat", ChildCat.class); + mappings.put("ParentPet", ParentPet.class); + JSON.registerDiscriminator(ParentPet.class, "pet_type", mappings); + } } -} - 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 5d3fbd208eef..3d11e89f3a2d 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 @@ -3,391 +3,405 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; -import org.openapitools.client.model.Category; -import org.openapitools.client.model.Tag; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Pet - */ +/** Pet */ @JsonPropertyOrder({ - Pet.JSON_PROPERTY_ID, - Pet.JSON_PROPERTY_CATEGORY, - Pet.JSON_PROPERTY_NAME, - Pet.JSON_PROPERTY_PHOTO_URLS, - Pet.JSON_PROPERTY_TAGS, - Pet.JSON_PROPERTY_STATUS + Pet.JSON_PROPERTY_ID, + Pet.JSON_PROPERTY_CATEGORY, + Pet.JSON_PROPERTY_NAME, + Pet.JSON_PROPERTY_PHOTO_URLS, + Pet.JSON_PROPERTY_TAGS, + Pet.JSON_PROPERTY_STATUS }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Pet { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - public static final String JSON_PROPERTY_CATEGORY = "category"; - private Category category; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private Category category; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; - private List photoUrls = new ArrayList<>(); + public static final String JSON_PROPERTY_PHOTO_URLS = "photoUrls"; + private List photoUrls = new ArrayList<>(); - public static final String JSON_PROPERTY_TAGS = "tags"; - private List tags = new ArrayList<>(); + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = new ArrayList<>(); - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); + /** pet status in the store */ + public enum StatusEnum { + AVAILABLE("available"), - private String value; + PENDING("pending"), - StatusEnum(String value) { - this.value = value; + SOLD("sold"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_STATUS = "status"; + private StatusEnum status; + + public Pet() {} + + public Pet id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public Pet category(Category category) { + this.category = category; + return this; + } + + /** + * Get category + * + * @return category + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Category getCategory() { + return category; + } + + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCategory(Category category) { + this.category = category; + } + + public Pet name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setName(String name) { + this.name = name; + } + + public Pet photoUrls(List photoUrls) { + this.photoUrls = photoUrls; + return this; + } + + public Pet addPhotoUrlsItem(String photoUrlsItem) { + this.photoUrls.add(photoUrlsItem); + return this; + } + + /** + * Get photoUrls + * + * @return photoUrls + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPhotoUrls() { + return photoUrls; + } + + @JsonProperty(JSON_PROPERTY_PHOTO_URLS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setPhotoUrls(List photoUrls) { + this.photoUrls = photoUrls; + } + + public Pet tags(List tags) { + this.tags = tags; + return this; + } + + public Pet addTagsItem(Tag tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Get tags + * + * @return tags + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(List tags) { + this.tags = tags; + } + + public Pet status(StatusEnum status) { + this.status = status; + return this; + } + + /** + * pet status in the store + * + * @return status + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public StatusEnum getStatus() { + return status; + } + + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(StatusEnum status) { + this.status = status; + } + + /** Return true if this Pet object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, photoUrls, tags, status); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class Pet {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_STATUS = "status"; - private StatusEnum status; - - public Pet() { - } - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Long getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CATEGORY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Category getCategory() { - return category; - } - - - @JsonProperty(JSON_PROPERTY_CATEGORY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setCategory(Category category) { - this.category = category; - } - - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setName(String name) { - this.name = name; - } - - - public Pet photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getPhotoUrls() { - return photoUrls; - } - - - @JsonProperty(JSON_PROPERTY_PHOTO_URLS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getTags() { - return tags; - } - - - @JsonProperty(JSON_PROPERTY_TAGS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTags(List tags) { - this.tags = tags; - } - - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public StatusEnum getStatus() { - return status; - } - - - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setStatus(StatusEnum status) { - this.status = status; - } - - - /** - * Return true if this Pet object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + return o.toString().replace("\n", "\n "); } - StringJoiner joiner = new StringJoiner("&"); - - // add `id` to the URL query string - if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - // add `category` to the URL query string - if (getCategory() != null) { - joiner.add(getCategory().toUrlQueryString(prefix + "category" + suffix)); - } - - // add `name` to the URL query string - if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } - - // add `photoUrls` to the URL query string - if (getPhotoUrls() != null) { - for (int i = 0; i < getPhotoUrls().size(); i++) { - joiner.add(String.format("%sphotoUrls%s%s=%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix), - URLEncoder.encode(String.valueOf(getPhotoUrls().get(i)), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } - } - - // add `tags` to the URL query string - if (getTags() != null) { - for (int i = 0; i < getTags().size(); i++) { - if (getTags().get(i) != null) { - joiner.add(getTags().get(i).toUrlQueryString(String.format("%stags%s%s", prefix, suffix, - "".equals(suffix) ? "" : String.format("%s%d%s", containerPrefix, i, containerSuffix)))); + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - } - } - // add `status` to the URL query string - if (getStatus() != null) { - joiner.add(String.format("%sstatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + StringJoiner joiner = new StringJoiner("&"); - return joiner.toString(); - } + // add `id` to the URL query string + if (getId() != null) { + joiner.add( + String.format( + "%sid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `category` to the URL query string + if (getCategory() != null) { + joiner.add(getCategory().toUrlQueryString(prefix + "category" + suffix)); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `photoUrls` to the URL query string + if (getPhotoUrls() != null) { + for (int i = 0; i < getPhotoUrls().size(); i++) { + joiner.add( + String.format( + "%sphotoUrls%s%s=%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", containerPrefix, i, containerSuffix), + URLEncoder.encode( + String.valueOf(getPhotoUrls().get(i)), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + } + + // add `tags` to the URL query string + if (getTags() != null) { + for (int i = 0; i < getTags().size(); i++) { + if (getTags().get(i) != null) { + joiner.add( + getTags() + .get(i) + .toUrlQueryString( + String.format( + "%stags%s%s", + prefix, + suffix, + "".equals(suffix) + ? "" + : String.format( + "%s%d%s", + containerPrefix, + i, + containerSuffix)))); + } + } + } + + // add `status` to the URL query string + if (getStatus() != null) { + joiner.add( + String.format( + "%sstatus%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getStatus()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 c0da3e61f6c6..ab1f95872fd6 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 @@ -3,43 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BasquePig; -import org.openapitools.client.model.DanishPig; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import com.fasterxml.jackson.core.type.TypeReference; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -54,6 +26,14 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -72,7 +52,8 @@ public class Pig extends AbstractOpenApiSchema { } @Override - public void serialize(Pig value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize(Pig value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { jgen.writeObject(value.getActualInstance()); } } @@ -87,7 +68,8 @@ public class Pig extends AbstractOpenApiSchema { } @Override - public Pig deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public Pig deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); @@ -97,13 +79,29 @@ public class Pig extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class) || BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class) || BasquePig.class.equals(Boolean.class) || BasquePig.class.equals(String.class)) { + if (BasquePig.class.equals(Integer.class) + || BasquePig.class.equals(Long.class) + || BasquePig.class.equals(Float.class) + || BasquePig.class.equals(Double.class) + || BasquePig.class.equals(Boolean.class) + || BasquePig.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((BasquePig.class.equals(Integer.class) || BasquePig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((BasquePig.class.equals(Float.class) || BasquePig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (BasquePig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (BasquePig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((BasquePig.class.equals(Integer.class) + || BasquePig.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((BasquePig.class.equals(Float.class) + || BasquePig.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (BasquePig.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (BasquePig.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -123,13 +121,29 @@ public class Pig extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class) || DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class) || DanishPig.class.equals(Boolean.class) || DanishPig.class.equals(String.class)) { + if (DanishPig.class.equals(Integer.class) + || DanishPig.class.equals(Long.class) + || DanishPig.class.equals(Float.class) + || DanishPig.class.equals(Double.class) + || DanishPig.class.equals(Boolean.class) + || DanishPig.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((DanishPig.class.equals(Integer.class) || DanishPig.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((DanishPig.class.equals(Float.class) || DanishPig.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (DanishPig.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (DanishPig.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((DanishPig.class.equals(Integer.class) + || DanishPig.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((DanishPig.class.equals(Float.class) + || DanishPig.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (DanishPig.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (DanishPig.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -150,12 +164,13 @@ public class Pig extends AbstractOpenApiSchema { ret.setActualInstance(deserialized); return ret; } - throw new IOException(String.format("Failed deserialization for Pig: %d classes match result, expected 1", match)); + throw new IOException( + String.format( + "Failed deserialization for Pig: %d classes match result, expected 1", + match)); } - /** - * Handle deserialization of the 'null' value. - */ + /** Handle deserialization of the 'null' value. */ @Override public Pig getNullValue(DeserializationContext ctxt) throws JsonMappingException { throw new JsonMappingException(ctxt.getParser(), "Pig cannot be null"); @@ -197,12 +212,11 @@ public class Pig extends AbstractOpenApiSchema { } /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * BasquePig, DanishPig + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: BasquePig, DanishPig * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be + * a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { @@ -220,8 +234,7 @@ public class Pig extends AbstractOpenApiSchema { } /** - * Get the actual instance, which can be the following: - * BasquePig, DanishPig + * Get the actual instance, which can be the following: BasquePig, DanishPig * * @return The actual instance (BasquePig, DanishPig) */ @@ -231,75 +244,75 @@ public class Pig extends AbstractOpenApiSchema { } /** - * Get the actual instance of `BasquePig`. If the actual instance is not `BasquePig`, - * the ClassCastException will be thrown. + * Get the actual instance of `BasquePig`. If the actual instance is not `BasquePig`, the + * ClassCastException will be thrown. * * @return The actual instance of `BasquePig` * @throws ClassCastException if the instance is not `BasquePig` */ public BasquePig getBasquePig() throws ClassCastException { - return (BasquePig)super.getActualInstance(); + return (BasquePig) super.getActualInstance(); } /** - * Get the actual instance of `DanishPig`. If the actual instance is not `DanishPig`, - * the ClassCastException will be thrown. + * Get the actual instance of `DanishPig`. If the actual instance is not `DanishPig`, the + * ClassCastException will be thrown. * * @return The actual instance of `DanishPig` * @throws ClassCastException if the instance is not `DanishPig` */ public DanishPig getDanishPig() throws ClassCastException { - return (DanishPig)super.getActualInstance(); + return (DanishPig) super.getActualInstance(); } - - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - StringJoiner joiner = new StringJoiner("&"); - - if (getActualInstance() instanceof BasquePig) { - if (getActualInstance() != null) { - joiner.add(((BasquePig)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - return joiner.toString(); - } - if (getActualInstance() instanceof DanishPig) { - if (getActualInstance() != null) { - joiner.add(((DanishPig)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); - } - return joiner.toString(); - } - return null; - } + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof BasquePig) { + if (getActualInstance() != null) { + joiner.add( + ((BasquePig) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof DanishPig) { + if (getActualInstance() != null) { + joiner.add( + ((DanishPig) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } } - 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 de13bf88dc1e..f3a9dda9b76c 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 @@ -3,43 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ComplexQuadrilateral; -import org.openapitools.client.model.SimpleQuadrilateral; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import com.fasterxml.jackson.core.type.TypeReference; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -54,6 +26,14 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -72,7 +52,8 @@ public class Quadrilateral extends AbstractOpenApiSchema { } @Override - public void serialize(Quadrilateral value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize(Quadrilateral value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { jgen.writeObject(value.getActualInstance()); } } @@ -87,7 +68,8 @@ public class Quadrilateral extends AbstractOpenApiSchema { } @Override - public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public Quadrilateral deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); @@ -97,17 +79,34 @@ public class Quadrilateral extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class) || ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class) || ComplexQuadrilateral.class.equals(Boolean.class) || ComplexQuadrilateral.class.equals(String.class)) { + if (ComplexQuadrilateral.class.equals(Integer.class) + || ComplexQuadrilateral.class.equals(Long.class) + || ComplexQuadrilateral.class.equals(Float.class) + || ComplexQuadrilateral.class.equals(Double.class) + || ComplexQuadrilateral.class.equals(Boolean.class) + || ComplexQuadrilateral.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((ComplexQuadrilateral.class.equals(Integer.class) || ComplexQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((ComplexQuadrilateral.class.equals(Float.class) || ComplexQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (ComplexQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (ComplexQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((ComplexQuadrilateral.class.equals(Integer.class) + || ComplexQuadrilateral.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ComplexQuadrilateral.class.equals(Float.class) + || ComplexQuadrilateral.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (ComplexQuadrilateral.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ComplexQuadrilateral.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); + deserialized = + tree.traverse(jp.getCodec()).readValueAs(ComplexQuadrilateral.class); // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON // validation, which means the 'match' count may be higher than it should be. @@ -123,17 +122,34 @@ public class Quadrilateral extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class) || SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class) || SimpleQuadrilateral.class.equals(Boolean.class) || SimpleQuadrilateral.class.equals(String.class)) { + if (SimpleQuadrilateral.class.equals(Integer.class) + || SimpleQuadrilateral.class.equals(Long.class) + || SimpleQuadrilateral.class.equals(Float.class) + || SimpleQuadrilateral.class.equals(Double.class) + || SimpleQuadrilateral.class.equals(Boolean.class) + || SimpleQuadrilateral.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((SimpleQuadrilateral.class.equals(Integer.class) || SimpleQuadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((SimpleQuadrilateral.class.equals(Float.class) || SimpleQuadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (SimpleQuadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (SimpleQuadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((SimpleQuadrilateral.class.equals(Integer.class) + || SimpleQuadrilateral.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SimpleQuadrilateral.class.equals(Float.class) + || SimpleQuadrilateral.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (SimpleQuadrilateral.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SimpleQuadrilateral.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); + deserialized = + tree.traverse(jp.getCodec()).readValueAs(SimpleQuadrilateral.class); // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON // validation, which means the 'match' count may be higher than it should be. @@ -150,12 +166,14 @@ public class Quadrilateral extends AbstractOpenApiSchema { ret.setActualInstance(deserialized); return ret; } - throw new IOException(String.format("Failed deserialization for Quadrilateral: %d classes match result, expected 1", match)); + throw new IOException( + String.format( + "Failed deserialization for Quadrilateral: %d classes match result," + + " expected 1", + match)); } - /** - * Handle deserialization of the 'null' value. - */ + /** Handle deserialization of the 'null' value. */ @Override public Quadrilateral getNullValue(DeserializationContext ctxt) throws JsonMappingException { throw new JsonMappingException(ctxt.getParser(), "Quadrilateral cannot be null"); @@ -197,12 +215,11 @@ public class Quadrilateral extends AbstractOpenApiSchema { } /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * ComplexQuadrilateral, SimpleQuadrilateral + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: ComplexQuadrilateral, SimpleQuadrilateral * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be + * a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { @@ -216,12 +233,13 @@ public class Quadrilateral extends AbstractOpenApiSchema { return; } - throw new RuntimeException("Invalid instance type. Must be ComplexQuadrilateral, SimpleQuadrilateral"); + throw new RuntimeException( + "Invalid instance type. Must be ComplexQuadrilateral, SimpleQuadrilateral"); } /** - * Get the actual instance, which can be the following: - * ComplexQuadrilateral, SimpleQuadrilateral + * Get the actual instance, which can be the following: ComplexQuadrilateral, + * SimpleQuadrilateral * * @return The actual instance (ComplexQuadrilateral, SimpleQuadrilateral) */ @@ -231,75 +249,75 @@ public class Quadrilateral extends AbstractOpenApiSchema { } /** - * Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not `ComplexQuadrilateral`, - * the ClassCastException will be thrown. + * Get the actual instance of `ComplexQuadrilateral`. If the actual instance is not + * `ComplexQuadrilateral`, the ClassCastException will be thrown. * * @return The actual instance of `ComplexQuadrilateral` * @throws ClassCastException if the instance is not `ComplexQuadrilateral` */ public ComplexQuadrilateral getComplexQuadrilateral() throws ClassCastException { - return (ComplexQuadrilateral)super.getActualInstance(); + return (ComplexQuadrilateral) super.getActualInstance(); } /** - * Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not `SimpleQuadrilateral`, - * the ClassCastException will be thrown. + * Get the actual instance of `SimpleQuadrilateral`. If the actual instance is not + * `SimpleQuadrilateral`, the ClassCastException will be thrown. * * @return The actual instance of `SimpleQuadrilateral` * @throws ClassCastException if the instance is not `SimpleQuadrilateral` */ public SimpleQuadrilateral getSimpleQuadrilateral() throws ClassCastException { - return (SimpleQuadrilateral)super.getActualInstance(); + return (SimpleQuadrilateral) super.getActualInstance(); } - - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - StringJoiner joiner = new StringJoiner("&"); - - if (getActualInstance() instanceof SimpleQuadrilateral) { - if (getActualInstance() != null) { - joiner.add(((SimpleQuadrilateral)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - return joiner.toString(); - } - if (getActualInstance() instanceof ComplexQuadrilateral) { - if (getActualInstance() != null) { - joiner.add(((ComplexQuadrilateral)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); - } - return joiner.toString(); - } - return null; - } + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof SimpleQuadrilateral) { + if (getActualInstance() != null) { + joiner.add( + ((SimpleQuadrilateral) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ComplexQuadrilateral) { + if (getActualInstance() != null) { + joiner.add( + ((ComplexQuadrilateral) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } } - 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 69e208f287c5..8a52d3fe3c92 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 @@ -3,148 +3,141 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * QuadrilateralInterface - */ -@JsonPropertyOrder({ - QuadrilateralInterface.JSON_PROPERTY_QUADRILATERAL_TYPE -}) +/** QuadrilateralInterface */ +@JsonPropertyOrder({QuadrilateralInterface.JSON_PROPERTY_QUADRILATERAL_TYPE}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class QuadrilateralInterface { - public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; - private String quadrilateralType; + public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + private String quadrilateralType; - public QuadrilateralInterface() { - } + public QuadrilateralInterface() {} - public QuadrilateralInterface quadrilateralType(String quadrilateralType) { - this.quadrilateralType = quadrilateralType; - return this; - } - - /** - * Get quadrilateralType - * @return quadrilateralType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getQuadrilateralType() { - return quadrilateralType; - } - - - @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setQuadrilateralType(String quadrilateralType) { - this.quadrilateralType = quadrilateralType; - } - - - /** - * Return true if this QuadrilateralInterface object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(quadrilateralType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class QuadrilateralInterface {\n"); - sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public QuadrilateralInterface quadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `quadrilateralType` to the URL query string - if (getQuadrilateralType() != null) { - joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get quadrilateralType + * + * @return quadrilateralType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuadrilateralType() { + return quadrilateralType; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + /** Return true if this QuadrilateralInterface object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(quadrilateralType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QuadrilateralInterface {\n"); + sb.append(" quadrilateralType: ") + .append(toIndentedString(quadrilateralType)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `quadrilateralType` to the URL query string + if (getQuadrilateralType() != null) { + joiner.add( + String.format( + "%squadrilateralType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getQuadrilateralType()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 8b8b6d78ce76..5aad8b6686f9 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 @@ -3,182 +3,172 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * ReadOnlyFirst - */ -@JsonPropertyOrder({ - ReadOnlyFirst.JSON_PROPERTY_BAR, - ReadOnlyFirst.JSON_PROPERTY_BAZ -}) +/** ReadOnlyFirst */ +@JsonPropertyOrder({ReadOnlyFirst.JSON_PROPERTY_BAR, ReadOnlyFirst.JSON_PROPERTY_BAZ}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ReadOnlyFirst { - public static final String JSON_PROPERTY_BAR = "bar"; - private String bar; + public static final String JSON_PROPERTY_BAR = "bar"; + private String bar; - public static final String JSON_PROPERTY_BAZ = "baz"; - private String baz; + public static final String JSON_PROPERTY_BAZ = "baz"; + private String baz; - public ReadOnlyFirst() { - } + public ReadOnlyFirst() {} - @JsonCreator - public ReadOnlyFirst( - @JsonProperty(JSON_PROPERTY_BAR) String bar - ) { - this(); - this.bar = bar; - } - - /** - * Get bar - * @return bar - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BAR) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getBar() { - return bar; - } - - - - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BAZ) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getBaz() { - return baz; - } - - - @JsonProperty(JSON_PROPERTY_BAZ) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setBaz(String baz) { - this.baz = baz; - } - - - /** - * Return true if this ReadOnlyFirst object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + @JsonCreator + public ReadOnlyFirst(@JsonProperty(JSON_PROPERTY_BAR) String bar) { + this(); + this.bar = bar; } - StringJoiner joiner = new StringJoiner("&"); - - // add `bar` to the URL query string - if (getBar() != null) { - joiner.add(String.format("%sbar%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get bar + * + * @return bar + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BAR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBar() { + return bar; } - // add `baz` to the URL query string - if (getBaz() != null) { - joiner.add(String.format("%sbaz%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getBaz()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public ReadOnlyFirst baz(String baz) { + this.baz = baz; + return this; } - return joiner.toString(); - } + /** + * Get baz + * + * @return baz + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getBaz() { + return baz; + } + + @JsonProperty(JSON_PROPERTY_BAZ) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setBaz(String baz) { + this.baz = baz; + } + + /** Return true if this ReadOnlyFirst object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(bar, baz); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReadOnlyFirst {\n"); + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); + sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `bar` to the URL query string + if (getBar() != null) { + joiner.add( + String.format( + "%sbar%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getBar()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `baz` to the URL query string + if (getBaz() != null) { + joiner.add( + String.format( + "%sbaz%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getBaz()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 ab3cf721c00e..767a5d58349e 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 @@ -3,184 +3,182 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * ScaleneTriangle - */ +/** ScaleneTriangle */ @JsonPropertyOrder({ - ScaleneTriangle.JSON_PROPERTY_SHAPE_TYPE, - ScaleneTriangle.JSON_PROPERTY_TRIANGLE_TYPE + ScaleneTriangle.JSON_PROPERTY_SHAPE_TYPE, + ScaleneTriangle.JSON_PROPERTY_TRIANGLE_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ScaleneTriangle { - public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - private String shapeType; + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; - public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; - private String triangleType; + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + private String triangleType; - public ScaleneTriangle() { - } + public ScaleneTriangle() {} - public ScaleneTriangle shapeType(String shapeType) { - this.shapeType = shapeType; - return this; - } - - /** - * Get shapeType - * @return shapeType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getShapeType() { - return shapeType; - } - - - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(String shapeType) { - this.shapeType = shapeType; - } - - - public ScaleneTriangle triangleType(String triangleType) { - this.triangleType = triangleType; - return this; - } - - /** - * Get triangleType - * @return triangleType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getTriangleType() { - return triangleType; - } - - - @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriangleType(String triangleType) { - this.triangleType = triangleType; - } - - - /** - * Return true if this ScaleneTriangle object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(shapeType, triangleType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ScaleneTriangle {\n"); - sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); - sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ScaleneTriangle shapeType(String shapeType) { + this.shapeType = shapeType; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `shapeType` to the URL query string - if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get shapeType + * + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; } - // add `triangleType` to the URL query string - if (getTriangleType() != null) { - joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(String shapeType) { + this.shapeType = shapeType; } - return joiner.toString(); - } + public ScaleneTriangle triangleType(String triangleType) { + this.triangleType = triangleType; + return this; + } + + /** + * Get triangleType + * + * @return triangleType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriangleType() { + return triangleType; + } + + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + /** Return true if this ScaleneTriangle object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, triangleType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ScaleneTriangle {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add( + String.format( + "%sshapeType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getShapeType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `triangleType` to the URL query string + if (getTriangleType() != null) { + joiner.add( + String.format( + "%striangleType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getTriangleType()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 9dd1b5154b94..9e2f84125828 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 @@ -3,43 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Quadrilateral; -import org.openapitools.client.model.Triangle; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import com.fasterxml.jackson.core.type.TypeReference; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -54,6 +26,14 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -72,7 +52,8 @@ public class Shape extends AbstractOpenApiSchema { } @Override - public void serialize(Shape value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize(Shape value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { jgen.writeObject(value.getActualInstance()); } } @@ -87,7 +68,8 @@ public class Shape extends AbstractOpenApiSchema { } @Override - public Shape deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public Shape deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); @@ -97,13 +79,29 @@ public class Shape extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + if (Quadrilateral.class.equals(Integer.class) + || Quadrilateral.class.equals(Long.class) + || Quadrilateral.class.equals(Float.class) + || Quadrilateral.class.equals(Double.class) + || Quadrilateral.class.equals(Boolean.class) + || Quadrilateral.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Quadrilateral.class.equals(Integer.class) + || Quadrilateral.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Quadrilateral.class.equals(Float.class) + || Quadrilateral.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Quadrilateral.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Quadrilateral.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -123,13 +121,29 @@ public class Shape extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + if (Triangle.class.equals(Integer.class) + || Triangle.class.equals(Long.class) + || Triangle.class.equals(Float.class) + || Triangle.class.equals(Double.class) + || Triangle.class.equals(Boolean.class) + || Triangle.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Triangle.class.equals(Integer.class) + || Triangle.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Triangle.class.equals(Float.class) + || Triangle.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Triangle.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Triangle.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -150,12 +164,13 @@ public class Shape extends AbstractOpenApiSchema { ret.setActualInstance(deserialized); return ret; } - throw new IOException(String.format("Failed deserialization for Shape: %d classes match result, expected 1", match)); + throw new IOException( + String.format( + "Failed deserialization for Shape: %d classes match result, expected 1", + match)); } - /** - * Handle deserialization of the 'null' value. - */ + /** Handle deserialization of the 'null' value. */ @Override public Shape getNullValue(DeserializationContext ctxt) throws JsonMappingException { throw new JsonMappingException(ctxt.getParser(), "Shape cannot be null"); @@ -197,12 +212,11 @@ public class Shape extends AbstractOpenApiSchema { } /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * Quadrilateral, Triangle + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Quadrilateral, Triangle * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be + * a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { @@ -220,8 +234,7 @@ public class Shape extends AbstractOpenApiSchema { } /** - * Get the actual instance, which can be the following: - * Quadrilateral, Triangle + * Get the actual instance, which can be the following: Quadrilateral, Triangle * * @return The actual instance (Quadrilateral, Triangle) */ @@ -238,68 +251,68 @@ public class Shape extends AbstractOpenApiSchema { * @throws ClassCastException if the instance is not `Quadrilateral` */ public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + return (Quadrilateral) super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, - * the ClassCastException will be thrown. + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, the + * ClassCastException will be thrown. * * @return The actual instance of `Triangle` * @throws ClassCastException if the instance is not `Triangle` */ public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + return (Triangle) super.getActualInstance(); } - - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - StringJoiner joiner = new StringJoiner("&"); - - if (getActualInstance() instanceof Triangle) { - if (getActualInstance() != null) { - joiner.add(((Triangle)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - return joiner.toString(); - } - if (getActualInstance() instanceof Quadrilateral) { - if (getActualInstance() != null) { - joiner.add(((Quadrilateral)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); - } - return joiner.toString(); - } - return null; - } + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Triangle) { + if (getActualInstance() != null) { + joiner.add( + ((Triangle) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Quadrilateral) { + if (getActualInstance() != null) { + joiner.add( + ((Quadrilateral) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } } - 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 e552937f170b..9c4bf2b82710 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 @@ -3,148 +3,138 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * ShapeInterface - */ -@JsonPropertyOrder({ - ShapeInterface.JSON_PROPERTY_SHAPE_TYPE -}) +/** ShapeInterface */ +@JsonPropertyOrder({ShapeInterface.JSON_PROPERTY_SHAPE_TYPE}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class ShapeInterface { - public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - private String shapeType; + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; - public ShapeInterface() { - } + public ShapeInterface() {} - public ShapeInterface shapeType(String shapeType) { - this.shapeType = shapeType; - return this; - } - - /** - * Get shapeType - * @return shapeType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getShapeType() { - return shapeType; - } - - - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(String shapeType) { - this.shapeType = shapeType; - } - - - /** - * Return true if this ShapeInterface object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(shapeType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ShapeInterface {\n"); - sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public ShapeInterface shapeType(String shapeType) { + this.shapeType = shapeType; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `shapeType` to the URL query string - if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get shapeType + * + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(String shapeType) { + this.shapeType = shapeType; + } + + /** Return true if this ShapeInterface object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ShapeInterface {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add( + String.format( + "%sshapeType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getShapeType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 fa4b8a0ed59a..dedb71a7e442 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 @@ -3,43 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Quadrilateral; -import org.openapitools.client.model.Triangle; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import com.fasterxml.jackson.core.type.TypeReference; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -54,6 +26,14 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -72,7 +52,8 @@ public class ShapeOrNull extends AbstractOpenApiSchema { } @Override - public void serialize(ShapeOrNull value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize(ShapeOrNull value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { jgen.writeObject(value.getActualInstance()); } } @@ -87,7 +68,8 @@ public class ShapeOrNull extends AbstractOpenApiSchema { } @Override - public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public ShapeOrNull deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); @@ -97,13 +79,29 @@ public class ShapeOrNull extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class) || Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class) || Quadrilateral.class.equals(Boolean.class) || Quadrilateral.class.equals(String.class)) { + if (Quadrilateral.class.equals(Integer.class) + || Quadrilateral.class.equals(Long.class) + || Quadrilateral.class.equals(Float.class) + || Quadrilateral.class.equals(Double.class) + || Quadrilateral.class.equals(Boolean.class) + || Quadrilateral.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Quadrilateral.class.equals(Integer.class) || Quadrilateral.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Quadrilateral.class.equals(Float.class) || Quadrilateral.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Quadrilateral.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Quadrilateral.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Quadrilateral.class.equals(Integer.class) + || Quadrilateral.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Quadrilateral.class.equals(Float.class) + || Quadrilateral.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Quadrilateral.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Quadrilateral.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -123,13 +121,29 @@ public class ShapeOrNull extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class) || Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class) || Triangle.class.equals(Boolean.class) || Triangle.class.equals(String.class)) { + if (Triangle.class.equals(Integer.class) + || Triangle.class.equals(Long.class) + || Triangle.class.equals(Float.class) + || Triangle.class.equals(Double.class) + || Triangle.class.equals(Boolean.class) + || Triangle.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((Triangle.class.equals(Integer.class) || Triangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((Triangle.class.equals(Float.class) || Triangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (Triangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (Triangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((Triangle.class.equals(Integer.class) + || Triangle.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Triangle.class.equals(Float.class) + || Triangle.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (Triangle.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Triangle.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -150,12 +164,14 @@ public class ShapeOrNull extends AbstractOpenApiSchema { ret.setActualInstance(deserialized); return ret; } - throw new IOException(String.format("Failed deserialization for ShapeOrNull: %d classes match result, expected 1", match)); + throw new IOException( + String.format( + "Failed deserialization for ShapeOrNull: %d classes match result," + + " expected 1", + match)); } - /** - * Handle deserialization of the 'null' value. - */ + /** Handle deserialization of the 'null' value. */ @Override public ShapeOrNull getNullValue(DeserializationContext ctxt) throws JsonMappingException { throw new JsonMappingException(ctxt.getParser(), "ShapeOrNull cannot be null"); @@ -197,12 +213,11 @@ public class ShapeOrNull extends AbstractOpenApiSchema { } /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * Quadrilateral, Triangle + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Quadrilateral, Triangle * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be + * a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { @@ -220,8 +235,7 @@ public class ShapeOrNull extends AbstractOpenApiSchema { } /** - * Get the actual instance, which can be the following: - * Quadrilateral, Triangle + * Get the actual instance, which can be the following: Quadrilateral, Triangle * * @return The actual instance (Quadrilateral, Triangle) */ @@ -238,68 +252,68 @@ public class ShapeOrNull extends AbstractOpenApiSchema { * @throws ClassCastException if the instance is not `Quadrilateral` */ public Quadrilateral getQuadrilateral() throws ClassCastException { - return (Quadrilateral)super.getActualInstance(); + return (Quadrilateral) super.getActualInstance(); } /** - * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, - * the ClassCastException will be thrown. + * Get the actual instance of `Triangle`. If the actual instance is not `Triangle`, the + * ClassCastException will be thrown. * * @return The actual instance of `Triangle` * @throws ClassCastException if the instance is not `Triangle` */ public Triangle getTriangle() throws ClassCastException { - return (Triangle)super.getActualInstance(); + return (Triangle) super.getActualInstance(); } - - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - StringJoiner joiner = new StringJoiner("&"); - - if (getActualInstance() instanceof Triangle) { - if (getActualInstance() != null) { - joiner.add(((Triangle)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - return joiner.toString(); - } - if (getActualInstance() instanceof Quadrilateral) { - if (getActualInstance() != null) { - joiner.add(((Quadrilateral)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); - } - return joiner.toString(); - } - return null; - } + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof Triangle) { + if (getActualInstance() != null) { + joiner.add( + ((Triangle) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof Quadrilateral) { + if (getActualInstance() != null) { + joiner.add( + ((Quadrilateral) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + return null; + } } - 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 79ec27654494..b30457403512 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 @@ -3,184 +3,184 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * SimpleQuadrilateral - */ +/** SimpleQuadrilateral */ @JsonPropertyOrder({ - SimpleQuadrilateral.JSON_PROPERTY_SHAPE_TYPE, - SimpleQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE + SimpleQuadrilateral.JSON_PROPERTY_SHAPE_TYPE, + SimpleQuadrilateral.JSON_PROPERTY_QUADRILATERAL_TYPE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SimpleQuadrilateral { - public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; - private String shapeType; + public static final String JSON_PROPERTY_SHAPE_TYPE = "shapeType"; + private String shapeType; - public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; - private String quadrilateralType; + public static final String JSON_PROPERTY_QUADRILATERAL_TYPE = "quadrilateralType"; + private String quadrilateralType; - public SimpleQuadrilateral() { - } + public SimpleQuadrilateral() {} - public SimpleQuadrilateral shapeType(String shapeType) { - this.shapeType = shapeType; - return this; - } - - /** - * Get shapeType - * @return shapeType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getShapeType() { - return shapeType; - } - - - @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setShapeType(String shapeType) { - this.shapeType = shapeType; - } - - - public SimpleQuadrilateral quadrilateralType(String quadrilateralType) { - this.quadrilateralType = quadrilateralType; - return this; - } - - /** - * Get quadrilateralType - * @return quadrilateralType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getQuadrilateralType() { - return quadrilateralType; - } - - - @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setQuadrilateralType(String quadrilateralType) { - this.quadrilateralType = quadrilateralType; - } - - - /** - * Return true if this SimpleQuadrilateral object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(shapeType, quadrilateralType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SimpleQuadrilateral {\n"); - sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); - sb.append(" quadrilateralType: ").append(toIndentedString(quadrilateralType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public SimpleQuadrilateral shapeType(String shapeType) { + this.shapeType = shapeType; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `shapeType` to the URL query string - if (getShapeType() != null) { - joiner.add(String.format("%sshapeType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getShapeType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get shapeType + * + * @return shapeType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getShapeType() { + return shapeType; } - // add `quadrilateralType` to the URL query string - if (getQuadrilateralType() != null) { - joiner.add(String.format("%squadrilateralType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getQuadrilateralType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_SHAPE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setShapeType(String shapeType) { + this.shapeType = shapeType; } - return joiner.toString(); - } + public SimpleQuadrilateral quadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + return this; + } + + /** + * Get quadrilateralType + * + * @return quadrilateralType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQuadrilateralType() { + return quadrilateralType; + } + + @JsonProperty(JSON_PROPERTY_QUADRILATERAL_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setQuadrilateralType(String quadrilateralType) { + this.quadrilateralType = quadrilateralType; + } + + /** Return true if this SimpleQuadrilateral object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(shapeType, quadrilateralType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SimpleQuadrilateral {\n"); + sb.append(" shapeType: ").append(toIndentedString(shapeType)).append("\n"); + sb.append(" quadrilateralType: ") + .append(toIndentedString(quadrilateralType)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `shapeType` to the URL query string + if (getShapeType() != null) { + joiner.add( + String.format( + "%sshapeType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getShapeType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `quadrilateralType` to the URL query string + if (getQuadrilateralType() != null) { + joiner.add( + String.format( + "%squadrilateralType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getQuadrilateralType()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SingleRefType.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SingleRefType.java index ecb7c2704433..596c1859f605 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SingleRefType.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/SingleRefType.java @@ -3,77 +3,62 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -/** - * Gets or Sets SingleRefType - */ +/** Gets or Sets SingleRefType */ public enum SingleRefType { - - ADMIN("admin"), - - USER("user"); + ADMIN("admin"), - private String value; + USER("user"); - SingleRefType(String value) { - this.value = value; - } + private String value; - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static SingleRefType fromValue(String value) { - for (SingleRefType b : SingleRefType.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - if (prefix == null) { - prefix = ""; + SingleRefType(String value) { + this.value = value; } - return String.format("%s=%s", prefix, this.toString()); - } + @JsonValue + public String getValue() { + return value; + } + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String value) { + for (SingleRefType b : SingleRefType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + if (prefix == null) { + prefix = ""; + } + + return String.format("%s=%s", prefix, this.toString()); + } } - 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 09c88d3561b5..8133d25bb56b 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 @@ -3,184 +3,185 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * SpecialModelName - */ +/** SpecialModelName */ @JsonPropertyOrder({ - SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, - SpecialModelName.JSON_PROPERTY_SPECIAL_MODEL_NAME + SpecialModelName.JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME, + SpecialModelName.JSON_PROPERTY_SPECIAL_MODEL_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class SpecialModelName { - public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; - private Long $specialPropertyName; + public static final String JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME = "$special[property.name]"; + private Long $specialPropertyName; - public static final String JSON_PROPERTY_SPECIAL_MODEL_NAME = "_special_model.name_"; - private String specialModelName; + public static final String JSON_PROPERTY_SPECIAL_MODEL_NAME = "_special_model.name_"; + private String specialModelName; - public SpecialModelName() { - } + public SpecialModelName() {} - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - - @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - - public SpecialModelName specialModelName(String specialModelName) { - this.specialModelName = specialModelName; - return this; - } - - /** - * Get specialModelName - * @return specialModelName - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SPECIAL_MODEL_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getSpecialModelName() { - return specialModelName; - } - - - @JsonProperty(JSON_PROPERTY_SPECIAL_MODEL_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSpecialModelName(String specialModelName) { - this.specialModelName = specialModelName; - } - - - /** - * Return true if this _special_model.name_ object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName, specialModelName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append(" specialModelName: ").append(toIndentedString(specialModelName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public SpecialModelName $specialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `$special[property.name]` to the URL query string - if (get$SpecialPropertyName() != null) { - joiner.add(String.format("%s$special[property.name]%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(get$SpecialPropertyName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get $specialPropertyName + * + * @return $specialPropertyName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long get$SpecialPropertyName() { + return $specialPropertyName; } - // add `_special_model.name_` to the URL query string - if (getSpecialModelName() != null) { - joiner.add(String.format("%s_special_model.name_%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getSpecialModelName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_$_SPECIAL_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void set$SpecialPropertyName(Long $specialPropertyName) { + this.$specialPropertyName = $specialPropertyName; } - return joiner.toString(); - } + public SpecialModelName specialModelName(String specialModelName) { + this.specialModelName = specialModelName; + return this; + } + + /** + * Get specialModelName + * + * @return specialModelName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SPECIAL_MODEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSpecialModelName() { + return specialModelName; + } + + @JsonProperty(JSON_PROPERTY_SPECIAL_MODEL_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSpecialModelName(String specialModelName) { + this.specialModelName = specialModelName; + } + + /** Return true if this _special_model.name_ object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash($specialPropertyName, specialModelName); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SpecialModelName {\n"); + sb.append(" $specialPropertyName: ") + .append(toIndentedString($specialPropertyName)) + .append("\n"); + sb.append(" specialModelName: ").append(toIndentedString(specialModelName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `$special[property.name]` to the URL query string + if (get$SpecialPropertyName() != null) { + joiner.add( + String.format( + "%s$special[property.name]%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(get$SpecialPropertyName()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `_special_model.name_` to the URL query string + if (getSpecialModelName() != null) { + joiner.add( + String.format( + "%s_special_model.name_%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getSpecialModelName()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 e0af338ffba5..32e659fd5f50 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 @@ -3,184 +3,175 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Tag - */ -@JsonPropertyOrder({ - Tag.JSON_PROPERTY_ID, - Tag.JSON_PROPERTY_NAME -}) +/** Tag */ +@JsonPropertyOrder({Tag.JSON_PROPERTY_ID, Tag.JSON_PROPERTY_NAME}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Tag { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; + public static final String JSON_PROPERTY_ID = "id"; + private Long id; - public static final String JSON_PROPERTY_NAME = "name"; - private String name; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; - public Tag() { - } + public Tag() {} - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Long getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getName() { - return name; - } - - - @JsonProperty(JSON_PROPERTY_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setName(String name) { - this.name = name; - } - - - /** - * Return true if this Tag object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Tag id(Long id) { + this.id = id; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `id` to the URL query string - if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; } - // add `name` to the URL query string - if (getName() != null) { - joiner.add(String.format("%sname%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; } - return joiner.toString(); - } + public Tag name(String name) { + this.name = name; + return this; + } + + /** + * Get name + * + * @return name + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + } + + /** Return true if this Tag object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(id, name); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Tag {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `id` to the URL query string + if (getId() != null) { + joiner.add( + String.format( + "%sid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `name` to the URL query string + if (getName() != null) { + joiner.add( + String.format( + "%sname%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 aac016d995bd..b5c1c56d7110 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 @@ -3,44 +3,15 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.EquilateralTriangle; -import org.openapitools.client.model.IsoscelesTriangle; -import org.openapitools.client.model.ScaleneTriangle; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; - -import com.fasterxml.jackson.core.type.TypeReference; - -import java.io.IOException; -import java.util.logging.Level; -import java.util.logging.Logger; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonParser; @@ -55,6 +26,14 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.StringJoiner; +import java.util.logging.Level; +import java.util.logging.Logger; import org.openapitools.client.JSON; @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") @@ -73,7 +52,8 @@ public class Triangle extends AbstractOpenApiSchema { } @Override - public void serialize(Triangle value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException { + public void serialize(Triangle value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { jgen.writeObject(value.getActualInstance()); } } @@ -88,7 +68,8 @@ public class Triangle extends AbstractOpenApiSchema { } @Override - public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public Triangle deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { JsonNode tree = jp.readValueAsTree(); Object deserialized = null; boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); @@ -98,17 +79,34 @@ public class Triangle extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class) || EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class) || EquilateralTriangle.class.equals(Boolean.class) || EquilateralTriangle.class.equals(String.class)) { + if (EquilateralTriangle.class.equals(Integer.class) + || EquilateralTriangle.class.equals(Long.class) + || EquilateralTriangle.class.equals(Float.class) + || EquilateralTriangle.class.equals(Double.class) + || EquilateralTriangle.class.equals(Boolean.class) + || EquilateralTriangle.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((EquilateralTriangle.class.equals(Integer.class) || EquilateralTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((EquilateralTriangle.class.equals(Float.class) || EquilateralTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (EquilateralTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (EquilateralTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((EquilateralTriangle.class.equals(Integer.class) + || EquilateralTriangle.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((EquilateralTriangle.class.equals(Float.class) + || EquilateralTriangle.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (EquilateralTriangle.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (EquilateralTriangle.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); + deserialized = + tree.traverse(jp.getCodec()).readValueAs(EquilateralTriangle.class); // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON // validation, which means the 'match' count may be higher than it should be. @@ -124,17 +122,34 @@ public class Triangle extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class) || IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class) || IsoscelesTriangle.class.equals(Boolean.class) || IsoscelesTriangle.class.equals(String.class)) { + if (IsoscelesTriangle.class.equals(Integer.class) + || IsoscelesTriangle.class.equals(Long.class) + || IsoscelesTriangle.class.equals(Float.class) + || IsoscelesTriangle.class.equals(Double.class) + || IsoscelesTriangle.class.equals(Boolean.class) + || IsoscelesTriangle.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((IsoscelesTriangle.class.equals(Integer.class) || IsoscelesTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((IsoscelesTriangle.class.equals(Float.class) || IsoscelesTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (IsoscelesTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (IsoscelesTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((IsoscelesTriangle.class.equals(Integer.class) + || IsoscelesTriangle.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((IsoscelesTriangle.class.equals(Float.class) + || IsoscelesTriangle.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (IsoscelesTriangle.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (IsoscelesTriangle.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { - deserialized = tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); + deserialized = + tree.traverse(jp.getCodec()).readValueAs(IsoscelesTriangle.class); // TODO: there is no validation against JSON schema constraints // (min, max, enum, pattern...), this does not perform a strict JSON // validation, which means the 'match' count may be higher than it should be. @@ -150,13 +165,29 @@ public class Triangle extends AbstractOpenApiSchema { try { boolean attemptParsing = true; // ensure that we respect type coercion as set on the client ObjectMapper - if (ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class) || ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class) || ScaleneTriangle.class.equals(Boolean.class) || ScaleneTriangle.class.equals(String.class)) { + if (ScaleneTriangle.class.equals(Integer.class) + || ScaleneTriangle.class.equals(Long.class) + || ScaleneTriangle.class.equals(Float.class) + || ScaleneTriangle.class.equals(Double.class) + || ScaleneTriangle.class.equals(Boolean.class) + || ScaleneTriangle.class.equals(String.class)) { attemptParsing = typeCoercion; if (!attemptParsing) { - attemptParsing |= ((ScaleneTriangle.class.equals(Integer.class) || ScaleneTriangle.class.equals(Long.class)) && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= ((ScaleneTriangle.class.equals(Float.class) || ScaleneTriangle.class.equals(Double.class)) && token == JsonToken.VALUE_NUMBER_FLOAT); - attemptParsing |= (ScaleneTriangle.class.equals(Boolean.class) && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= (ScaleneTriangle.class.equals(String.class) && token == JsonToken.VALUE_STRING); + attemptParsing |= + ((ScaleneTriangle.class.equals(Integer.class) + || ScaleneTriangle.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((ScaleneTriangle.class.equals(Float.class) + || ScaleneTriangle.class.equals(Double.class)) + && token == JsonToken.VALUE_NUMBER_FLOAT); + attemptParsing |= + (ScaleneTriangle.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE + || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (ScaleneTriangle.class.equals(String.class) + && token == JsonToken.VALUE_STRING); } } if (attemptParsing) { @@ -177,12 +208,14 @@ public class Triangle extends AbstractOpenApiSchema { ret.setActualInstance(deserialized); return ret; } - throw new IOException(String.format("Failed deserialization for Triangle: %d classes match result, expected 1", match)); + throw new IOException( + String.format( + "Failed deserialization for Triangle: %d classes match result," + + " expected 1", + match)); } - /** - * Handle deserialization of the 'null' value. - */ + /** Handle deserialization of the 'null' value. */ @Override public Triangle getNullValue(DeserializationContext ctxt) throws JsonMappingException { throw new JsonMappingException(ctxt.getParser(), "Triangle cannot be null"); @@ -231,12 +264,11 @@ public class Triangle extends AbstractOpenApiSchema { } /** - * Set the instance that matches the oneOf child schema, check - * the instance parameter is valid against the oneOf child schemas: - * EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle * - * It could be an instance of the 'oneOf' schemas. - * The oneOf child schemas may themselves be a composed schema (allOf, anyOf, oneOf). + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be + * a composed schema (allOf, anyOf, oneOf). */ @Override public void setActualInstance(Object instance) { @@ -255,12 +287,14 @@ public class Triangle extends AbstractOpenApiSchema { return; } - throw new RuntimeException("Invalid instance type. Must be EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle"); + throw new RuntimeException( + "Invalid instance type. Must be EquilateralTriangle, IsoscelesTriangle," + + " ScaleneTriangle"); } /** - * Get the actual instance, which can be the following: - * EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle + * Get the actual instance, which can be the following: EquilateralTriangle, IsoscelesTriangle, + * ScaleneTriangle * * @return The actual instance (EquilateralTriangle, IsoscelesTriangle, ScaleneTriangle) */ @@ -270,92 +304,94 @@ public class Triangle extends AbstractOpenApiSchema { } /** - * Get the actual instance of `EquilateralTriangle`. If the actual instance is not `EquilateralTriangle`, - * the ClassCastException will be thrown. + * Get the actual instance of `EquilateralTriangle`. If the actual instance is not + * `EquilateralTriangle`, the ClassCastException will be thrown. * * @return The actual instance of `EquilateralTriangle` * @throws ClassCastException if the instance is not `EquilateralTriangle` */ public EquilateralTriangle getEquilateralTriangle() throws ClassCastException { - return (EquilateralTriangle)super.getActualInstance(); + return (EquilateralTriangle) super.getActualInstance(); } /** - * Get the actual instance of `IsoscelesTriangle`. If the actual instance is not `IsoscelesTriangle`, - * the ClassCastException will be thrown. + * Get the actual instance of `IsoscelesTriangle`. If the actual instance is not + * `IsoscelesTriangle`, the ClassCastException will be thrown. * * @return The actual instance of `IsoscelesTriangle` * @throws ClassCastException if the instance is not `IsoscelesTriangle` */ public IsoscelesTriangle getIsoscelesTriangle() throws ClassCastException { - return (IsoscelesTriangle)super.getActualInstance(); + return (IsoscelesTriangle) super.getActualInstance(); } /** - * Get the actual instance of `ScaleneTriangle`. If the actual instance is not `ScaleneTriangle`, - * the ClassCastException will be thrown. + * Get the actual instance of `ScaleneTriangle`. If the actual instance is not + * `ScaleneTriangle`, the ClassCastException will be thrown. * * @return The actual instance of `ScaleneTriangle` * @throws ClassCastException if the instance is not `ScaleneTriangle` */ public ScaleneTriangle getScaleneTriangle() throws ClassCastException { - return (ScaleneTriangle)super.getActualInstance(); + return (ScaleneTriangle) super.getActualInstance(); } - - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - StringJoiner joiner = new StringJoiner("&"); - - if (getActualInstance() instanceof EquilateralTriangle) { - if (getActualInstance() != null) { - joiner.add(((EquilateralTriangle)getActualInstance()).toUrlQueryString(prefix + "one_of_0" + suffix)); + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; } - return joiner.toString(); - } - if (getActualInstance() instanceof IsoscelesTriangle) { - if (getActualInstance() != null) { - joiner.add(((IsoscelesTriangle)getActualInstance()).toUrlQueryString(prefix + "one_of_1" + suffix)); - } - return joiner.toString(); - } - if (getActualInstance() instanceof ScaleneTriangle) { - if (getActualInstance() != null) { - joiner.add(((ScaleneTriangle)getActualInstance()).toUrlQueryString(prefix + "one_of_2" + suffix)); - } - return joiner.toString(); - } - return null; - } + StringJoiner joiner = new StringJoiner("&"); + + if (getActualInstance() instanceof EquilateralTriangle) { + if (getActualInstance() != null) { + joiner.add( + ((EquilateralTriangle) getActualInstance()) + .toUrlQueryString(prefix + "one_of_0" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof IsoscelesTriangle) { + if (getActualInstance() != null) { + joiner.add( + ((IsoscelesTriangle) getActualInstance()) + .toUrlQueryString(prefix + "one_of_1" + suffix)); + } + return joiner.toString(); + } + if (getActualInstance() instanceof ScaleneTriangle) { + if (getActualInstance() != null) { + joiner.add( + ((ScaleneTriangle) getActualInstance()) + .toUrlQueryString(prefix + "one_of_2" + suffix)); + } + return joiner.toString(); + } + return null; + } } - 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 7ddeb654006d..db2370bb403d 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 @@ -3,148 +3,139 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * TriangleInterface - */ -@JsonPropertyOrder({ - TriangleInterface.JSON_PROPERTY_TRIANGLE_TYPE -}) +/** TriangleInterface */ +@JsonPropertyOrder({TriangleInterface.JSON_PROPERTY_TRIANGLE_TYPE}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TriangleInterface { - public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; - private String triangleType; + public static final String JSON_PROPERTY_TRIANGLE_TYPE = "triangleType"; + private String triangleType; - public TriangleInterface() { - } + public TriangleInterface() {} - public TriangleInterface triangleType(String triangleType) { - this.triangleType = triangleType; - return this; - } - - /** - * Get triangleType - * @return triangleType - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getTriangleType() { - return triangleType; - } - - - @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setTriangleType(String triangleType) { - this.triangleType = triangleType; - } - - - /** - * Return true if this TriangleInterface object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(triangleType); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TriangleInterface {\n"); - sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public TriangleInterface triangleType(String triangleType) { + this.triangleType = triangleType; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `triangleType` to the URL query string - if (getTriangleType() != null) { - joiner.add(String.format("%striangleType%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getTriangleType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get triangleType + * + * @return triangleType + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTriangleType() { + return triangleType; } - return joiner.toString(); - } + @JsonProperty(JSON_PROPERTY_TRIANGLE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setTriangleType(String triangleType) { + this.triangleType = triangleType; + } + + /** Return true if this TriangleInterface object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(triangleType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriangleInterface {\n"); + sb.append(" triangleType: ").append(toIndentedString(triangleType)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `triangleType` to the URL query string + if (getTriangleType() != null) { + joiner.add( + String.format( + "%striangleType%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getTriangleType()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java index eb87b5691840..017fae49e222 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderDefault.java @@ -3,238 +3,215 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * TypeHolderDefault - */ +/** TypeHolderDefault */ @JsonPropertyOrder({ - TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, - TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, - TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, - TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, - TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM + TypeHolderDefault.JSON_PROPERTY_STRING_ITEM, + TypeHolderDefault.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderDefault.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderDefault.JSON_PROPERTY_BOOL_ITEM, + TypeHolderDefault.JSON_PROPERTY_ARRAY_ITEM }) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderDefault { - public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - private String stringItem = "what"; + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + private String stringItem = "what"; - public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - private BigDecimal numberItem; + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + private BigDecimal numberItem; - public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - private Integer integerItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + private Integer integerItem; - public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - private Boolean boolItem = true; + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + private Boolean boolItem = true; - public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList<>(); + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + private List arrayItem = new ArrayList<>(); - public TypeHolderDefault() { - } + public TypeHolderDefault() {} - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getStringItem() { - return stringItem; - } - - - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public BigDecimal getNumberItem() { - return numberItem; - } - - - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getIntegerItem() { - return integerItem; - } - - - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Boolean getBoolItem() { - return boolItem; - } - - - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getArrayItem() { - return arrayItem; - } - - - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - - /** - * Return true if this TypeHolderDefault object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public TypeHolderDefault stringItem(String stringItem) { + this.stringItem = stringItem; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get stringItem + * + * @return stringItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { + return stringItem; } - 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); - } - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStringItem(String stringItem) { + this.stringItem = stringItem; } - return o.toString().replace("\n", "\n "); - } + public TypeHolderDefault numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * + * @return numberItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { + return numberItem; + } + + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderDefault integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * + * @return integerItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { + return integerItem; + } + + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderDefault boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * + * @return boolItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { + return boolItem; + } + + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderDefault arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * + * @return arrayItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { + return arrayItem; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + /** Return true if this TypeHolderDefault object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderDefault {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java index 2a91c7ddfa3c..657794d18eb6 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TypeHolderExample.java @@ -3,269 +3,244 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * TypeHolderExample - */ +/** TypeHolderExample */ @JsonPropertyOrder({ - TypeHolderExample.JSON_PROPERTY_STRING_ITEM, - TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, - TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, - TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, - TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, - TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM + TypeHolderExample.JSON_PROPERTY_STRING_ITEM, + TypeHolderExample.JSON_PROPERTY_NUMBER_ITEM, + TypeHolderExample.JSON_PROPERTY_FLOAT_ITEM, + TypeHolderExample.JSON_PROPERTY_INTEGER_ITEM, + TypeHolderExample.JSON_PROPERTY_BOOL_ITEM, + TypeHolderExample.JSON_PROPERTY_ARRAY_ITEM }) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class TypeHolderExample { - public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; - private String stringItem; + public static final String JSON_PROPERTY_STRING_ITEM = "string_item"; + private String stringItem; - public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; - private BigDecimal numberItem; + public static final String JSON_PROPERTY_NUMBER_ITEM = "number_item"; + private BigDecimal numberItem; - public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; - private Float floatItem; + public static final String JSON_PROPERTY_FLOAT_ITEM = "float_item"; + private Float floatItem; - public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; - private Integer integerItem; + public static final String JSON_PROPERTY_INTEGER_ITEM = "integer_item"; + private Integer integerItem; - public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; - private Boolean boolItem; + public static final String JSON_PROPERTY_BOOL_ITEM = "bool_item"; + private Boolean boolItem; - public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; - private List arrayItem = new ArrayList<>(); + public static final String JSON_PROPERTY_ARRAY_ITEM = "array_item"; + private List arrayItem = new ArrayList<>(); - public TypeHolderExample() { - } + public TypeHolderExample() {} - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getStringItem() { - return stringItem; - } - - - @JsonProperty(JSON_PROPERTY_STRING_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public BigDecimal getNumberItem() { - return numberItem; - } - - - @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Float getFloatItem() { - return floatItem; - } - - - @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Integer getIntegerItem() { - return integerItem; - } - - - @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public Boolean getBoolItem() { - return boolItem; - } - - - @JsonProperty(JSON_PROPERTY_BOOL_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public List getArrayItem() { - return arrayItem; - } - - - @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - - /** - * Return true if this TypeHolderExample object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public TypeHolderExample stringItem(String stringItem) { + this.stringItem = stringItem; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get stringItem + * + * @return stringItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStringItem() { + return stringItem; } - 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); - } - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + @JsonProperty(JSON_PROPERTY_STRING_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setStringItem(String stringItem) { + this.stringItem = stringItem; } - return o.toString().replace("\n", "\n "); - } + public TypeHolderExample numberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + return this; + } + + /** + * Get numberItem + * + * @return numberItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public BigDecimal getNumberItem() { + return numberItem; + } + + @JsonProperty(JSON_PROPERTY_NUMBER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setNumberItem(BigDecimal numberItem) { + this.numberItem = numberItem; + } + + public TypeHolderExample floatItem(Float floatItem) { + this.floatItem = floatItem; + return this; + } + + /** + * Get floatItem + * + * @return floatItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Float getFloatItem() { + return floatItem; + } + + @JsonProperty(JSON_PROPERTY_FLOAT_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setFloatItem(Float floatItem) { + this.floatItem = floatItem; + } + + public TypeHolderExample integerItem(Integer integerItem) { + this.integerItem = integerItem; + return this; + } + + /** + * Get integerItem + * + * @return integerItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getIntegerItem() { + return integerItem; + } + + @JsonProperty(JSON_PROPERTY_INTEGER_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setIntegerItem(Integer integerItem) { + this.integerItem = integerItem; + } + + public TypeHolderExample boolItem(Boolean boolItem) { + this.boolItem = boolItem; + return this; + } + + /** + * Get boolItem + * + * @return boolItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getBoolItem() { + return boolItem; + } + + @JsonProperty(JSON_PROPERTY_BOOL_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setBoolItem(Boolean boolItem) { + this.boolItem = boolItem; + } + + public TypeHolderExample arrayItem(List arrayItem) { + this.arrayItem = arrayItem; + return this; + } + + public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + this.arrayItem.add(arrayItemItem); + return this; + } + + /** + * Get arrayItem + * + * @return arrayItem + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getArrayItem() { + return arrayItem; + } + + @JsonProperty(JSON_PROPERTY_ARRAY_ITEM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setArrayItem(List arrayItem) { + this.arrayItem = arrayItem; + } + + /** Return true if this TypeHolderExample object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TypeHolderExample {\n"); + sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); + sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); + sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); + sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); + sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); + sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } } - 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 32b66a3d0049..9a6559ef58b6 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 @@ -3,583 +3,664 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Objects; +import java.util.StringJoiner; +import org.openapitools.jackson.nullable.JsonNullable; - -/** - * User - */ +/** User */ @JsonPropertyOrder({ - User.JSON_PROPERTY_ID, - User.JSON_PROPERTY_USERNAME, - User.JSON_PROPERTY_FIRST_NAME, - User.JSON_PROPERTY_LAST_NAME, - User.JSON_PROPERTY_EMAIL, - User.JSON_PROPERTY_PASSWORD, - User.JSON_PROPERTY_PHONE, - User.JSON_PROPERTY_USER_STATUS, - User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, - User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, - User.JSON_PROPERTY_ANY_TYPE_PROP, - User.JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE + User.JSON_PROPERTY_ID, + User.JSON_PROPERTY_USERNAME, + User.JSON_PROPERTY_FIRST_NAME, + User.JSON_PROPERTY_LAST_NAME, + User.JSON_PROPERTY_EMAIL, + User.JSON_PROPERTY_PASSWORD, + User.JSON_PROPERTY_PHONE, + User.JSON_PROPERTY_USER_STATUS, + User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS, + User.JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE, + User.JSON_PROPERTY_ANY_TYPE_PROP, + User.JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class User { - public static final String JSON_PROPERTY_ID = "id"; - private Long id; - - public static final String JSON_PROPERTY_USERNAME = "username"; - private String username; - - public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; - private String firstName; - - public static final String JSON_PROPERTY_LAST_NAME = "lastName"; - private String lastName; - - public static final String JSON_PROPERTY_EMAIL = "email"; - private String email; - - public static final String JSON_PROPERTY_PASSWORD = "password"; - private String password; - - public static final String JSON_PROPERTY_PHONE = "phone"; - private String phone; - - public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; - private Integer userStatus; - - public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS = "objectWithNoDeclaredProps"; - private Object objectWithNoDeclaredProps; - - public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = "objectWithNoDeclaredPropsNullable"; - private JsonNullable objectWithNoDeclaredPropsNullable = JsonNullable.undefined(); - - public static final String JSON_PROPERTY_ANY_TYPE_PROP = "anyTypeProp"; - private JsonNullable anyTypeProp = JsonNullable.of(null); - - public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; - private JsonNullable anyTypePropNullable = JsonNullable.of(null); - - public User() { - } - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Long getId() { - return id; - } - - - @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setId(Long id) { - this.id = id; - } - - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getUsername() { - return username; - } - - - @JsonProperty(JSON_PROPERTY_USERNAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUsername(String username) { - this.username = username; - } - - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FIRST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getFirstName() { - return firstName; - } - - - @JsonProperty(JSON_PROPERTY_FIRST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LAST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getLastName() { - return lastName; - } - - - @JsonProperty(JSON_PROPERTY_LAST_NAME) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setLastName(String lastName) { - this.lastName = lastName; - } - - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EMAIL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getEmail() { - return email; - } - - - @JsonProperty(JSON_PROPERTY_EMAIL) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setEmail(String email) { - this.email = email; - } - - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPassword() { - return password; - } - - - @JsonProperty(JSON_PROPERTY_PASSWORD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPassword(String password) { - this.password = password; - } - - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PHONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPhone() { - return phone; - } - - - @JsonProperty(JSON_PROPERTY_PHONE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPhone(String phone) { - this.phone = phone; - } - - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_USER_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getUserStatus() { - return userStatus; - } - - - @JsonProperty(JSON_PROPERTY_USER_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - - public User objectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { - this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; - return this; - } - - /** - * test code generation for objects Value must be a map of strings to values. It cannot be the 'null' value. - * @return objectWithNoDeclaredProps - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getObjectWithNoDeclaredProps() { - return objectWithNoDeclaredProps; - } - - - @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setObjectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { - this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; - } - - - public User objectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { - this.objectWithNoDeclaredPropsNullable = JsonNullable.of(objectWithNoDeclaredPropsNullable); - return this; - } - - /** - * test code generation for nullable objects. Value must be a map of strings to values or the 'null' value. - * @return objectWithNoDeclaredPropsNullable - **/ - @javax.annotation.Nullable - @JsonIgnore - - public Object getObjectWithNoDeclaredPropsNullable() { + public static final String JSON_PROPERTY_ID = "id"; + private Long id; + + public static final String JSON_PROPERTY_USERNAME = "username"; + private String username; + + public static final String JSON_PROPERTY_FIRST_NAME = "firstName"; + private String firstName; + + public static final String JSON_PROPERTY_LAST_NAME = "lastName"; + private String lastName; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + public static final String JSON_PROPERTY_PASSWORD = "password"; + private String password; + + public static final String JSON_PROPERTY_PHONE = "phone"; + private String phone; + + public static final String JSON_PROPERTY_USER_STATUS = "userStatus"; + private Integer userStatus; + + public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS = + "objectWithNoDeclaredProps"; + private Object objectWithNoDeclaredProps; + + public static final String JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE = + "objectWithNoDeclaredPropsNullable"; + private JsonNullable objectWithNoDeclaredPropsNullable = + JsonNullable.undefined(); + + public static final String JSON_PROPERTY_ANY_TYPE_PROP = "anyTypeProp"; + private JsonNullable anyTypeProp = JsonNullable.of(null); + + public static final String JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE = "anyTypePropNullable"; + private JsonNullable anyTypePropNullable = JsonNullable.of(null); + + public User() {} + + public User id(Long id) { + this.id = id; + return this; + } + + /** + * Get id + * + * @return id + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getId() { + return id; + } + + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(Long id) { + this.id = id; + } + + public User username(String username) { + this.username = username; + return this; + } + + /** + * Get username + * + * @return username + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getUsername() { + return username; + } + + @JsonProperty(JSON_PROPERTY_USERNAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUsername(String username) { + this.username = username; + } + + public User firstName(String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * + * @return firstName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFirstName() { + return firstName; + } + + @JsonProperty(JSON_PROPERTY_FIRST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + public User lastName(String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * + * @return lastName + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLastName() { + return lastName; + } + + @JsonProperty(JSON_PROPERTY_LAST_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setLastName(String lastName) { + this.lastName = lastName; + } + + public User email(String email) { + this.email = email; + return this; + } + + /** + * Get email + * + * @return email + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + } + + public User password(String password) { + this.password = password; + return this; + } + + /** + * Get password + * + * @return password + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPassword() { + return password; + } + + @JsonProperty(JSON_PROPERTY_PASSWORD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPassword(String password) { + this.password = password; + } + + public User phone(String phone) { + this.phone = phone; + return this; + } + + /** + * Get phone + * + * @return phone + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhone() { + return phone; + } + + @JsonProperty(JSON_PROPERTY_PHONE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhone(String phone) { + this.phone = phone; + } + + public User userStatus(Integer userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + * User Status + * + * @return userStatus + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getUserStatus() { + return userStatus; + } + + @JsonProperty(JSON_PROPERTY_USER_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setUserStatus(Integer userStatus) { + this.userStatus = userStatus; + } + + public User objectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + return this; + } + + /** + * test code generation for objects Value must be a map of strings to values. It cannot be the + * 'null' value. + * + * @return objectWithNoDeclaredProps + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Object getObjectWithNoDeclaredProps() { + return objectWithNoDeclaredProps; + } + + @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setObjectWithNoDeclaredProps(Object objectWithNoDeclaredProps) { + this.objectWithNoDeclaredProps = objectWithNoDeclaredProps; + } + + public User objectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = + JsonNullable.of(objectWithNoDeclaredPropsNullable); + return this; + } + + /** + * test code generation for nullable objects. Value must be a map of strings to values or the + * 'null' value. + * + * @return objectWithNoDeclaredPropsNullable + */ + @javax.annotation.Nullable + @JsonIgnore + public Object getObjectWithNoDeclaredPropsNullable() { return objectWithNoDeclaredPropsNullable.orElse(null); - } + } - @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getObjectWithNoDeclaredPropsNullable_JsonNullable() { + return objectWithNoDeclaredPropsNullable; + } - public JsonNullable getObjectWithNoDeclaredPropsNullable_JsonNullable() { - return objectWithNoDeclaredPropsNullable; - } - - @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) - public void setObjectWithNoDeclaredPropsNullable_JsonNullable(JsonNullable objectWithNoDeclaredPropsNullable) { - this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; - } + @JsonProperty(JSON_PROPERTY_OBJECT_WITH_NO_DECLARED_PROPS_NULLABLE) + public void setObjectWithNoDeclaredPropsNullable_JsonNullable( + JsonNullable objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable; + } - public void setObjectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { - this.objectWithNoDeclaredPropsNullable = JsonNullable.of(objectWithNoDeclaredPropsNullable); - } + public void setObjectWithNoDeclaredPropsNullable(Object objectWithNoDeclaredPropsNullable) { + this.objectWithNoDeclaredPropsNullable = + JsonNullable.of(objectWithNoDeclaredPropsNullable); + } + public User anyTypeProp(Object anyTypeProp) { + this.anyTypeProp = JsonNullable.of(anyTypeProp); + return this; + } - public User anyTypeProp(Object anyTypeProp) { - this.anyTypeProp = JsonNullable.of(anyTypeProp); - return this; - } - - /** - * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 - * @return anyTypeProp - **/ - @javax.annotation.Nullable - @JsonIgnore - - public Object getAnyTypeProp() { + /** + * test code generation for any type Here the 'type' attribute is not specified, which + * means the value can be anything, including the null value, string, number, boolean, array or + * object. See https://github.com/OAI/OpenAPI-Specification/issues/1389 + * + * @return anyTypeProp + */ + @javax.annotation.Nullable + @JsonIgnore + public Object getAnyTypeProp() { return anyTypeProp.orElse(null); - } + } - @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAnyTypeProp_JsonNullable() { + return anyTypeProp; + } - public JsonNullable getAnyTypeProp_JsonNullable() { - return anyTypeProp; - } - - @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP) - public void setAnyTypeProp_JsonNullable(JsonNullable anyTypeProp) { - this.anyTypeProp = anyTypeProp; - } + @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP) + public void setAnyTypeProp_JsonNullable(JsonNullable anyTypeProp) { + this.anyTypeProp = anyTypeProp; + } - public void setAnyTypeProp(Object anyTypeProp) { - this.anyTypeProp = JsonNullable.of(anyTypeProp); - } + public void setAnyTypeProp(Object anyTypeProp) { + this.anyTypeProp = JsonNullable.of(anyTypeProp); + } + public User anyTypePropNullable(Object anyTypePropNullable) { + this.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); + return this; + } - public User anyTypePropNullable(Object anyTypePropNullable) { - this.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); - return this; - } - - /** - * test code generation for any type Here the 'type' attribute is not specified, which means the value can be anything, including the null value, string, number, boolean, array or object. The 'nullable' attribute does not change the allowed values. - * @return anyTypePropNullable - **/ - @javax.annotation.Nullable - @JsonIgnore - - public Object getAnyTypePropNullable() { + /** + * test code generation for any type Here the 'type' attribute is not specified, which + * means the value can be anything, including the null value, string, number, boolean, array or + * object. The 'nullable' attribute does not change the allowed values. + * + * @return anyTypePropNullable + */ + @javax.annotation.Nullable + @JsonIgnore + public Object getAnyTypePropNullable() { return anyTypePropNullable.orElse(null); - } - - @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public JsonNullable getAnyTypePropNullable_JsonNullable() { - return anyTypePropNullable; - } - - @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE) - public void setAnyTypePropNullable_JsonNullable(JsonNullable anyTypePropNullable) { - this.anyTypePropNullable = anyTypePropNullable; - } - - public void setAnyTypePropNullable(Object anyTypePropNullable) { - this.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); - } - - - /** - * Return true if this User object is equal to o. - */ - @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); - } - - private static boolean equalsNullable(JsonNullable a, JsonNullable b) { - return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus, objectWithNoDeclaredProps, hashCodeNullable(objectWithNoDeclaredPropsNullable), hashCodeNullable(anyTypeProp), hashCodeNullable(anyTypePropNullable)); - } - - private static int hashCodeNullable(JsonNullable a) { - if (a == null) { - return 1; - } - return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append(" objectWithNoDeclaredProps: ").append(toIndentedString(objectWithNoDeclaredProps)).append("\n"); - sb.append(" objectWithNoDeclaredPropsNullable: ").append(toIndentedString(objectWithNoDeclaredPropsNullable)).append("\n"); - sb.append(" anyTypeProp: ").append(toIndentedString(anyTypeProp)).append("\n"); - sb.append(" anyTypePropNullable: ").append(toIndentedString(anyTypePropNullable)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; } - StringJoiner joiner = new StringJoiner("&"); - - // add `id` to the URL query string - if (getId() != null) { - joiner.add(String.format("%sid%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getAnyTypePropNullable_JsonNullable() { + return anyTypePropNullable; } - // add `username` to the URL query string - if (getUsername() != null) { - joiner.add(String.format("%susername%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUsername()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_ANY_TYPE_PROP_NULLABLE) + public void setAnyTypePropNullable_JsonNullable(JsonNullable anyTypePropNullable) { + this.anyTypePropNullable = anyTypePropNullable; } - // add `firstName` to the URL query string - if (getFirstName() != null) { - joiner.add(String.format("%sfirstName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getFirstName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public void setAnyTypePropNullable(Object anyTypePropNullable) { + this.anyTypePropNullable = JsonNullable.of(anyTypePropNullable); } - // add `lastName` to the URL query string - if (getLastName() != null) { - joiner.add(String.format("%slastName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getLastName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** Return true if this User object is equal to o. */ + @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); } - // add `email` to the URL query string - if (getEmail() != null) { - joiner.add(String.format("%semail%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getEmail()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b + || (a != null + && b != null + && a.isPresent() + && b.isPresent() + && Objects.deepEquals(a.get(), b.get())); } - // add `password` to the URL query string - if (getPassword() != null) { - joiner.add(String.format("%spassword%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPassword()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @Override + public int hashCode() { + return Objects.hash( + id, + username, + firstName, + lastName, + email, + password, + phone, + userStatus, + objectWithNoDeclaredProps, + hashCodeNullable(objectWithNoDeclaredPropsNullable), + hashCodeNullable(anyTypeProp), + hashCodeNullable(anyTypePropNullable)); } - // add `phone` to the URL query string - if (getPhone() != null) { - joiner.add(String.format("%sphone%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getPhone()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[] {a.get()}) : 31; } - // add `userStatus` to the URL query string - if (getUserStatus() != null) { - joiner.add(String.format("%suserStatus%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getUserStatus()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class User {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); + sb.append(" objectWithNoDeclaredProps: ") + .append(toIndentedString(objectWithNoDeclaredProps)) + .append("\n"); + sb.append(" objectWithNoDeclaredPropsNullable: ") + .append(toIndentedString(objectWithNoDeclaredPropsNullable)) + .append("\n"); + sb.append(" anyTypeProp: ").append(toIndentedString(anyTypeProp)).append("\n"); + sb.append(" anyTypePropNullable: ") + .append(toIndentedString(anyTypePropNullable)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - // add `objectWithNoDeclaredProps` to the URL query string - if (getObjectWithNoDeclaredProps() != null) { - joiner.add(String.format("%sobjectWithNoDeclaredProps%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getObjectWithNoDeclaredProps()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); } - // add `objectWithNoDeclaredPropsNullable` to the URL query string - if (getObjectWithNoDeclaredPropsNullable() != null) { - joiner.add(String.format("%sobjectWithNoDeclaredPropsNullable%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getObjectWithNoDeclaredPropsNullable()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - // add `anyTypeProp` to the URL query string - if (getAnyTypeProp() != null) { - joiner.add(String.format("%sanyTypeProp%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAnyTypeProp()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } - // add `anyTypePropNullable` to the URL query string - if (getAnyTypePropNullable() != null) { - joiner.add(String.format("%sanyTypePropNullable%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getAnyTypePropNullable()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + StringJoiner joiner = new StringJoiner("&"); - return joiner.toString(); - } + // add `id` to the URL query string + if (getId() != null) { + joiner.add( + String.format( + "%sid%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getId()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `username` to the URL query string + if (getUsername() != null) { + joiner.add( + String.format( + "%susername%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getUsername()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `firstName` to the URL query string + if (getFirstName() != null) { + joiner.add( + String.format( + "%sfirstName%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getFirstName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `lastName` to the URL query string + if (getLastName() != null) { + joiner.add( + String.format( + "%slastName%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getLastName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `email` to the URL query string + if (getEmail() != null) { + joiner.add( + String.format( + "%semail%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getEmail()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `password` to the URL query string + if (getPassword() != null) { + joiner.add( + String.format( + "%spassword%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getPassword()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `phone` to the URL query string + if (getPhone() != null) { + joiner.add( + String.format( + "%sphone%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getPhone()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `userStatus` to the URL query string + if (getUserStatus() != null) { + joiner.add( + String.format( + "%suserStatus%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getUserStatus()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `objectWithNoDeclaredProps` to the URL query string + if (getObjectWithNoDeclaredProps() != null) { + joiner.add( + String.format( + "%sobjectWithNoDeclaredProps%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getObjectWithNoDeclaredProps()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `objectWithNoDeclaredPropsNullable` to the URL query string + if (getObjectWithNoDeclaredPropsNullable() != null) { + joiner.add( + String.format( + "%sobjectWithNoDeclaredPropsNullable%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getObjectWithNoDeclaredPropsNullable()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `anyTypeProp` to the URL query string + if (getAnyTypeProp() != null) { + joiner.add( + String.format( + "%sanyTypeProp%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getAnyTypeProp()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `anyTypePropNullable` to the URL query string + if (getAnyTypePropNullable() != null) { + joiner.add( + String.format( + "%sanyTypePropNullable%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getAnyTypePropNullable()), + StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - 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 8d957a6447c0..93df8c6f461b 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 @@ -3,220 +3,221 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Whale - */ +/** Whale */ @JsonPropertyOrder({ - Whale.JSON_PROPERTY_HAS_BALEEN, - Whale.JSON_PROPERTY_HAS_TEETH, - Whale.JSON_PROPERTY_CLASS_NAME + Whale.JSON_PROPERTY_HAS_BALEEN, + Whale.JSON_PROPERTY_HAS_TEETH, + Whale.JSON_PROPERTY_CLASS_NAME }) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Whale { - public static final String JSON_PROPERTY_HAS_BALEEN = "hasBaleen"; - private Boolean hasBaleen; + public static final String JSON_PROPERTY_HAS_BALEEN = "hasBaleen"; + private Boolean hasBaleen; - public static final String JSON_PROPERTY_HAS_TEETH = "hasTeeth"; - private Boolean hasTeeth; + public static final String JSON_PROPERTY_HAS_TEETH = "hasTeeth"; + private Boolean hasTeeth; - public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; - public Whale() { - } + public Whale() {} - public Whale hasBaleen(Boolean hasBaleen) { - this.hasBaleen = hasBaleen; - return this; - } - - /** - * Get hasBaleen - * @return hasBaleen - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HAS_BALEEN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHasBaleen() { - return hasBaleen; - } - - - @JsonProperty(JSON_PROPERTY_HAS_BALEEN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasBaleen(Boolean hasBaleen) { - this.hasBaleen = hasBaleen; - } - - - public Whale hasTeeth(Boolean hasTeeth) { - this.hasTeeth = hasTeeth; - return this; - } - - /** - * Get hasTeeth - * @return hasTeeth - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_HAS_TEETH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getHasTeeth() { - return hasTeeth; - } - - - @JsonProperty(JSON_PROPERTY_HAS_TEETH) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setHasTeeth(Boolean hasTeeth) { - this.hasTeeth = hasTeeth; - } - - - public Whale className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getClassName() { - return className; - } - - - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(String className) { - this.className = className; - } - - - /** - * Return true if this whale object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(hasBaleen, hasTeeth, className); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Whale {\n"); - sb.append(" hasBaleen: ").append(toIndentedString(hasBaleen)).append("\n"); - sb.append(" hasTeeth: ").append(toIndentedString(hasTeeth)).append("\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + public Whale hasBaleen(Boolean hasBaleen) { + this.hasBaleen = hasBaleen; + return this; } - StringJoiner joiner = new StringJoiner("&"); - - // add `hasBaleen` to the URL query string - if (getHasBaleen() != null) { - joiner.add(String.format("%shasBaleen%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHasBaleen()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Get hasBaleen + * + * @return hasBaleen + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_BALEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasBaleen() { + return hasBaleen; } - // add `hasTeeth` to the URL query string - if (getHasTeeth() != null) { - joiner.add(String.format("%shasTeeth%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getHasTeeth()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + @JsonProperty(JSON_PROPERTY_HAS_BALEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasBaleen(Boolean hasBaleen) { + this.hasBaleen = hasBaleen; } - // add `className` to the URL query string - if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + public Whale hasTeeth(Boolean hasTeeth) { + this.hasTeeth = hasTeeth; + return this; } - return joiner.toString(); - } + /** + * Get hasTeeth + * + * @return hasTeeth + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HAS_TEETH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getHasTeeth() { + return hasTeeth; + } + + @JsonProperty(JSON_PROPERTY_HAS_TEETH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setHasTeeth(Boolean hasTeeth) { + this.hasTeeth = hasTeeth; + } + + public Whale className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * + * @return className + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; + } + + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(String className) { + this.className = className; + } + + /** Return true if this whale object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(hasBaleen, hasTeeth, className); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Whale {\n"); + sb.append(" hasBaleen: ").append(toIndentedString(hasBaleen)).append("\n"); + sb.append(" hasTeeth: ").append(toIndentedString(hasTeeth)).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); + } + + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } + + StringJoiner joiner = new StringJoiner("&"); + + // add `hasBaleen` to the URL query string + if (getHasBaleen() != null) { + joiner.add( + String.format( + "%shasBaleen%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getHasBaleen()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `hasTeeth` to the URL query string + if (getHasTeeth() != null) { + joiner.add( + String.format( + "%shasTeeth%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getHasTeeth()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add( + String.format( + "%sclassName%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getClassName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java index 5db1af54262c..8b6b577a9092 100644 --- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java +++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/XmlItem.java @@ -3,1049 +3,1013 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.math.BigDecimal; import java.util.ArrayList; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; - -/** - * XmlItem - */ +/** XmlItem */ @JsonPropertyOrder({ - XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, - XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, - XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, - XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, - XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, - XmlItem.JSON_PROPERTY_NAME_STRING, - XmlItem.JSON_PROPERTY_NAME_NUMBER, - XmlItem.JSON_PROPERTY_NAME_INTEGER, - XmlItem.JSON_PROPERTY_NAME_BOOLEAN, - XmlItem.JSON_PROPERTY_NAME_ARRAY, - XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, - XmlItem.JSON_PROPERTY_PREFIX_STRING, - XmlItem.JSON_PROPERTY_PREFIX_NUMBER, - XmlItem.JSON_PROPERTY_PREFIX_INTEGER, - XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, - XmlItem.JSON_PROPERTY_PREFIX_ARRAY, - XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, - XmlItem.JSON_PROPERTY_NAMESPACE_STRING, - XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, - XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, - XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, - XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, - XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, - XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, - XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, - XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, - XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, - XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, - XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY + XmlItem.JSON_PROPERTY_ATTRIBUTE_STRING, + XmlItem.JSON_PROPERTY_ATTRIBUTE_NUMBER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_INTEGER, + XmlItem.JSON_PROPERTY_ATTRIBUTE_BOOLEAN, + XmlItem.JSON_PROPERTY_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAME_STRING, + XmlItem.JSON_PROPERTY_NAME_NUMBER, + XmlItem.JSON_PROPERTY_NAME_INTEGER, + XmlItem.JSON_PROPERTY_NAME_BOOLEAN, + XmlItem.JSON_PROPERTY_NAME_ARRAY, + XmlItem.JSON_PROPERTY_NAME_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_STRING, + XmlItem.JSON_PROPERTY_NAMESPACE_NUMBER, + XmlItem.JSON_PROPERTY_NAMESPACE_INTEGER, + XmlItem.JSON_PROPERTY_NAMESPACE_BOOLEAN, + XmlItem.JSON_PROPERTY_NAMESPACE_ARRAY, + XmlItem.JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_STRING, + XmlItem.JSON_PROPERTY_PREFIX_NS_NUMBER, + XmlItem.JSON_PROPERTY_PREFIX_NS_INTEGER, + XmlItem.JSON_PROPERTY_PREFIX_NS_BOOLEAN, + XmlItem.JSON_PROPERTY_PREFIX_NS_ARRAY, + XmlItem.JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY }) -@javax.annotation.processing.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") +@javax.annotation.processing.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen") public class XmlItem { - public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; - private String attributeString; + public static final String JSON_PROPERTY_ATTRIBUTE_STRING = "attribute_string"; + private String attributeString; - public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; - private BigDecimal attributeNumber; + public static final String JSON_PROPERTY_ATTRIBUTE_NUMBER = "attribute_number"; + private BigDecimal attributeNumber; - public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; - private Integer attributeInteger; + public static final String JSON_PROPERTY_ATTRIBUTE_INTEGER = "attribute_integer"; + private Integer attributeInteger; - public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; - private Boolean attributeBoolean; + public static final String JSON_PROPERTY_ATTRIBUTE_BOOLEAN = "attribute_boolean"; + private Boolean attributeBoolean; - public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; - private List wrappedArray = null; + public static final String JSON_PROPERTY_WRAPPED_ARRAY = "wrapped_array"; + private List wrappedArray = null; - public static final String JSON_PROPERTY_NAME_STRING = "name_string"; - private String nameString; + public static final String JSON_PROPERTY_NAME_STRING = "name_string"; + private String nameString; - public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; - private BigDecimal nameNumber; + public static final String JSON_PROPERTY_NAME_NUMBER = "name_number"; + private BigDecimal nameNumber; - public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; - private Integer nameInteger; + public static final String JSON_PROPERTY_NAME_INTEGER = "name_integer"; + private Integer nameInteger; - public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; - private Boolean nameBoolean; + public static final String JSON_PROPERTY_NAME_BOOLEAN = "name_boolean"; + private Boolean nameBoolean; - public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; - private List nameArray = null; + public static final String JSON_PROPERTY_NAME_ARRAY = "name_array"; + private List nameArray = null; - public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; - private List nameWrappedArray = null; + public static final String JSON_PROPERTY_NAME_WRAPPED_ARRAY = "name_wrapped_array"; + private List nameWrappedArray = null; - public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; - private String prefixString; + public static final String JSON_PROPERTY_PREFIX_STRING = "prefix_string"; + private String prefixString; - public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; - private BigDecimal prefixNumber; + public static final String JSON_PROPERTY_PREFIX_NUMBER = "prefix_number"; + private BigDecimal prefixNumber; - public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; - private Integer prefixInteger; + public static final String JSON_PROPERTY_PREFIX_INTEGER = "prefix_integer"; + private Integer prefixInteger; - public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; - private Boolean prefixBoolean; + public static final String JSON_PROPERTY_PREFIX_BOOLEAN = "prefix_boolean"; + private Boolean prefixBoolean; - public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; - private List prefixArray = null; + public static final String JSON_PROPERTY_PREFIX_ARRAY = "prefix_array"; + private List prefixArray = null; - public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; - private List prefixWrappedArray = null; + public static final String JSON_PROPERTY_PREFIX_WRAPPED_ARRAY = "prefix_wrapped_array"; + private List prefixWrappedArray = null; - public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; - private String namespaceString; + public static final String JSON_PROPERTY_NAMESPACE_STRING = "namespace_string"; + private String namespaceString; - public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; - private BigDecimal namespaceNumber; + public static final String JSON_PROPERTY_NAMESPACE_NUMBER = "namespace_number"; + private BigDecimal namespaceNumber; - public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; - private Integer namespaceInteger; + public static final String JSON_PROPERTY_NAMESPACE_INTEGER = "namespace_integer"; + private Integer namespaceInteger; - public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; - private Boolean namespaceBoolean; + public static final String JSON_PROPERTY_NAMESPACE_BOOLEAN = "namespace_boolean"; + private Boolean namespaceBoolean; - public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; - private List namespaceArray = null; + public static final String JSON_PROPERTY_NAMESPACE_ARRAY = "namespace_array"; + private List namespaceArray = null; - public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; - private List namespaceWrappedArray = null; + public static final String JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY = "namespace_wrapped_array"; + private List namespaceWrappedArray = null; - public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; - private String prefixNsString; + public static final String JSON_PROPERTY_PREFIX_NS_STRING = "prefix_ns_string"; + private String prefixNsString; - public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; - private BigDecimal prefixNsNumber; + public static final String JSON_PROPERTY_PREFIX_NS_NUMBER = "prefix_ns_number"; + private BigDecimal prefixNsNumber; - public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; - private Integer prefixNsInteger; + public static final String JSON_PROPERTY_PREFIX_NS_INTEGER = "prefix_ns_integer"; + private Integer prefixNsInteger; - public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; - private Boolean prefixNsBoolean; + public static final String JSON_PROPERTY_PREFIX_NS_BOOLEAN = "prefix_ns_boolean"; + private Boolean prefixNsBoolean; - public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; - private List prefixNsArray = null; + public static final String JSON_PROPERTY_PREFIX_NS_ARRAY = "prefix_ns_array"; + private List prefixNsArray = null; - public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; - private List prefixNsWrappedArray = null; + public static final String JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY = "prefix_ns_wrapped_array"; + private List prefixNsWrappedArray = null; - public XmlItem() { - } + public XmlItem() {} - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getAttributeString() { - return attributeString; - } - - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getAttributeInteger() { - return attributeInteger; - } - - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - - @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); + public XmlItem attributeString(String attributeString) { + this.attributeString = attributeString; + return this; } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - /** - * Get wrappedArray - * @return wrappedArray - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getWrappedArray() { - return wrappedArray; - } - - - @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getNameString() { - return nameString; - } - - - @JsonProperty(JSON_PROPERTY_NAME_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameString(String nameString) { - this.nameString = nameString; - } - - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getNameNumber() { - return nameNumber; - } - - - @JsonProperty(JSON_PROPERTY_NAME_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNameInteger() { - return nameInteger; - } - - - @JsonProperty(JSON_PROPERTY_NAME_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getNameBoolean() { - return nameBoolean; - } - - - @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); + /** + * Get attributeString + * + * @return attributeString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAttributeString() { + return attributeString; } - this.nameArray.add(nameArrayItem); - return this; - } - /** - * Get nameArray - * @return nameArray - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getNameArray() { - return nameArray; - } - - - @JsonProperty(JSON_PROPERTY_NAME_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeString(String attributeString) { + this.attributeString = attributeString; } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - /** - * Get nameWrappedArray - * @return nameWrappedArray - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getNameWrappedArray() { - return nameWrappedArray; - } - - - @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrefixString() { - return prefixString; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getPrefixInteger() { - return prefixInteger; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); + public XmlItem attributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; + return this; } - this.prefixArray.add(prefixArrayItem); - return this; - } - /** - * Get prefixArray - * @return prefixArray - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getPrefixArray() { - return prefixArray; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); + /** + * Get attributeNumber + * + * @return attributeNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getAttributeNumber() { + return attributeNumber; } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getNamespaceString() { - return namespaceString; - } - - - @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - - @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - - @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - - @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeNumber(BigDecimal attributeNumber) { + this.attributeNumber = attributeNumber; } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - /** - * Get namespaceArray - * @return namespaceArray - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getNamespaceArray() { - return namespaceArray; - } - - - @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); + public XmlItem attributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; + return this; } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - - @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public String getPrefixNsString() { - return prefixNsString; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); + /** + * Get attributeInteger + * + * @return attributeInteger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getAttributeInteger() { + return attributeInteger; } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - /** - * Get prefixNsArray - * @return prefixNsArray - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getPrefixNsArray() { - return prefixNsArray; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeInteger(Integer attributeInteger) { + this.attributeInteger = attributeInteger; } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - - @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - - /** - * Return true if this XmlItem object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; + public XmlItem attributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; + return this; } - if (o == null || getClass() != o.getClass()) { - return false; + + /** + * Get attributeBoolean + * + * @return attributeBoolean + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getAttributeBoolean() { + return attributeBoolean; } - 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); - } - @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); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; + @JsonProperty(JSON_PROPERTY_ATTRIBUTE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setAttributeBoolean(Boolean attributeBoolean) { + this.attributeBoolean = attributeBoolean; } - return o.toString().replace("\n", "\n "); - } + public XmlItem wrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + return this; + } + + public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { + if (this.wrappedArray == null) { + this.wrappedArray = new ArrayList<>(); + } + this.wrappedArray.add(wrappedArrayItem); + return this; + } + + /** + * Get wrappedArray + * + * @return wrappedArray + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getWrappedArray() { + return wrappedArray; + } + + @JsonProperty(JSON_PROPERTY_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setWrappedArray(List wrappedArray) { + this.wrappedArray = wrappedArray; + } + + public XmlItem nameString(String nameString) { + this.nameString = nameString; + return this; + } + + /** + * Get nameString + * + * @return nameString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNameString() { + return nameString; + } + + @JsonProperty(JSON_PROPERTY_NAME_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameString(String nameString) { + this.nameString = nameString; + } + + public XmlItem nameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + return this; + } + + /** + * Get nameNumber + * + * @return nameNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNameNumber() { + return nameNumber; + } + + @JsonProperty(JSON_PROPERTY_NAME_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameNumber(BigDecimal nameNumber) { + this.nameNumber = nameNumber; + } + + public XmlItem nameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + return this; + } + + /** + * Get nameInteger + * + * @return nameInteger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNameInteger() { + return nameInteger; + } + + @JsonProperty(JSON_PROPERTY_NAME_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameInteger(Integer nameInteger) { + this.nameInteger = nameInteger; + } + + public XmlItem nameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + return this; + } + + /** + * Get nameBoolean + * + * @return nameBoolean + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNameBoolean() { + return nameBoolean; + } + + @JsonProperty(JSON_PROPERTY_NAME_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameBoolean(Boolean nameBoolean) { + this.nameBoolean = nameBoolean; + } + + public XmlItem nameArray(List nameArray) { + this.nameArray = nameArray; + return this; + } + + public XmlItem addNameArrayItem(Integer nameArrayItem) { + if (this.nameArray == null) { + this.nameArray = new ArrayList<>(); + } + this.nameArray.add(nameArrayItem); + return this; + } + + /** + * Get nameArray + * + * @return nameArray + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameArray() { + return nameArray; + } + + @JsonProperty(JSON_PROPERTY_NAME_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameArray(List nameArray) { + this.nameArray = nameArray; + } + + public XmlItem nameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + return this; + } + + public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { + if (this.nameWrappedArray == null) { + this.nameWrappedArray = new ArrayList<>(); + } + this.nameWrappedArray.add(nameWrappedArrayItem); + return this; + } + + /** + * Get nameWrappedArray + * + * @return nameWrappedArray + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNameWrappedArray() { + return nameWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_NAME_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNameWrappedArray(List nameWrappedArray) { + this.nameWrappedArray = nameWrappedArray; + } + + public XmlItem prefixString(String prefixString) { + this.prefixString = prefixString; + return this; + } + + /** + * Get prefixString + * + * @return prefixString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixString() { + return prefixString; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixString(String prefixString) { + this.prefixString = prefixString; + } + + public XmlItem prefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + return this; + } + + /** + * Get prefixNumber + * + * @return prefixNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNumber() { + return prefixNumber; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNumber(BigDecimal prefixNumber) { + this.prefixNumber = prefixNumber; + } + + public XmlItem prefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + return this; + } + + /** + * Get prefixInteger + * + * @return prefixInteger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixInteger() { + return prefixInteger; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixInteger(Integer prefixInteger) { + this.prefixInteger = prefixInteger; + } + + public XmlItem prefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + return this; + } + + /** + * Get prefixBoolean + * + * @return prefixBoolean + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixBoolean() { + return prefixBoolean; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixBoolean(Boolean prefixBoolean) { + this.prefixBoolean = prefixBoolean; + } + + public XmlItem prefixArray(List prefixArray) { + this.prefixArray = prefixArray; + return this; + } + + public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { + if (this.prefixArray == null) { + this.prefixArray = new ArrayList<>(); + } + this.prefixArray.add(prefixArrayItem); + return this; + } + + /** + * Get prefixArray + * + * @return prefixArray + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixArray() { + return prefixArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixArray(List prefixArray) { + this.prefixArray = prefixArray; + } + + public XmlItem prefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + return this; + } + + public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { + if (this.prefixWrappedArray == null) { + this.prefixWrappedArray = new ArrayList<>(); + } + this.prefixWrappedArray.add(prefixWrappedArrayItem); + return this; + } + + /** + * Get prefixWrappedArray + * + * @return prefixWrappedArray + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixWrappedArray() { + return prefixWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixWrappedArray(List prefixWrappedArray) { + this.prefixWrappedArray = prefixWrappedArray; + } + + public XmlItem namespaceString(String namespaceString) { + this.namespaceString = namespaceString; + return this; + } + + /** + * Get namespaceString + * + * @return namespaceString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getNamespaceString() { + return namespaceString; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceString(String namespaceString) { + this.namespaceString = namespaceString; + } + + public XmlItem namespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + return this; + } + + /** + * Get namespaceNumber + * + * @return namespaceNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getNamespaceNumber() { + return namespaceNumber; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceNumber(BigDecimal namespaceNumber) { + this.namespaceNumber = namespaceNumber; + } + + public XmlItem namespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + return this; + } + + /** + * Get namespaceInteger + * + * @return namespaceInteger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getNamespaceInteger() { + return namespaceInteger; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceInteger(Integer namespaceInteger) { + this.namespaceInteger = namespaceInteger; + } + + public XmlItem namespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + return this; + } + + /** + * Get namespaceBoolean + * + * @return namespaceBoolean + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getNamespaceBoolean() { + return namespaceBoolean; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceBoolean(Boolean namespaceBoolean) { + this.namespaceBoolean = namespaceBoolean; + } + + public XmlItem namespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + return this; + } + + public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { + if (this.namespaceArray == null) { + this.namespaceArray = new ArrayList<>(); + } + this.namespaceArray.add(namespaceArrayItem); + return this; + } + + /** + * Get namespaceArray + * + * @return namespaceArray + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceArray() { + return namespaceArray; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceArray(List namespaceArray) { + this.namespaceArray = namespaceArray; + } + + public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + return this; + } + + public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { + if (this.namespaceWrappedArray == null) { + this.namespaceWrappedArray = new ArrayList<>(); + } + this.namespaceWrappedArray.add(namespaceWrappedArrayItem); + return this; + } + + /** + * Get namespaceWrappedArray + * + * @return namespaceWrappedArray + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getNamespaceWrappedArray() { + return namespaceWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_NAMESPACE_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setNamespaceWrappedArray(List namespaceWrappedArray) { + this.namespaceWrappedArray = namespaceWrappedArray; + } + + public XmlItem prefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + return this; + } + + /** + * Get prefixNsString + * + * @return prefixNsString + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPrefixNsString() { + return prefixNsString; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_STRING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsString(String prefixNsString) { + this.prefixNsString = prefixNsString; + } + + public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + return this; + } + + /** + * Get prefixNsNumber + * + * @return prefixNsNumber + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public BigDecimal getPrefixNsNumber() { + return prefixNsNumber; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsNumber(BigDecimal prefixNsNumber) { + this.prefixNsNumber = prefixNsNumber; + } + + public XmlItem prefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + return this; + } + + /** + * Get prefixNsInteger + * + * @return prefixNsInteger + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getPrefixNsInteger() { + return prefixNsInteger; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_INTEGER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsInteger(Integer prefixNsInteger) { + this.prefixNsInteger = prefixNsInteger; + } + + public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + return this; + } + + /** + * Get prefixNsBoolean + * + * @return prefixNsBoolean + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getPrefixNsBoolean() { + return prefixNsBoolean; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_BOOLEAN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsBoolean(Boolean prefixNsBoolean) { + this.prefixNsBoolean = prefixNsBoolean; + } + + public XmlItem prefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + return this; + } + + public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { + if (this.prefixNsArray == null) { + this.prefixNsArray = new ArrayList<>(); + } + this.prefixNsArray.add(prefixNsArrayItem); + return this; + } + + /** + * Get prefixNsArray + * + * @return prefixNsArray + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsArray() { + return prefixNsArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsArray(List prefixNsArray) { + this.prefixNsArray = prefixNsArray; + } + + public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + return this; + } + + public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { + if (this.prefixNsWrappedArray == null) { + this.prefixNsWrappedArray = new ArrayList<>(); + } + this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); + return this; + } + + /** + * Get prefixNsWrappedArray + * + * @return prefixNsWrappedArray + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getPrefixNsWrappedArray() { + return prefixNsWrappedArray; + } + + @JsonProperty(JSON_PROPERTY_PREFIX_NS_WRAPPED_ARRAY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { + this.prefixNsWrappedArray = prefixNsWrappedArray; + } + + /** Return true if this XmlItem object is equal to o. */ + @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); + } + + @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); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class XmlItem {\n"); + sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); + sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); + sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); + sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); + sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); + sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); + sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); + sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); + sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); + sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); + sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); + sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); + sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); + sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); + sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); + sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); + sb.append(" prefixWrappedArray: ") + .append(toIndentedString(prefixWrappedArray)) + .append("\n"); + sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); + sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); + sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); + sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); + sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); + sb.append(" namespaceWrappedArray: ") + .append(toIndentedString(namespaceWrappedArray)) + .append("\n"); + sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); + sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); + sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); + sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); + sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); + sb.append(" prefixNsWrappedArray: ") + .append(toIndentedString(prefixNsWrappedArray)) + .append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } } - 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 ebd1f700d566..7841aba42f57 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 @@ -3,274 +3,270 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import java.util.Map; -import java.util.HashMap; + import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.StringJoiner; -import java.util.Objects; -import java.util.Arrays; -import java.util.Map; -import java.util.HashMap; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.Objects; +import java.util.StringJoiner; - -/** - * Zebra - */ -@JsonPropertyOrder({ - Zebra.JSON_PROPERTY_TYPE, - Zebra.JSON_PROPERTY_CLASS_NAME -}) +/** Zebra */ +@JsonPropertyOrder({Zebra.JSON_PROPERTY_TYPE, Zebra.JSON_PROPERTY_CLASS_NAME}) @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen") public class Zebra extends HashMap { - /** - * Gets or Sets type - */ - public enum TypeEnum { - PLAINS("plains"), - - MOUNTAIN("mountain"), - - GREVYS("grevys"); + /** Gets or Sets type */ + public enum TypeEnum { + PLAINS("plains"), - private String value; + MOUNTAIN("mountain"), - TypeEnum(String value) { - this.value = value; + GREVYS("grevys"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } } - @JsonValue - public String getValue() { - return value; + public static final String JSON_PROPERTY_TYPE = "type"; + private TypeEnum type; + + public static final String JSON_PROPERTY_CLASS_NAME = "className"; + private String className; + + public Zebra() {} + + public Zebra type(TypeEnum type) { + this.type = type; + return this; + } + + /** + * Get type + * + * @return type + */ + @javax.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public TypeEnum getType() { + return type; + } + + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(TypeEnum type) { + this.type = type; + } + + public Zebra className(String className) { + this.className = className; + return this; + } + + /** + * Get className + * + * @return className + */ + @javax.annotation.Nonnull + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getClassName() { + return className; + } + + @JsonProperty(JSON_PROPERTY_CLASS_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setClassName(String className) { + this.className = className; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key the name of the property + * @param value the value of the property + * @return self reference + */ + @JsonAnySetter + public Zebra putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) properties. + * + * @return the additional (undeclared) properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key the name of the property + * @return the additional (undeclared) property with the specified name + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this zebra object is equal to o. */ + @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); + } + + @Override + public int hashCode() { + return Objects.hash(type, className, super.hashCode(), additionalProperties); } @Override public String toString() { - return String.valueOf(value); + StringBuilder sb = new StringBuilder(); + sb.append("class Zebra {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" className: ").append(toIndentedString(className)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append("}"); + return sb.toString(); } - @JsonCreator - public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.value.equals(value)) { - return b; + /** + * Convert the given object to string with each line indented by 4 spaces (except the first + * line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - public static final String JSON_PROPERTY_TYPE = "type"; - private TypeEnum type; - - public static final String JSON_PROPERTY_CLASS_NAME = "className"; - private String className; - - public Zebra() { - } - - public Zebra type(TypeEnum type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @javax.annotation.Nullable - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public TypeEnum getType() { - return type; - } - - - @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setType(TypeEnum type) { - this.type = type; - } - - - public Zebra className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - **/ - @javax.annotation.Nonnull - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - - public String getClassName() { - return className; - } - - - @JsonProperty(JSON_PROPERTY_CLASS_NAME) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public void setClassName(String className) { - this.className = className; - } - - /** - * A container for additional, undeclared properties. - * This is a holder for any undeclared properties as specified with - * the 'additionalProperties' keyword in the OAS document. - */ - private Map additionalProperties; - - /** - * Set the additional (undeclared) property with the specified name and value. - * If the property does not already exist, create it otherwise replace it. - * @param key the name of the property - * @param value the value of the property - * @return self reference - */ - @JsonAnySetter - public Zebra putAdditionalProperty(String key, Object value) { - if (this.additionalProperties == null) { - this.additionalProperties = new HashMap(); - } - this.additionalProperties.put(key, value); - return this; - } - - /** - * Return the additional (undeclared) properties. - * @return the additional (undeclared) properties - */ - @JsonAnyGetter - public Map getAdditionalProperties() { - return additionalProperties; - } - - /** - * Return the additional (undeclared) property with the specified name. - * @param key the name of the property - * @return the additional (undeclared) property with the specified name - */ - public Object getAdditionalProperty(String key) { - if (this.additionalProperties == null) { - return null; - } - return this.additionalProperties.get(key); - } - - /** - * Return true if this zebra object is equal to o. - */ - @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); - } - - @Override - public int hashCode() { - return Objects.hash(type, className, super.hashCode(), additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Zebra {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - - /** - * Convert the instance into URL query string. - * - * @return URL query string - */ - public String toUrlQueryString() { - return toUrlQueryString(null); - } - - /** - * Convert the instance into URL query string. - * - * @param prefix prefix of the query string - * @return URL query string - */ - public String toUrlQueryString(String prefix) { - String suffix = ""; - String containerSuffix = ""; - String containerPrefix = ""; - if (prefix == null) { - // style=form, explode=true, e.g. /pet?name=cat&type=manx - prefix = ""; - } else { - // deepObject style e.g. /pet?id[name]=cat&id[type]=manx - prefix = prefix + "["; - suffix = "]"; - containerSuffix = "]"; - containerPrefix = "["; + return o.toString().replace("\n", "\n "); } - StringJoiner joiner = new StringJoiner("&"); - - // add `type` to the URL query string - if (getType() != null) { - joiner.add(String.format("%stype%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); + /** + * Convert the instance into URL query string. + * + * @return URL query string + */ + public String toUrlQueryString() { + return toUrlQueryString(null); } - // add `className` to the URL query string - if (getClassName() != null) { - joiner.add(String.format("%sclassName%s=%s", prefix, suffix, URLEncoder.encode(String.valueOf(getClassName()), StandardCharsets.UTF_8).replaceAll("\\+", "%20"))); - } + /** + * Convert the instance into URL query string. + * + * @param prefix prefix of the query string + * @return URL query string + */ + public String toUrlQueryString(String prefix) { + String suffix = ""; + String containerSuffix = ""; + String containerPrefix = ""; + if (prefix == null) { + // style=form, explode=true, e.g. /pet?name=cat&type=manx + prefix = ""; + } else { + // deepObject style e.g. /pet?id[name]=cat&id[type]=manx + prefix = prefix + "["; + suffix = "]"; + containerSuffix = "]"; + containerPrefix = "["; + } - return joiner.toString(); - } + StringJoiner joiner = new StringJoiner("&"); + + // add `type` to the URL query string + if (getType() != null) { + joiner.add( + String.format( + "%stype%s=%s", + prefix, + suffix, + URLEncoder.encode(String.valueOf(getType()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + // add `className` to the URL query string + if (getClassName() != null) { + joiner.add( + String.format( + "%sclassName%s=%s", + prefix, + suffix, + URLEncoder.encode( + String.valueOf(getClassName()), StandardCharsets.UTF_8) + .replaceAll("\\+", "%20"))); + } + + return joiner.toString(); + } } - diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java index b0d39879d430..ea437ef7e76a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/AnotherFakeApiTest.java @@ -3,52 +3,39 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; + +import org.junit.Ignore; +import org.junit.Test; import org.openapitools.client.ApiException; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - - -/** - * API tests for AnotherFakeApi - */ +/** API tests for AnotherFakeApi */ @Ignore public class AnotherFakeApiTest { private final AnotherFakeApi api = new AnotherFakeApi(); - /** * To test special tags * - * To test special tags and operation ID starting with number + *

To test special tags and operation ID starting with number * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void call123testSpecialTagsTest() throws ApiException { Client client = null; - Client response = - api.call123testSpecialTags(client); - + Client response = api.call123testSpecialTags(client); + // TODO: test validations } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/DefaultApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/DefaultApiTest.java index ce4c89075201..2c18c2d3b54f 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/DefaultApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/DefaultApiTest.java @@ -3,51 +3,32 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; + +import org.junit.Ignore; +import org.junit.Test; import org.openapitools.client.ApiException; import org.openapitools.client.model.FooGetDefaultResponse; -import org.junit.Test; -import org.junit.Ignore; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - - -/** - * API tests for DefaultApi - */ +/** API tests for DefaultApi */ @Ignore public class DefaultApiTest { private final DefaultApi api = new DefaultApi(); - - /** - * - * - * - * - * @throws ApiException - * if the Api call fails - */ + /** @throws ApiException if the Api call fails */ @Test public void fooGetTest() throws ApiException { - FooGetDefaultResponse response = - api.fooGet(); - + FooGetDefaultResponse response = api.fooGet(); + // TODO: test validations } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeApiTest.java index e91b2e418741..c49cef7234ac 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeApiTest.java @@ -3,205 +3,160 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import java.math.BigDecimal; -import org.openapitools.client.model.Client; + import java.io.File; -import org.openapitools.client.model.FileSchemaTestClass; -import org.openapitools.client.model.HealthCheckResult; +import java.math.BigDecimal; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.List; +import java.util.Map; +import org.junit.Ignore; +import org.junit.Test; +import org.openapitools.client.ApiException; +import org.openapitools.client.model.Client; +import org.openapitools.client.model.FileSchemaTestClass; +import org.openapitools.client.model.HealthCheckResult; import org.openapitools.client.model.OuterComposite; import org.openapitools.client.model.OuterEnum; import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - - -/** - * API tests for FakeApi - */ +/** API tests for FakeApi */ @Ignore public class FakeApiTest { private final FakeApi api = new FakeApi(); - /** * Health check endpoint * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void fakeHealthGetTest() throws ApiException { - HealthCheckResult response = - api.fakeHealthGet(); - + HealthCheckResult response = api.fakeHealthGet(); + // TODO: test validations } - + /** - * - * * Test serialization of outer boolean types * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void fakeOuterBooleanSerializeTest() throws ApiException { Boolean body = null; - Boolean response = - api.fakeOuterBooleanSerialize(body); - + Boolean response = api.fakeOuterBooleanSerialize(body); + // TODO: test validations } - + /** - * - * * Test serialization of object with outer number type * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void fakeOuterCompositeSerializeTest() throws ApiException { OuterComposite outerComposite = null; - OuterComposite response = - api.fakeOuterCompositeSerialize(outerComposite); - + OuterComposite response = api.fakeOuterCompositeSerialize(outerComposite); + // TODO: test validations } - + /** - * - * * Test serialization of outer number types * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void fakeOuterNumberSerializeTest() throws ApiException { BigDecimal body = null; - BigDecimal response = - api.fakeOuterNumberSerialize(body); - + BigDecimal response = api.fakeOuterNumberSerialize(body); + // TODO: test validations } - + /** - * - * * Test serialization of outer string types * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void fakeOuterStringSerializeTest() throws ApiException { String body = null; - String response = - api.fakeOuterStringSerialize(body); - + String response = api.fakeOuterStringSerialize(body); + // TODO: test validations } - + /** * Array of Enums * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void getArrayOfEnumsTest() throws ApiException { - List response = - api.getArrayOfEnums(); - + List response = api.getArrayOfEnums(); + // TODO: test validations } - + /** - * - * * For this test, the body for this request much reference a schema named `File`. * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testBodyWithFileSchemaTest() throws ApiException { FileSchemaTestClass fileSchemaTestClass = null; - + api.testBodyWithFileSchema(fileSchemaTestClass); - + // TODO: test validations } - - /** - * - * - * - * - * @throws ApiException - * if the Api call fails - */ + + /** @throws ApiException if the Api call fails */ @Test public void testBodyWithQueryParamsTest() throws ApiException { String query = null; User user = null; - + api.testBodyWithQueryParams(query, user); - + // TODO: test validations } - + /** * To test \"client\" model * - * To test \"client\" model + *

To test \"client\" model * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testClientModelTest() throws ApiException { Client client = null; - Client response = - api.testClientModel(client); - + Client response = api.testClientModel(client); + // TODO: test validations } - + /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + *

Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testEndpointParametersTest() throws ApiException { @@ -219,19 +174,32 @@ public class FakeApiTest { OffsetDateTime dateTime = null; String password = null; String paramCallback = null; - - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - + + api.testEndpointParameters( + number, + _double, + patternWithoutDelimiter, + _byte, + integer, + int32, + int64, + _float, + string, + binary, + date, + dateTime, + password, + paramCallback); + // TODO: test validations } - + /** * To test enum parameters * - * To test enum parameters + *

To test enum parameters * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testEnumParametersTest() throws ApiException { @@ -243,19 +211,26 @@ public class FakeApiTest { Double enumQueryDouble = null; List enumFormStringArray = null; String enumFormString = null; - - api.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString); - + + api.testEnumParameters( + enumHeaderStringArray, + enumHeaderString, + enumQueryStringArray, + enumQueryString, + enumQueryInteger, + enumQueryDouble, + enumFormStringArray, + enumFormString); + // TODO: test validations } - + /** * Fake endpoint to test group parameters (optional) * - * Fake endpoint to test group parameters (optional) + *

Fake endpoint to test group parameters (optional) * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testGroupParametersTest() throws ApiException { @@ -265,63 +240,55 @@ public class FakeApiTest { Integer stringGroup = null; Boolean booleanGroup = null; Long int64Group = null; - - FakeApi.APItestGroupParametersRequest request = FakeApi.APItestGroupParametersRequest.newBuilder() - .requiredStringGroup(requiredStringGroup) - .requiredBooleanGroup(requiredBooleanGroup) - .requiredInt64Group(requiredInt64Group) - .stringGroup(stringGroup) - .booleanGroup(booleanGroup) - .int64Group(int64Group) - .build(); - + + FakeApi.APItestGroupParametersRequest request = + FakeApi.APItestGroupParametersRequest.newBuilder() + .requiredStringGroup(requiredStringGroup) + .requiredBooleanGroup(requiredBooleanGroup) + .requiredInt64Group(requiredInt64Group) + .stringGroup(stringGroup) + .booleanGroup(booleanGroup) + .int64Group(int64Group) + .build(); + api.testGroupParameters(request); // TODO: test validations } - + /** * test inline additionalProperties * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testInlineAdditionalPropertiesTest() throws ApiException { Map requestBody = null; - + api.testInlineAdditionalProperties(requestBody); - + // TODO: test validations } - + /** * test json serialization of form data * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testJsonFormDataTest() throws ApiException { String param = null; String param2 = null; - + api.testJsonFormData(param, param2); - + // TODO: test validations } - + /** - * - * * To test the collection format in query parameters * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testQueryParameterCollectionFormatTest() throws ApiException { @@ -330,10 +297,9 @@ public class FakeApiTest { List http = null; List url = null; List context = null; - + api.testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); - + // TODO: test validations } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java index 005434c820ff..9e07923c46b9 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/FakeClassnameTags123ApiTest.java @@ -3,52 +3,39 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; + +import org.junit.Ignore; +import org.junit.Test; import org.openapitools.client.ApiException; import org.openapitools.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - - -/** - * API tests for FakeClassnameTags123Api - */ +/** API tests for FakeClassnameTags123Api */ @Ignore public class FakeClassnameTags123ApiTest { private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); - /** * To test class name in snake case * - * To test class name in snake case + *

To test class name in snake case * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void testClassnameTest() throws ApiException { Client client = null; - Client response = - api.testClassname(client); - + Client response = api.testClassname(client); + // TODO: test validations } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java index 304a7911b1c5..16aba5c98d34 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/PetApiTest.java @@ -3,197 +3,163 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.ApiException; + import java.io.File; +import java.util.List; +import org.junit.Ignore; +import org.junit.Test; +import org.openapitools.client.ApiException; import org.openapitools.client.model.ModelApiResponse; import org.openapitools.client.model.Pet; -import org.junit.Test; -import org.junit.Ignore; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - - -/** - * API tests for PetApi - */ +/** API tests for PetApi */ @Ignore public class PetApiTest { private final PetApi api = new PetApi(); - /** * Add a new pet to the store * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void addPetTest() throws ApiException { Pet pet = null; - + api.addPet(pet); - + // TODO: test validations } - + /** * Deletes a pet * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void deletePetTest() throws ApiException { Long petId = null; String apiKey = null; - + api.deletePet(petId, apiKey); - + // TODO: test validations } - + /** * Finds Pets by status * - * Multiple status values can be provided with comma separated strings + *

Multiple status values can be provided with comma separated strings * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void findPetsByStatusTest() throws ApiException { List status = null; - List response = - api.findPetsByStatus(status); - + List response = api.findPetsByStatus(status); + // TODO: test validations } - + /** * Finds Pets by tags * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + *

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for + * testing. * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void findPetsByTagsTest() throws ApiException { List tags = null; - List response = - api.findPetsByTags(tags); - + List response = api.findPetsByTags(tags); + // TODO: test validations } - + /** * Find pet by ID * - * Returns a single pet + *

Returns a single pet * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void getPetByIdTest() throws ApiException { Long petId = null; - Pet response = - api.getPetById(petId); - + Pet response = api.getPetById(petId); + // TODO: test validations } - + /** * Update an existing pet * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void updatePetTest() throws ApiException { Pet pet = null; - + api.updatePet(pet); - + // TODO: test validations } - + /** * Updates a pet in the store with form data * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void updatePetWithFormTest() throws ApiException { Long petId = null; String name = null; String status = null; - + api.updatePetWithForm(petId, name, status); - + // TODO: test validations } - + /** * uploads an image * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void uploadFileTest() throws ApiException { Long petId = null; String additionalMetadata = null; File _file = null; - ModelApiResponse response = - api.uploadFile(petId, additionalMetadata, _file); - + ModelApiResponse response = api.uploadFile(petId, additionalMetadata, _file); + // TODO: test validations } - + /** * uploads an image (required) * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void uploadFileWithRequiredFileTest() throws ApiException { Long petId = null; File requiredFile = null; String additionalMetadata = null; - ModelApiResponse response = - api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); - + ModelApiResponse response = + api.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata); + // TODO: test validations } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/StoreApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/StoreApiTest.java index 6d3e1bc7eac8..4c9cb044fd15 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/StoreApiTest.java @@ -3,102 +3,85 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; + +import java.util.Map; +import org.junit.Ignore; +import org.junit.Test; import org.openapitools.client.ApiException; import org.openapitools.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; - - -/** - * API tests for StoreApi - */ +/** API tests for StoreApi */ @Ignore public class StoreApiTest { private final StoreApi api = new StoreApi(); - /** * Delete purchase order by ID * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + *

For valid response try integer IDs with value < 1000. Anything above 1000 or + * nonintegers will generate API errors * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void deleteOrderTest() throws ApiException { String orderId = null; - + api.deleteOrder(orderId); - + // TODO: test validations } - + /** * Returns pet inventories by status * - * Returns a map of status codes to quantities + *

Returns a map of status codes to quantities * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void getInventoryTest() throws ApiException { - Map response = - api.getInventory(); - + Map response = api.getInventory(); + // TODO: test validations } - + /** * Find purchase order by ID * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions + *

For valid response try integer IDs with value <= 5 or > 10. Other values will + * generate exceptions * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void getOrderByIdTest() throws ApiException { Long orderId = null; - Order response = - api.getOrderById(orderId); - + Order response = api.getOrderById(orderId); + // TODO: test validations } - + /** * Place an order for a pet * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void placeOrderTest() throws ApiException { Order order = null; - Order response = - api.placeOrder(order); - + Order response = api.placeOrder(order); + // TODO: test validations } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/UserApiTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/UserApiTest.java index 4ffe22ee19e5..124174700ae2 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/UserApiTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/api/UserApiTest.java @@ -3,173 +3,142 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.api; -import org.openapitools.client.ApiException; -import java.time.OffsetDateTime; -import org.openapitools.client.model.User; -import org.junit.Test; -import org.junit.Ignore; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.Set; +import org.junit.Ignore; +import org.junit.Test; +import org.openapitools.client.ApiException; +import org.openapitools.client.model.User; - -/** - * API tests for UserApi - */ +/** API tests for UserApi */ @Ignore public class UserApiTest { private final UserApi api = new UserApi(); - /** * Create user * - * This can only be done by the logged in user. + *

This can only be done by the logged in user. * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void createUserTest() throws ApiException { User user = null; - + api.createUser(user); - + // TODO: test validations } - + /** * Creates list of users with given input array * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void createUsersWithArrayInputTest() throws ApiException { List user = null; - + api.createUsersWithArrayInput(user); - + // TODO: test validations } - + /** * Creates list of users with given input array * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void createUsersWithListInputTest() throws ApiException { List user = null; - + api.createUsersWithListInput(user); - + // TODO: test validations } - + /** * Delete user * - * This can only be done by the logged in user. + *

This can only be done by the logged in user. * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void deleteUserTest() throws ApiException { String username = null; - + api.deleteUser(username); - + // TODO: test validations } - + /** * Get user by user name * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void getUserByNameTest() throws ApiException { String username = null; - User response = - api.getUserByName(username); - + User response = api.getUserByName(username); + // TODO: test validations } - + /** * Logs user into the system * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void loginUserTest() throws ApiException { String username = null; String password = null; - String response = - api.loginUser(username, password); - + String response = api.loginUser(username, password); + // TODO: test validations } - + /** * Logs out current logged in user session * - * - * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void logoutUserTest() throws ApiException { - + api.logoutUser(); - + // TODO: test validations } - + /** * Updated user * - * This can only be done by the logged in user. + *

This can only be done by the logged in user. * - * @throws ApiException - * if the Api call fails + * @throws ApiException if the Api call fails */ @Test public void updateUserTest() throws ApiException { String username = null; User user = null; - + api.updateUser(username, user); - + // TODO: test validations } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java index 94f0881ce428..69c79f27f0fe 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AdditionalPropertiesClassTest.java @@ -3,56 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for AdditionalPropertiesClass - */ +/** Model tests for AdditionalPropertiesClass */ public class AdditionalPropertiesClassTest { private final AdditionalPropertiesClass model = new AdditionalPropertiesClass(); - /** - * Model tests for AdditionalPropertiesClass - */ + /** Model tests for AdditionalPropertiesClass */ @Test public void testAdditionalPropertiesClass() { // TODO: test AdditionalPropertiesClass } - /** - * Test the property 'mapProperty' - */ + /** Test the property 'mapProperty' */ @Test public void mapPropertyTest() { // TODO: test mapProperty } - /** - * Test the property 'mapOfMapProperty' - */ + /** Test the property 'mapOfMapProperty' */ @Test public void mapOfMapPropertyTest() { // TODO: test mapOfMapProperty } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java index 1acef2d3969b..58a715347298 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AllOfWithSingleRefTest.java @@ -3,55 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.SingleRefType; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for AllOfWithSingleRef - */ +/** Model tests for AllOfWithSingleRef */ public class AllOfWithSingleRefTest { private final AllOfWithSingleRef model = new AllOfWithSingleRef(); - /** - * Model tests for AllOfWithSingleRef - */ + /** Model tests for AllOfWithSingleRef */ @Test public void testAllOfWithSingleRef() { // TODO: test AllOfWithSingleRef } - /** - * Test the property 'username' - */ + /** Test the property 'username' */ @Test public void usernameTest() { // TODO: test username } - /** - * Test the property 'singleRefType' - */ + /** Test the property 'singleRefType' */ @Test public void singleRefTypeTest() { // TODO: test singleRefType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AnimalTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AnimalTest.java index 15d5c977c6bb..5af3b58f8835 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AnimalTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AnimalTest.java @@ -3,59 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Cat; -import org.openapitools.client.model.Dog; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Animal - */ +/** Model tests for Animal */ public class AnimalTest { private final Animal model = new Animal(); - /** - * Model tests for Animal - */ + /** Model tests for Animal */ @Test public void testAnimal() { // TODO: test Animal } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - /** - * Test the property 'color' - */ + /** Test the property 'color' */ @Test public void colorTest() { // TODO: test color } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleReqTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleReqTest.java index d9ccc722303e..e3f4ea7c7cc0 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleReqTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleReqTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for AppleReq - */ +/** Model tests for AppleReq */ public class AppleReqTest { private final AppleReq model = new AppleReq(); - /** - * Model tests for AppleReq - */ + /** Model tests for AppleReq */ @Test public void testAppleReq() { // TODO: test AppleReq } - /** - * Test the property 'cultivar' - */ + /** Test the property 'cultivar' */ @Test public void cultivarTest() { // TODO: test cultivar } - /** - * Test the property 'mealy' - */ + /** Test the property 'mealy' */ @Test public void mealyTest() { // TODO: test mealy } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleTest.java index 2eb05360fa7f..c8dabf4b6267 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/AppleTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Apple - */ +/** Model tests for Apple */ public class AppleTest { private final Apple model = new Apple(); - /** - * Model tests for Apple - */ + /** Model tests for Apple */ @Test public void testApple() { // TODO: test Apple } - /** - * Test the property 'cultivar' - */ + /** Test the property 'cultivar' */ @Test public void cultivarTest() { // TODO: test cultivar } - /** - * Test the property 'origin' - */ + /** Test the property 'origin' */ @Test public void originTest() { // TODO: test origin } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayDefaultValueTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayDefaultValueTest.java index a7befd2fc71f..6da71bdc536b 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayDefaultValueTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayDefaultValueTest.java @@ -3,56 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ArrayDefaultValue - */ +/** Model tests for ArrayDefaultValue */ public class ArrayDefaultValueTest { private final ArrayDefaultValue model = new ArrayDefaultValue(); - /** - * Model tests for ArrayDefaultValue - */ + /** Model tests for ArrayDefaultValue */ @Test public void testArrayDefaultValue() { // TODO: test ArrayDefaultValue } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'outcomes' - */ + /** Test the property 'outcomes' */ @Test public void outcomesTest() { // TODO: test outcomes } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java index 57a1c4f37ec5..94af7e2daeae 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnlyTest.java @@ -3,49 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ArrayOfArrayOfNumberOnly - */ +/** Model tests for ArrayOfArrayOfNumberOnly */ public class ArrayOfArrayOfNumberOnlyTest { private final ArrayOfArrayOfNumberOnly model = new ArrayOfArrayOfNumberOnly(); - /** - * Model tests for ArrayOfArrayOfNumberOnly - */ + /** Model tests for ArrayOfArrayOfNumberOnly */ @Test public void testArrayOfArrayOfNumberOnly() { // TODO: test ArrayOfArrayOfNumberOnly } - /** - * Test the property 'arrayArrayNumber' - */ + /** Test the property 'arrayArrayNumber' */ @Test public void arrayArrayNumberTest() { // TODO: test arrayArrayNumber } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java index 4f127b838bc8..85ae89bd62bb 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayOfNumberOnlyTest.java @@ -3,49 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ArrayOfNumberOnly - */ +/** Model tests for ArrayOfNumberOnly */ public class ArrayOfNumberOnlyTest { private final ArrayOfNumberOnly model = new ArrayOfNumberOnly(); - /** - * Model tests for ArrayOfNumberOnly - */ + /** Model tests for ArrayOfNumberOnly */ @Test public void testArrayOfNumberOnly() { // TODO: test ArrayOfNumberOnly } - /** - * Test the property 'arrayNumber' - */ + /** Test the property 'arrayNumber' */ @Test public void arrayNumberTest() { // TODO: test arrayNumber } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayTestTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayTestTest.java index 5874400602c2..bc1504f78c56 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayTestTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ArrayTestTest.java @@ -3,65 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.ReadOnlyFirst; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ArrayTest - */ +/** Model tests for ArrayTest */ public class ArrayTestTest { private final ArrayTest model = new ArrayTest(); - /** - * Model tests for ArrayTest - */ + /** Model tests for ArrayTest */ @Test public void testArrayTest() { // TODO: test ArrayTest } - /** - * Test the property 'arrayOfString' - */ + /** Test the property 'arrayOfString' */ @Test public void arrayOfStringTest() { // TODO: test arrayOfString } - /** - * Test the property 'arrayArrayOfInteger' - */ + /** Test the property 'arrayArrayOfInteger' */ @Test public void arrayArrayOfIntegerTest() { // TODO: test arrayArrayOfInteger } - /** - * Test the property 'arrayArrayOfModel' - */ + /** Test the property 'arrayArrayOfModel' */ @Test public void arrayArrayOfModelTest() { // TODO: test arrayArrayOfModel } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaReqTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaReqTest.java index 4600d943d5e7..46242439253f 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaReqTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaReqTest.java @@ -3,55 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for BananaReq - */ +/** Model tests for BananaReq */ public class BananaReqTest { private final BananaReq model = new BananaReq(); - /** - * Model tests for BananaReq - */ + /** Model tests for BananaReq */ @Test public void testBananaReq() { // TODO: test BananaReq } - /** - * Test the property 'lengthCm' - */ + /** Test the property 'lengthCm' */ @Test public void lengthCmTest() { // TODO: test lengthCm } - /** - * Test the property 'sweet' - */ + /** Test the property 'sweet' */ @Test public void sweetTest() { // TODO: test sweet } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaTest.java index 0f2d70f73bb5..62d54be69923 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BananaTest.java @@ -3,47 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Banana - */ +/** Model tests for Banana */ public class BananaTest { private final Banana model = new Banana(); - /** - * Model tests for Banana - */ + /** Model tests for Banana */ @Test public void testBanana() { // TODO: test Banana } - /** - * Test the property 'lengthCm' - */ + /** Test the property 'lengthCm' */ @Test public void lengthCmTest() { // TODO: test lengthCm } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BasquePigTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BasquePigTest.java index 0685bc78acde..01a511170d93 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BasquePigTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/BasquePigTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for BasquePig - */ +/** Model tests for BasquePig */ public class BasquePigTest { private final BasquePig model = new BasquePig(); - /** - * Model tests for BasquePig - */ + /** Model tests for BasquePig */ @Test public void testBasquePig() { // TODO: test BasquePig } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CapitalizationTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CapitalizationTest.java index c69ffc12a073..d4777eef31d5 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CapitalizationTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CapitalizationTest.java @@ -3,86 +3,61 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Capitalization - */ +/** Model tests for Capitalization */ public class CapitalizationTest { private final Capitalization model = new Capitalization(); - /** - * Model tests for Capitalization - */ + /** Model tests for Capitalization */ @Test public void testCapitalization() { // TODO: test Capitalization } - /** - * Test the property 'smallCamel' - */ + /** Test the property 'smallCamel' */ @Test public void smallCamelTest() { // TODO: test smallCamel } - /** - * Test the property 'capitalCamel' - */ + /** Test the property 'capitalCamel' */ @Test public void capitalCamelTest() { // TODO: test capitalCamel } - /** - * Test the property 'smallSnake' - */ + /** Test the property 'smallSnake' */ @Test public void smallSnakeTest() { // TODO: test smallSnake } - /** - * Test the property 'capitalSnake' - */ + /** Test the property 'capitalSnake' */ @Test public void capitalSnakeTest() { // TODO: test capitalSnake } - /** - * Test the property 'scAETHFlowPoints' - */ + /** Test the property 'scAETHFlowPoints' */ @Test public void scAETHFlowPointsTest() { // TODO: test scAETHFlowPoints } - /** - * Test the property 'ATT_NAME' - */ + /** Test the property 'ATT_NAME' */ @Test public void ATT_NAMETest() { // TODO: test ATT_NAME } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatAllOfTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatAllOfTest.java index 269bdbe11b74..48851c596692 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatAllOfTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatAllOfTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for CatAllOf - */ +/** Model tests for CatAllOf */ public class CatAllOfTest { private final CatAllOf model = new CatAllOf(); - /** - * Model tests for CatAllOf - */ + /** Model tests for CatAllOf */ @Test public void testCatAllOf() { // TODO: test CatAllOf } - /** - * Test the property 'declawed' - */ + /** Test the property 'declawed' */ @Test public void declawedTest() { // TODO: test declawed } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatTest.java index c3827d3a2e38..b01ec3850f53 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CatTest.java @@ -3,66 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Cat - */ +/** Model tests for Cat */ public class CatTest { private final Cat model = new Cat(); - /** - * Model tests for Cat - */ + /** Model tests for Cat */ @Test public void testCat() { // TODO: test Cat } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - /** - * Test the property 'color' - */ + /** Test the property 'color' */ @Test public void colorTest() { // TODO: test color } - /** - * Test the property 'declawed' - */ + /** Test the property 'declawed' */ @Test public void declawedTest() { // TODO: test declawed } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java index 393f73bd5e63..cd05d379cc6f 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/CategoryTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Category - */ +/** Model tests for Category */ public class CategoryTest { private final Category model = new Category(); - /** - * Model tests for Category - */ + /** Model tests for Category */ @Test public void testCategory() { // TODO: test Category } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatAllOfTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatAllOfTest.java index 99923d52c56e..1e5a2d952151 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatAllOfTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatAllOfTest.java @@ -3,56 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Set; -import java.util.HashSet; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ChildCatAllOf - */ +/** Model tests for ChildCatAllOf */ public class ChildCatAllOfTest { private final ChildCatAllOf model = new ChildCatAllOf(); - /** - * Model tests for ChildCatAllOf - */ + /** Model tests for ChildCatAllOf */ @Test public void testChildCatAllOf() { // TODO: test ChildCatAllOf } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - /** - * Test the property 'petType' - */ + /** Test the property 'petType' */ @Test public void petTypeTest() { // TODO: test petType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatTest.java index 0a7641556e37..2c546817486f 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ChildCatTest.java @@ -3,60 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ParentPet; -import java.util.Set; -import java.util.HashSet; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ChildCat - */ +/** Model tests for ChildCat */ public class ChildCatTest { private final ChildCat model = new ChildCat(); - /** - * Model tests for ChildCat - */ + /** Model tests for ChildCat */ @Test public void testChildCat() { // TODO: test ChildCat } - /** - * Test the property 'petType' - */ + /** Test the property 'petType' */ @Test public void petTypeTest() { // TODO: test petType } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClassModelTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClassModelTest.java index 5005bcb800e6..8c8ce098e547 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClassModelTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClassModelTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ClassModel - */ +/** Model tests for ClassModel */ public class ClassModelTest { private final ClassModel model = new ClassModel(); - /** - * Model tests for ClassModel - */ + /** Model tests for ClassModel */ @Test public void testClassModel() { // TODO: test ClassModel } - /** - * Test the property 'propertyClass' - */ + /** Test the property 'propertyClass' */ @Test public void propertyClassTest() { // TODO: test propertyClass } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClientTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClientTest.java index bda3b360b744..ef81fbb719aa 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClientTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ClientTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Client - */ +/** Model tests for Client */ public class ClientTest { private final Client model = new Client(); - /** - * Model tests for Client - */ + /** Model tests for Client */ @Test public void testClient() { // TODO: test Client } - /** - * Test the property 'client' - */ + /** Test the property 'client' */ @Test public void clientTest() { // TODO: test client } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java index 8c22f071a849..d155289e744c 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ComplexQuadrilateralTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ComplexQuadrilateral - */ +/** Model tests for ComplexQuadrilateral */ public class ComplexQuadrilateralTest { private final ComplexQuadrilateral model = new ComplexQuadrilateral(); - /** - * Model tests for ComplexQuadrilateral - */ + /** Model tests for ComplexQuadrilateral */ @Test public void testComplexQuadrilateral() { // TODO: test ComplexQuadrilateral } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - /** - * Test the property 'quadrilateralType' - */ + /** Test the property 'quadrilateralType' */ @Test public void quadrilateralTypeTest() { // TODO: test quadrilateralType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DanishPigTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DanishPigTest.java index 8f7c39b38709..6bdc4a667eda 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DanishPigTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DanishPigTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for DanishPig - */ +/** Model tests for DanishPig */ public class DanishPigTest { private final DanishPig model = new DanishPig(); - /** - * Model tests for DanishPig - */ + /** Model tests for DanishPig */ @Test public void testDanishPig() { // TODO: test DanishPig } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java index a61e43f63af0..1f5c24391438 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DeprecatedObjectTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for DeprecatedObject - */ +/** Model tests for DeprecatedObject */ public class DeprecatedObjectTest { private final DeprecatedObject model = new DeprecatedObject(); - /** - * Model tests for DeprecatedObject - */ + /** Model tests for DeprecatedObject */ @Test public void testDeprecatedObject() { // TODO: test DeprecatedObject } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogAllOfTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogAllOfTest.java index dfa91c25ec8a..7fc3b010aedc 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogAllOfTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogAllOfTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for DogAllOf - */ +/** Model tests for DogAllOf */ public class DogAllOfTest { private final DogAllOf model = new DogAllOf(); - /** - * Model tests for DogAllOf - */ + /** Model tests for DogAllOf */ @Test public void testDogAllOf() { // TODO: test DogAllOf } - /** - * Test the property 'breed' - */ + /** Test the property 'breed' */ @Test public void breedTest() { // TODO: test breed } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogTest.java index de77d6711bda..de880cb27030 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DogTest.java @@ -3,66 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Dog - */ +/** Model tests for Dog */ public class DogTest { private final Dog model = new Dog(); - /** - * Model tests for Dog - */ + /** Model tests for Dog */ @Test public void testDog() { // TODO: test Dog } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - /** - * Test the property 'color' - */ + /** Test the property 'color' */ @Test public void colorTest() { // TODO: test color } - /** - * Test the property 'breed' - */ + /** Test the property 'breed' */ @Test public void breedTest() { // TODO: test breed } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DrawingTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DrawingTest.java index 61b5ed74c4f1..6d23b66561eb 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DrawingTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/DrawingTest.java @@ -3,82 +3,49 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.client.model.Fruit; -import org.openapitools.client.model.NullableShape; -import org.openapitools.client.model.Shape; -import org.openapitools.client.model.ShapeOrNull; -import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Drawing - */ +/** Model tests for Drawing */ public class DrawingTest { private final Drawing model = new Drawing(); - /** - * Model tests for Drawing - */ + /** Model tests for Drawing */ @Test public void testDrawing() { // TODO: test Drawing } - /** - * Test the property 'mainShape' - */ + /** Test the property 'mainShape' */ @Test public void mainShapeTest() { // TODO: test mainShape } - /** - * Test the property 'shapeOrNull' - */ + /** Test the property 'shapeOrNull' */ @Test public void shapeOrNullTest() { // TODO: test shapeOrNull } - /** - * Test the property 'nullableShape' - */ + /** Test the property 'nullableShape' */ @Test public void nullableShapeTest() { // TODO: test nullableShape } - /** - * Test the property 'shapes' - */ + /** Test the property 'shapes' */ @Test public void shapesTest() { // TODO: test shapes } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumArraysTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumArraysTest.java index 73206626b9c1..094bd9289da0 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumArraysTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumArraysTest.java @@ -3,56 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for EnumArrays - */ +/** Model tests for EnumArrays */ public class EnumArraysTest { private final EnumArrays model = new EnumArrays(); - /** - * Model tests for EnumArrays - */ + /** Model tests for EnumArrays */ @Test public void testEnumArrays() { // TODO: test EnumArrays } - /** - * Test the property 'justSymbol' - */ + /** Test the property 'justSymbol' */ @Test public void justSymbolTest() { // TODO: test justSymbol } - /** - * Test the property 'arrayEnum' - */ + /** Test the property 'arrayEnum' */ @Test public void arrayEnumTest() { // TODO: test arrayEnum } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumClassTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumClassTest.java index 9e45543facd2..e5de54eeaccd 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumClassTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumClassTest.java @@ -3,31 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for EnumClass - */ +/** Model tests for EnumClass */ public class EnumClassTest { - /** - * Model tests for EnumClass - */ + /** Model tests for EnumClass */ @Test public void testEnumClass() { // TODO: test EnumClass } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumTestTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumTestTest.java index 1b55a5dade77..dfdb4de6237a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumTestTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EnumTestTest.java @@ -3,110 +3,73 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.OuterEnum; -import org.openapitools.client.model.OuterEnumDefaultValue; -import org.openapitools.client.model.OuterEnumInteger; -import org.openapitools.client.model.OuterEnumIntegerDefaultValue; -import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for EnumTest - */ +/** Model tests for EnumTest */ public class EnumTestTest { private final EnumTest model = new EnumTest(); - /** - * Model tests for EnumTest - */ + /** Model tests for EnumTest */ @Test public void testEnumTest() { // TODO: test EnumTest } - /** - * Test the property 'enumString' - */ + /** Test the property 'enumString' */ @Test public void enumStringTest() { // TODO: test enumString } - /** - * Test the property 'enumStringRequired' - */ + /** Test the property 'enumStringRequired' */ @Test public void enumStringRequiredTest() { // TODO: test enumStringRequired } - /** - * Test the property 'enumInteger' - */ + /** Test the property 'enumInteger' */ @Test public void enumIntegerTest() { // TODO: test enumInteger } - /** - * Test the property 'enumNumber' - */ + /** Test the property 'enumNumber' */ @Test public void enumNumberTest() { // TODO: test enumNumber } - /** - * Test the property 'outerEnum' - */ + /** Test the property 'outerEnum' */ @Test public void outerEnumTest() { // TODO: test outerEnum } - /** - * Test the property 'outerEnumInteger' - */ + /** Test the property 'outerEnumInteger' */ @Test public void outerEnumIntegerTest() { // TODO: test outerEnumInteger } - /** - * Test the property 'outerEnumDefaultValue' - */ + /** Test the property 'outerEnumDefaultValue' */ @Test public void outerEnumDefaultValueTest() { // TODO: test outerEnumDefaultValue } - /** - * Test the property 'outerEnumIntegerDefaultValue' - */ + /** Test the property 'outerEnumIntegerDefaultValue' */ @Test public void outerEnumIntegerDefaultValueTest() { // TODO: test outerEnumIntegerDefaultValue } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java index 956462f1b116..f91d76620073 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/EquilateralTriangleTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for EquilateralTriangle - */ +/** Model tests for EquilateralTriangle */ public class EquilateralTriangleTest { private final EquilateralTriangle model = new EquilateralTriangle(); - /** - * Model tests for EquilateralTriangle - */ + /** Model tests for EquilateralTriangle */ @Test public void testEquilateralTriangle() { // TODO: test EquilateralTriangle } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - /** - * Test the property 'triangleType' - */ + /** Test the property 'triangleType' */ @Test public void triangleTypeTest() { // TODO: test triangleType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java index 493d84aa1bcf..f62d4256ee37 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FileSchemaTestClassTest.java @@ -3,57 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.ModelFile; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for FileSchemaTestClass - */ +/** Model tests for FileSchemaTestClass */ public class FileSchemaTestClassTest { private final FileSchemaTestClass model = new FileSchemaTestClass(); - /** - * Model tests for FileSchemaTestClass - */ + /** Model tests for FileSchemaTestClass */ @Test public void testFileSchemaTestClass() { // TODO: test FileSchemaTestClass } - /** - * Test the property '_file' - */ + /** Test the property '_file' */ @Test public void _fileTest() { // TODO: test _file } - /** - * Test the property 'files' - */ + /** Test the property 'files' */ @Test public void filesTest() { // TODO: test files } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java index 5830df74c8c1..cb5874bf01de 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooGetDefaultResponseTest.java @@ -3,47 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Foo; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for FooGetDefaultResponse - */ +/** Model tests for FooGetDefaultResponse */ public class FooGetDefaultResponseTest { private final FooGetDefaultResponse model = new FooGetDefaultResponse(); - /** - * Model tests for FooGetDefaultResponse - */ + /** Model tests for FooGetDefaultResponse */ @Test public void testFooGetDefaultResponse() { // TODO: test FooGetDefaultResponse } - /** - * Test the property 'string' - */ + /** Test the property 'string' */ @Test public void stringTest() { // TODO: test string } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooTest.java index 195e487a7981..764e77fc601d 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FooTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Foo - */ +/** Model tests for Foo */ public class FooTest { private final Foo model = new Foo(); - /** - * Model tests for Foo - */ + /** Model tests for Foo */ @Test public void testFoo() { // TODO: test Foo } - /** - * Test the property 'bar' - */ + /** Test the property 'bar' */ @Test public void barTest() { // TODO: test bar } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FormatTestTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FormatTestTest.java index fba75da10047..0cd0fa4280c0 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FormatTestTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FormatTestTest.java @@ -3,171 +3,121 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.io.File; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.UUID; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for FormatTest - */ +/** Model tests for FormatTest */ public class FormatTestTest { private final FormatTest model = new FormatTest(); - /** - * Model tests for FormatTest - */ + /** Model tests for FormatTest */ @Test public void testFormatTest() { // TODO: test FormatTest } - /** - * Test the property 'integer' - */ + /** Test the property 'integer' */ @Test public void integerTest() { // TODO: test integer } - /** - * Test the property 'int32' - */ + /** Test the property 'int32' */ @Test public void int32Test() { // TODO: test int32 } - /** - * Test the property 'int64' - */ + /** Test the property 'int64' */ @Test public void int64Test() { // TODO: test int64 } - /** - * Test the property 'number' - */ + /** Test the property 'number' */ @Test public void numberTest() { // TODO: test number } - /** - * Test the property '_float' - */ + /** Test the property '_float' */ @Test public void _floatTest() { // TODO: test _float } - /** - * Test the property '_double' - */ + /** Test the property '_double' */ @Test public void _doubleTest() { // TODO: test _double } - /** - * Test the property 'decimal' - */ + /** Test the property 'decimal' */ @Test public void decimalTest() { // TODO: test decimal } - /** - * Test the property 'string' - */ + /** Test the property 'string' */ @Test public void stringTest() { // TODO: test string } - /** - * Test the property '_byte' - */ + /** Test the property '_byte' */ @Test public void _byteTest() { // TODO: test _byte } - /** - * Test the property 'binary' - */ + /** Test the property 'binary' */ @Test public void binaryTest() { // TODO: test binary } - /** - * Test the property 'date' - */ + /** Test the property 'date' */ @Test public void dateTest() { // TODO: test date } - /** - * Test the property 'dateTime' - */ + /** Test the property 'dateTime' */ @Test public void dateTimeTest() { // TODO: test dateTime } - /** - * Test the property 'uuid' - */ + /** Test the property 'uuid' */ @Test public void uuidTest() { // TODO: test uuid } - /** - * Test the property 'password' - */ + /** Test the property 'password' */ @Test public void passwordTest() { // TODO: test password } - /** - * Test the property 'patternWithDigits' - */ + /** Test the property 'patternWithDigits' */ @Test public void patternWithDigitsTest() { // TODO: test patternWithDigits } - /** - * Test the property 'patternWithDigitsAndDelimiter' - */ + /** Test the property 'patternWithDigitsAndDelimiter' */ @Test public void patternWithDigitsAndDelimiterTest() { // TODO: test patternWithDigitsAndDelimiter } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitReqTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitReqTest.java index f6042b16d49e..11960e1be527 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitReqTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitReqTest.java @@ -3,73 +3,49 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.openapitools.client.model.AppleReq; -import org.openapitools.client.model.BananaReq; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for FruitReq - */ +/** Model tests for FruitReq */ public class FruitReqTest { private final FruitReq model = new FruitReq(); - /** - * Model tests for FruitReq - */ + /** Model tests for FruitReq */ @Test public void testFruitReq() { // TODO: test FruitReq } - /** - * Test the property 'cultivar' - */ + /** Test the property 'cultivar' */ @Test public void cultivarTest() { // TODO: test cultivar } - /** - * Test the property 'mealy' - */ + /** Test the property 'mealy' */ @Test public void mealyTest() { // TODO: test mealy } - /** - * Test the property 'lengthCm' - */ + /** Test the property 'lengthCm' */ @Test public void lengthCmTest() { // TODO: test lengthCm } - /** - * Test the property 'sweet' - */ + /** Test the property 'sweet' */ @Test public void sweetTest() { // TODO: test sweet } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitTest.java index 9da443eea304..db7df4b284ed 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/FruitTest.java @@ -3,65 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.openapitools.client.model.Apple; -import org.openapitools.client.model.Banana; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Fruit - */ +/** Model tests for Fruit */ public class FruitTest { private final Fruit model = new Fruit(); - /** - * Model tests for Fruit - */ + /** Model tests for Fruit */ @Test public void testFruit() { // TODO: test Fruit } - /** - * Test the property 'cultivar' - */ + /** Test the property 'cultivar' */ @Test public void cultivarTest() { // TODO: test cultivar } - /** - * Test the property 'origin' - */ + /** Test the property 'origin' */ @Test public void originTest() { // TODO: test origin } - /** - * Test the property 'lengthCm' - */ + /** Test the property 'lengthCm' */ @Test public void lengthCmTest() { // TODO: test lengthCm } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitTest.java index 8e70b77b8ba0..367905a66952 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GmFruitTest.java @@ -3,65 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.openapitools.client.model.Apple; -import org.openapitools.client.model.Banana; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for GmFruit - */ +/** Model tests for GmFruit */ public class GmFruitTest { private final GmFruit model = new GmFruit(); - /** - * Model tests for GmFruit - */ + /** Model tests for GmFruit */ @Test public void testGmFruit() { // TODO: test GmFruit } - /** - * Test the property 'cultivar' - */ + /** Test the property 'cultivar' */ @Test public void cultivarTest() { // TODO: test cultivar } - /** - * Test the property 'origin' - */ + /** Test the property 'origin' */ @Test public void originTest() { // TODO: test origin } - /** - * Test the property 'lengthCm' - */ + /** Test the property 'lengthCm' */ @Test public void lengthCmTest() { // TODO: test lengthCm } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java index 495240f47600..ec9cc93ec51d 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/GrandparentAnimalTest.java @@ -3,51 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; -import org.openapitools.client.model.ParentPet; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for GrandparentAnimal - */ +/** Model tests for GrandparentAnimal */ public class GrandparentAnimalTest { private final GrandparentAnimal model = new GrandparentAnimal(); - /** - * Model tests for GrandparentAnimal - */ + /** Model tests for GrandparentAnimal */ @Test public void testGrandparentAnimal() { // TODO: test GrandparentAnimal } - /** - * Test the property 'petType' - */ + /** Test the property 'petType' */ @Test public void petTypeTest() { // TODO: test petType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java index da9073d45002..b024544d3b2a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HasOnlyReadOnlyTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for HasOnlyReadOnly - */ +/** Model tests for HasOnlyReadOnly */ public class HasOnlyReadOnlyTest { private final HasOnlyReadOnly model = new HasOnlyReadOnly(); - /** - * Model tests for HasOnlyReadOnly - */ + /** Model tests for HasOnlyReadOnly */ @Test public void testHasOnlyReadOnly() { // TODO: test HasOnlyReadOnly } - /** - * Test the property 'bar' - */ + /** Test the property 'bar' */ @Test public void barTest() { // TODO: test bar } - /** - * Test the property 'foo' - */ + /** Test the property 'foo' */ @Test public void fooTest() { // TODO: test foo } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java index 15cc82702c9d..5ecde32538e1 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/HealthCheckResultTest.java @@ -3,50 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for HealthCheckResult - */ +/** Model tests for HealthCheckResult */ public class HealthCheckResultTest { private final HealthCheckResult model = new HealthCheckResult(); - /** - * Model tests for HealthCheckResult - */ + /** Model tests for HealthCheckResult */ @Test public void testHealthCheckResult() { // TODO: test HealthCheckResult } - /** - * Test the property 'nullableMessage' - */ + /** Test the property 'nullableMessage' */ @Test public void nullableMessageTest() { // TODO: test nullableMessage } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java index d1eb131972fb..7ec07745e5de 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/IsoscelesTriangleTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for IsoscelesTriangle - */ +/** Model tests for IsoscelesTriangle */ public class IsoscelesTriangleTest { private final IsoscelesTriangle model = new IsoscelesTriangle(); - /** - * Model tests for IsoscelesTriangle - */ + /** Model tests for IsoscelesTriangle */ @Test public void testIsoscelesTriangle() { // TODO: test IsoscelesTriangle } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - /** - * Test the property 'triangleType' - */ + /** Test the property 'triangleType' */ @Test public void triangleTypeTest() { // TODO: test triangleType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MammalTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MammalTest.java index 17c804511d08..d11db26607f9 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MammalTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MammalTest.java @@ -3,76 +3,49 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Pig; -import org.openapitools.client.model.Whale; -import org.openapitools.client.model.Zebra; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Mammal - */ +/** Model tests for Mammal */ public class MammalTest { private final Mammal model = new Mammal(); - /** - * Model tests for Mammal - */ + /** Model tests for Mammal */ @Test public void testMammal() { // TODO: test Mammal } - /** - * Test the property 'hasBaleen' - */ + /** Test the property 'hasBaleen' */ @Test public void hasBaleenTest() { // TODO: test hasBaleen } - /** - * Test the property 'hasTeeth' - */ + /** Test the property 'hasTeeth' */ @Test public void hasTeethTest() { // TODO: test hasTeeth } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - /** - * Test the property 'type' - */ + /** Test the property 'type' */ @Test public void typeTest() { // TODO: test type } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MapTestTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MapTestTest.java index 22c8519472be..71ff7768fa8c 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MapTestTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MapTestTest.java @@ -3,72 +3,49 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for MapTest - */ +/** Model tests for MapTest */ public class MapTestTest { private final MapTest model = new MapTest(); - /** - * Model tests for MapTest - */ + /** Model tests for MapTest */ @Test public void testMapTest() { // TODO: test MapTest } - /** - * Test the property 'mapMapOfString' - */ + /** Test the property 'mapMapOfString' */ @Test public void mapMapOfStringTest() { // TODO: test mapMapOfString } - /** - * Test the property 'mapOfEnumString' - */ + /** Test the property 'mapOfEnumString' */ @Test public void mapOfEnumStringTest() { // TODO: test mapOfEnumString } - /** - * Test the property 'directMap' - */ + /** Test the property 'directMap' */ @Test public void directMapTest() { // TODO: test directMap } - /** - * Test the property 'indirectMap' - */ + /** Test the property 'indirectMap' */ @Test public void indirectMapTest() { // TODO: test indirectMap } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java index f29932e96bed..ac86aaf74802 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClassTest.java @@ -3,67 +3,44 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.openapitools.client.model.Animal; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for MixedPropertiesAndAdditionalPropertiesClass - */ +/** Model tests for MixedPropertiesAndAdditionalPropertiesClass */ public class MixedPropertiesAndAdditionalPropertiesClassTest { - private final MixedPropertiesAndAdditionalPropertiesClass model = new MixedPropertiesAndAdditionalPropertiesClass(); + private final MixedPropertiesAndAdditionalPropertiesClass model = + new MixedPropertiesAndAdditionalPropertiesClass(); - /** - * Model tests for MixedPropertiesAndAdditionalPropertiesClass - */ + /** Model tests for MixedPropertiesAndAdditionalPropertiesClass */ @Test public void testMixedPropertiesAndAdditionalPropertiesClass() { // TODO: test MixedPropertiesAndAdditionalPropertiesClass } - /** - * Test the property 'uuid' - */ + /** Test the property 'uuid' */ @Test public void uuidTest() { // TODO: test uuid } - /** - * Test the property 'dateTime' - */ + /** Test the property 'dateTime' */ @Test public void dateTimeTest() { // TODO: test dateTime } - /** - * Test the property 'map' - */ + /** Test the property 'map' */ @Test public void mapTest() { // TODO: test map } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/Model200ResponseTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/Model200ResponseTest.java index 0cd3f9761989..c15e62267e03 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/Model200ResponseTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/Model200ResponseTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Model200Response - */ +/** Model tests for Model200Response */ public class Model200ResponseTest { private final Model200Response model = new Model200Response(); - /** - * Model tests for Model200Response - */ + /** Model tests for Model200Response */ @Test public void testModel200Response() { // TODO: test Model200Response } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - /** - * Test the property 'propertyClass' - */ + /** Test the property 'propertyClass' */ @Test public void propertyClassTest() { // TODO: test propertyClass } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java index be8cca35e3e6..fd9cccede705 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelApiResponseTest.java @@ -3,62 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ModelApiResponse - */ +/** Model tests for ModelApiResponse */ public class ModelApiResponseTest { private final ModelApiResponse model = new ModelApiResponse(); - /** - * Model tests for ModelApiResponse - */ + /** Model tests for ModelApiResponse */ @Test public void testModelApiResponse() { // TODO: test ModelApiResponse } - /** - * Test the property 'code' - */ + /** Test the property 'code' */ @Test public void codeTest() { // TODO: test code } - /** - * Test the property 'type' - */ + /** Test the property 'type' */ @Test public void typeTest() { // TODO: test type } - /** - * Test the property 'message' - */ + /** Test the property 'message' */ @Test public void messageTest() { // TODO: test message } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java index a0247ae71beb..034a3eea1ac8 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelFileTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ModelFile - */ +/** Model tests for ModelFile */ public class ModelFileTest { private final ModelFile model = new ModelFile(); - /** - * Model tests for ModelFile - */ + /** Model tests for ModelFile */ @Test public void testModelFile() { // TODO: test ModelFile } - /** - * Test the property 'sourceURI' - */ + /** Test the property 'sourceURI' */ @Test public void sourceURITest() { // TODO: test sourceURI } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java index 0ead99db3a5a..e505479438b9 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelListTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ModelList - */ +/** Model tests for ModelList */ public class ModelListTest { private final ModelList model = new ModelList(); - /** - * Model tests for ModelList - */ + /** Model tests for ModelList */ @Test public void testModelList() { // TODO: test ModelList } - /** - * Test the property '_123list' - */ + /** Test the property '_123list' */ @Test public void _123listTest() { // TODO: test _123list } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelReturnTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelReturnTest.java index b6ca02f8d239..5e400ab6caba 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelReturnTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ModelReturnTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ModelReturn - */ +/** Model tests for ModelReturn */ public class ModelReturnTest { private final ModelReturn model = new ModelReturn(); - /** - * Model tests for ModelReturn - */ + /** Model tests for ModelReturn */ @Test public void testModelReturn() { // TODO: test ModelReturn } - /** - * Test the property '_return' - */ + /** Test the property '_return' */ @Test public void _returnTest() { // TODO: test _return } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NameTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NameTest.java index 07684c9eb408..5a71423716a8 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NameTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NameTest.java @@ -3,70 +3,49 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Name - */ +/** Model tests for Name */ public class NameTest { private final Name model = new Name(); - /** - * Model tests for Name - */ + /** Model tests for Name */ @Test public void testName() { // TODO: test Name } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - /** - * Test the property 'snakeCase' - */ + /** Test the property 'snakeCase' */ @Test public void snakeCaseTest() { // TODO: test snakeCase } - /** - * Test the property 'property' - */ + /** Test the property 'property' */ @Test public void propertyTest() { // TODO: test property } - /** - * Test the property '_123number' - */ + /** Test the property '_123number' */ @Test public void _123numberTest() { // TODO: test _123number } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableClassTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableClassTest.java index cb3a631c913c..faf34537d109 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableClassTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableClassTest.java @@ -3,145 +3,97 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import com.fasterxml.jackson.annotation.JsonIgnore; -import org.openapitools.jackson.nullable.JsonNullable; -import java.util.NoSuchElementException; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for NullableClass - */ +/** Model tests for NullableClass */ public class NullableClassTest { private final NullableClass model = new NullableClass(); - /** - * Model tests for NullableClass - */ + /** Model tests for NullableClass */ @Test public void testNullableClass() { // TODO: test NullableClass } - /** - * Test the property 'integerProp' - */ + /** Test the property 'integerProp' */ @Test public void integerPropTest() { // TODO: test integerProp } - /** - * Test the property 'numberProp' - */ + /** Test the property 'numberProp' */ @Test public void numberPropTest() { // TODO: test numberProp } - /** - * Test the property 'booleanProp' - */ + /** Test the property 'booleanProp' */ @Test public void booleanPropTest() { // TODO: test booleanProp } - /** - * Test the property 'stringProp' - */ + /** Test the property 'stringProp' */ @Test public void stringPropTest() { // TODO: test stringProp } - /** - * Test the property 'dateProp' - */ + /** Test the property 'dateProp' */ @Test public void datePropTest() { // TODO: test dateProp } - /** - * Test the property 'datetimeProp' - */ + /** Test the property 'datetimeProp' */ @Test public void datetimePropTest() { // TODO: test datetimeProp } - /** - * Test the property 'arrayNullableProp' - */ + /** Test the property 'arrayNullableProp' */ @Test public void arrayNullablePropTest() { // TODO: test arrayNullableProp } - /** - * Test the property 'arrayAndItemsNullableProp' - */ + /** Test the property 'arrayAndItemsNullableProp' */ @Test public void arrayAndItemsNullablePropTest() { // TODO: test arrayAndItemsNullableProp } - /** - * Test the property 'arrayItemsNullable' - */ + /** Test the property 'arrayItemsNullable' */ @Test public void arrayItemsNullableTest() { // TODO: test arrayItemsNullable } - /** - * Test the property 'objectNullableProp' - */ + /** Test the property 'objectNullableProp' */ @Test public void objectNullablePropTest() { // TODO: test objectNullableProp } - /** - * Test the property 'objectAndItemsNullableProp' - */ + /** Test the property 'objectAndItemsNullableProp' */ @Test public void objectAndItemsNullablePropTest() { // TODO: test objectAndItemsNullableProp } - /** - * Test the property 'objectItemsNullable' - */ + /** Test the property 'objectItemsNullable' */ @Test public void objectItemsNullableTest() { // TODO: test objectItemsNullable } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableShapeTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableShapeTest.java index bc24e8f12b2a..d827e64420e2 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableShapeTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NullableShapeTest.java @@ -3,67 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Quadrilateral; -import org.openapitools.client.model.Triangle; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for NullableShape - */ +/** Model tests for NullableShape */ public class NullableShapeTest { private final NullableShape model = new NullableShape(); - /** - * Model tests for NullableShape - */ + /** Model tests for NullableShape */ @Test public void testNullableShape() { // TODO: test NullableShape } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - /** - * Test the property 'triangleType' - */ + /** Test the property 'triangleType' */ @Test public void triangleTypeTest() { // TODO: test triangleType } - /** - * Test the property 'quadrilateralType' - */ + /** Test the property 'quadrilateralType' */ @Test public void quadrilateralTypeTest() { // TODO: test quadrilateralType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NumberOnlyTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NumberOnlyTest.java index 878095093ad5..35d88408efcf 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NumberOnlyTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/NumberOnlyTest.java @@ -3,47 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for NumberOnly - */ +/** Model tests for NumberOnly */ public class NumberOnlyTest { private final NumberOnly model = new NumberOnly(); - /** - * Model tests for NumberOnly - */ + /** Model tests for NumberOnly */ @Test public void testNumberOnly() { // TODO: test NumberOnly } - /** - * Test the property 'justNumber' - */ + /** Test the property 'justNumber' */ @Test public void justNumberTest() { // TODO: test justNumber } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java index c59d5beba3dc..7ed8d1cec95d 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ObjectWithDeprecatedFieldsTest.java @@ -3,74 +3,49 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.client.model.DeprecatedObject; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ObjectWithDeprecatedFields - */ +/** Model tests for ObjectWithDeprecatedFields */ public class ObjectWithDeprecatedFieldsTest { private final ObjectWithDeprecatedFields model = new ObjectWithDeprecatedFields(); - /** - * Model tests for ObjectWithDeprecatedFields - */ + /** Model tests for ObjectWithDeprecatedFields */ @Test public void testObjectWithDeprecatedFields() { // TODO: test ObjectWithDeprecatedFields } - /** - * Test the property 'uuid' - */ + /** Test the property 'uuid' */ @Test public void uuidTest() { // TODO: test uuid } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'deprecatedRef' - */ + /** Test the property 'deprecatedRef' */ @Test public void deprecatedRefTest() { // TODO: test deprecatedRef } - /** - * Test the property 'bars' - */ + /** Test the property 'bars' */ @Test public void barsTest() { // TODO: test bars } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OrderTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OrderTest.java index f31e10a9df15..9fac793f2c2b 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OrderTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OrderTest.java @@ -3,87 +3,61 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Order - */ +/** Model tests for Order */ public class OrderTest { private final Order model = new Order(); - /** - * Model tests for Order - */ + /** Model tests for Order */ @Test public void testOrder() { // TODO: test Order } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'petId' - */ + /** Test the property 'petId' */ @Test public void petIdTest() { // TODO: test petId } - /** - * Test the property 'quantity' - */ + /** Test the property 'quantity' */ @Test public void quantityTest() { // TODO: test quantity } - /** - * Test the property 'shipDate' - */ + /** Test the property 'shipDate' */ @Test public void shipDateTest() { // TODO: test shipDate } - /** - * Test the property 'status' - */ + /** Test the property 'status' */ @Test public void statusTest() { // TODO: test status } - /** - * Test the property 'complete' - */ + /** Test the property 'complete' */ @Test public void completeTest() { // TODO: test complete } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterCompositeTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterCompositeTest.java index 8b823572e5e1..5b38ff675e06 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterCompositeTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterCompositeTest.java @@ -3,63 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.math.BigDecimal; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for OuterComposite - */ +/** Model tests for OuterComposite */ public class OuterCompositeTest { private final OuterComposite model = new OuterComposite(); - /** - * Model tests for OuterComposite - */ + /** Model tests for OuterComposite */ @Test public void testOuterComposite() { // TODO: test OuterComposite } - /** - * Test the property 'myNumber' - */ + /** Test the property 'myNumber' */ @Test public void myNumberTest() { // TODO: test myNumber } - /** - * Test the property 'myString' - */ + /** Test the property 'myString' */ @Test public void myStringTest() { // TODO: test myString } - /** - * Test the property 'myBoolean' - */ + /** Test the property 'myBoolean' */ @Test public void myBooleanTest() { // TODO: test myBoolean } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java index 59c4eebd2f0f..1af87ff30a8b 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumDefaultValueTest.java @@ -3,31 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for OuterEnumDefaultValue - */ +/** Model tests for OuterEnumDefaultValue */ public class OuterEnumDefaultValueTest { - /** - * Model tests for OuterEnumDefaultValue - */ + /** Model tests for OuterEnumDefaultValue */ @Test public void testOuterEnumDefaultValue() { // TODO: test OuterEnumDefaultValue } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java index fa981c709357..605c3f9a78ee 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerDefaultValueTest.java @@ -3,31 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for OuterEnumIntegerDefaultValue - */ +/** Model tests for OuterEnumIntegerDefaultValue */ public class OuterEnumIntegerDefaultValueTest { - /** - * Model tests for OuterEnumIntegerDefaultValue - */ + /** Model tests for OuterEnumIntegerDefaultValue */ @Test public void testOuterEnumIntegerDefaultValue() { // TODO: test OuterEnumIntegerDefaultValue } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java index 1b98d326bb13..6a91ba05797a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumIntegerTest.java @@ -3,31 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for OuterEnumInteger - */ +/** Model tests for OuterEnumInteger */ public class OuterEnumIntegerTest { - /** - * Model tests for OuterEnumInteger - */ + /** Model tests for OuterEnumInteger */ @Test public void testOuterEnumInteger() { // TODO: test OuterEnumInteger } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumTest.java index cf0ebae0faf0..4f2073ba97df 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterEnumTest.java @@ -3,31 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for OuterEnum - */ +/** Model tests for OuterEnum */ public class OuterEnumTest { - /** - * Model tests for OuterEnum - */ + /** Model tests for OuterEnum */ @Test public void testOuterEnum() { // TODO: test OuterEnum } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java index 1a436d40cb48..413d269c4a7a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/OuterObjectWithEnumPropertyTest.java @@ -3,47 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.OuterEnumInteger; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for OuterObjectWithEnumProperty - */ +/** Model tests for OuterObjectWithEnumProperty */ public class OuterObjectWithEnumPropertyTest { private final OuterObjectWithEnumProperty model = new OuterObjectWithEnumProperty(); - /** - * Model tests for OuterObjectWithEnumProperty - */ + /** Model tests for OuterObjectWithEnumProperty */ @Test public void testOuterObjectWithEnumProperty() { // TODO: test OuterObjectWithEnumProperty } - /** - * Test the property 'value' - */ + /** Test the property 'value' */ @Test public void valueTest() { // TODO: test value } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ParentPetTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ParentPetTest.java index 6bc9c4029267..9a98a52c7d0a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ParentPetTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ParentPetTest.java @@ -3,51 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ChildCat; -import org.openapitools.client.model.GrandparentAnimal; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ParentPet - */ +/** Model tests for ParentPet */ public class ParentPetTest { private final ParentPet model = new ParentPet(); - /** - * Model tests for ParentPet - */ + /** Model tests for ParentPet */ @Test public void testParentPet() { // TODO: test ParentPet } - /** - * Test the property 'petType' - */ + /** Test the property 'petType' */ @Test public void petTypeTest() { // TODO: test petType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PetTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PetTest.java index b48657d0c9ae..38f9098f88f8 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PetTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PetTest.java @@ -3,93 +3,61 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.client.model.Category; -import org.openapitools.client.model.Tag; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Pet - */ +/** Model tests for Pet */ public class PetTest { private final Pet model = new Pet(); - /** - * Model tests for Pet - */ + /** Model tests for Pet */ @Test public void testPet() { // TODO: test Pet } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'category' - */ + /** Test the property 'category' */ @Test public void categoryTest() { // TODO: test category } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - /** - * Test the property 'photoUrls' - */ + /** Test the property 'photoUrls' */ @Test public void photoUrlsTest() { // TODO: test photoUrls } - /** - * Test the property 'tags' - */ + /** Test the property 'tags' */ @Test public void tagsTest() { // TODO: test tags } - /** - * Test the property 'status' - */ + /** Test the property 'status' */ @Test public void statusTest() { // TODO: test status } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PigTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PigTest.java index f0cfa53e1ac6..703bab44583d 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PigTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/PigTest.java @@ -3,51 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.BasquePig; -import org.openapitools.client.model.DanishPig; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Pig - */ +/** Model tests for Pig */ public class PigTest { private final Pig model = new Pig(); - /** - * Model tests for Pig - */ + /** Model tests for Pig */ @Test public void testPig() { // TODO: test Pig } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java index 60553d39ea7d..3e98298bb3e7 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralInterfaceTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for QuadrilateralInterface - */ +/** Model tests for QuadrilateralInterface */ public class QuadrilateralInterfaceTest { private final QuadrilateralInterface model = new QuadrilateralInterface(); - /** - * Model tests for QuadrilateralInterface - */ + /** Model tests for QuadrilateralInterface */ @Test public void testQuadrilateralInterface() { // TODO: test QuadrilateralInterface } - /** - * Test the property 'quadrilateralType' - */ + /** Test the property 'quadrilateralType' */ @Test public void quadrilateralTypeTest() { // TODO: test quadrilateralType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralTest.java index 9b0850dbfcc2..4bc175417509 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/QuadrilateralTest.java @@ -3,59 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.ComplexQuadrilateral; -import org.openapitools.client.model.SimpleQuadrilateral; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Quadrilateral - */ +/** Model tests for Quadrilateral */ public class QuadrilateralTest { private final Quadrilateral model = new Quadrilateral(); - /** - * Model tests for Quadrilateral - */ + /** Model tests for Quadrilateral */ @Test public void testQuadrilateral() { // TODO: test Quadrilateral } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - /** - * Test the property 'quadrilateralType' - */ + /** Test the property 'quadrilateralType' */ @Test public void quadrilateralTypeTest() { // TODO: test quadrilateralType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java index 26356ec20487..a53d0fe886bf 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ReadOnlyFirstTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ReadOnlyFirst - */ +/** Model tests for ReadOnlyFirst */ public class ReadOnlyFirstTest { private final ReadOnlyFirst model = new ReadOnlyFirst(); - /** - * Model tests for ReadOnlyFirst - */ + /** Model tests for ReadOnlyFirst */ @Test public void testReadOnlyFirst() { // TODO: test ReadOnlyFirst } - /** - * Test the property 'bar' - */ + /** Test the property 'bar' */ @Test public void barTest() { // TODO: test bar } - /** - * Test the property 'baz' - */ + /** Test the property 'baz' */ @Test public void bazTest() { // TODO: test baz } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java index d34e9885594c..2f8b27daf583 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ScaleneTriangleTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ScaleneTriangle - */ +/** Model tests for ScaleneTriangle */ public class ScaleneTriangleTest { private final ScaleneTriangle model = new ScaleneTriangle(); - /** - * Model tests for ScaleneTriangle - */ + /** Model tests for ScaleneTriangle */ @Test public void testScaleneTriangle() { // TODO: test ScaleneTriangle } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - /** - * Test the property 'triangleType' - */ + /** Test the property 'triangleType' */ @Test public void triangleTypeTest() { // TODO: test triangleType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java index 3014f1cdb7fa..5edb0f5ecc0a 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeInterfaceTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ShapeInterface - */ +/** Model tests for ShapeInterface */ public class ShapeInterfaceTest { private final ShapeInterface model = new ShapeInterface(); - /** - * Model tests for ShapeInterface - */ + /** Model tests for ShapeInterface */ @Test public void testShapeInterface() { // TODO: test ShapeInterface } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java index a3b57190151d..56b219c607c8 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeOrNullTest.java @@ -3,67 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Quadrilateral; -import org.openapitools.client.model.Triangle; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for ShapeOrNull - */ +/** Model tests for ShapeOrNull */ public class ShapeOrNullTest { private final ShapeOrNull model = new ShapeOrNull(); - /** - * Model tests for ShapeOrNull - */ + /** Model tests for ShapeOrNull */ @Test public void testShapeOrNull() { // TODO: test ShapeOrNull } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - /** - * Test the property 'triangleType' - */ + /** Test the property 'triangleType' */ @Test public void triangleTypeTest() { // TODO: test triangleType } - /** - * Test the property 'quadrilateralType' - */ + /** Test the property 'quadrilateralType' */ @Test public void quadrilateralTypeTest() { // TODO: test quadrilateralType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeTest.java index a0cb2a8d6997..9ed400640fcd 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ShapeTest.java @@ -3,67 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.Quadrilateral; -import org.openapitools.client.model.Triangle; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Shape - */ +/** Model tests for Shape */ public class ShapeTest { private final Shape model = new Shape(); - /** - * Model tests for Shape - */ + /** Model tests for Shape */ @Test public void testShape() { // TODO: test Shape } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - /** - * Test the property 'triangleType' - */ + /** Test the property 'triangleType' */ @Test public void triangleTypeTest() { // TODO: test triangleType } - /** - * Test the property 'quadrilateralType' - */ + /** Test the property 'quadrilateralType' */ @Test public void quadrilateralTypeTest() { // TODO: test quadrilateralType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java index 93e06a1063ea..4db4bd3e67e2 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SimpleQuadrilateralTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for SimpleQuadrilateral - */ +/** Model tests for SimpleQuadrilateral */ public class SimpleQuadrilateralTest { private final SimpleQuadrilateral model = new SimpleQuadrilateral(); - /** - * Model tests for SimpleQuadrilateral - */ + /** Model tests for SimpleQuadrilateral */ @Test public void testSimpleQuadrilateral() { // TODO: test SimpleQuadrilateral } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - /** - * Test the property 'quadrilateralType' - */ + /** Test the property 'quadrilateralType' */ @Test public void quadrilateralTypeTest() { // TODO: test quadrilateralType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java index 155e2a89b0b0..bfd0ae407c74 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SingleRefTypeTest.java @@ -3,31 +3,23 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for SingleRefType - */ +/** Model tests for SingleRefType */ public class SingleRefTypeTest { - /** - * Model tests for SingleRefType - */ + /** Model tests for SingleRefType */ @Test public void testSingleRefType() { // TODO: test SingleRefType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java index 4e59989875ac..93e731203707 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/SpecialModelNameTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for SpecialModelName - */ +/** Model tests for SpecialModelName */ public class SpecialModelNameTest { private final SpecialModelName model = new SpecialModelName(); - /** - * Model tests for SpecialModelName - */ + /** Model tests for SpecialModelName */ @Test public void testSpecialModelName() { // TODO: test SpecialModelName } - /** - * Test the property '$specialPropertyName' - */ + /** Test the property '$specialPropertyName' */ @Test public void $specialPropertyNameTest() { // TODO: test $specialPropertyName } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TagTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TagTest.java index 5aeb2f3f948e..f913b6b77787 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TagTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TagTest.java @@ -3,54 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Tag - */ +/** Model tests for Tag */ public class TagTest { private final Tag model = new Tag(); - /** - * Model tests for Tag - */ + /** Model tests for Tag */ @Test public void testTag() { // TODO: test Tag } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'name' - */ + /** Test the property 'name' */ @Test public void nameTest() { // TODO: test name } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java index a0abfe85411e..5247f4c25a97 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleInterfaceTest.java @@ -3,46 +3,31 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for TriangleInterface - */ +/** Model tests for TriangleInterface */ public class TriangleInterfaceTest { private final TriangleInterface model = new TriangleInterface(); - /** - * Model tests for TriangleInterface - */ + /** Model tests for TriangleInterface */ @Test public void testTriangleInterface() { // TODO: test TriangleInterface } - /** - * Test the property 'triangleType' - */ + /** Test the property 'triangleType' */ @Test public void triangleTypeTest() { // TODO: test triangleType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleTest.java index 0d606efde23e..c37b35eb6b0e 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/TriangleTest.java @@ -3,60 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.client.model.EquilateralTriangle; -import org.openapitools.client.model.IsoscelesTriangle; -import org.openapitools.client.model.ScaleneTriangle; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Triangle - */ +/** Model tests for Triangle */ public class TriangleTest { private final Triangle model = new Triangle(); - /** - * Model tests for Triangle - */ + /** Model tests for Triangle */ @Test public void testTriangle() { // TODO: test Triangle } - /** - * Test the property 'shapeType' - */ + /** Test the property 'shapeType' */ @Test public void shapeTypeTest() { // TODO: test shapeType } - /** - * Test the property 'triangleType' - */ + /** Test the property 'triangleType' */ @Test public void triangleTypeTest() { // TODO: test triangleType } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/UserTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/UserTest.java index e0153a4cf1b9..fd35e31ca523 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/UserTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/UserTest.java @@ -3,102 +3,73 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for User - */ +/** Model tests for User */ public class UserTest { private final User model = new User(); - /** - * Model tests for User - */ + /** Model tests for User */ @Test public void testUser() { // TODO: test User } - /** - * Test the property 'id' - */ + /** Test the property 'id' */ @Test public void idTest() { // TODO: test id } - /** - * Test the property 'username' - */ + /** Test the property 'username' */ @Test public void usernameTest() { // TODO: test username } - /** - * Test the property 'firstName' - */ + /** Test the property 'firstName' */ @Test public void firstNameTest() { // TODO: test firstName } - /** - * Test the property 'lastName' - */ + /** Test the property 'lastName' */ @Test public void lastNameTest() { // TODO: test lastName } - /** - * Test the property 'email' - */ + /** Test the property 'email' */ @Test public void emailTest() { // TODO: test email } - /** - * Test the property 'password' - */ + /** Test the property 'password' */ @Test public void passwordTest() { // TODO: test password } - /** - * Test the property 'phone' - */ + /** Test the property 'phone' */ @Test public void phoneTest() { // TODO: test phone } - /** - * Test the property 'userStatus' - */ + /** Test the property 'userStatus' */ @Test public void userStatusTest() { // TODO: test userStatus } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/WhaleTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/WhaleTest.java index 25911285280c..0ef7954f3c4b 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/WhaleTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/WhaleTest.java @@ -3,62 +3,43 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Whale - */ +/** Model tests for Whale */ public class WhaleTest { private final Whale model = new Whale(); - /** - * Model tests for Whale - */ + /** Model tests for Whale */ @Test public void testWhale() { // TODO: test Whale } - /** - * Test the property 'hasBaleen' - */ + /** Test the property 'hasBaleen' */ @Test public void hasBaleenTest() { // TODO: test hasBaleen } - /** - * Test the property 'hasTeeth' - */ + /** Test the property 'hasTeeth' */ @Test public void hasTeethTest() { // TODO: test hasTeeth } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - } diff --git a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ZebraTest.java b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ZebraTest.java index 0e460afcec25..0cce86795dbe 100644 --- a/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ZebraTest.java +++ b/samples/client/petstore/java/native/src/test/java/org/openapitools/client/model/ZebraTest.java @@ -3,56 +3,37 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * The version of the OpenAPI document: 1.0.0 - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ - package org.openapitools.client.model; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; -import org.junit.Assert; -import org.junit.Ignore; + import org.junit.Test; - -/** - * Model tests for Zebra - */ +/** Model tests for Zebra */ public class ZebraTest { private final Zebra model = new Zebra(); - /** - * Model tests for Zebra - */ + /** Model tests for Zebra */ @Test public void testZebra() { // TODO: test Zebra } - /** - * Test the property 'type' - */ + /** Test the property 'type' */ @Test public void typeTest() { // TODO: test type } - /** - * Test the property 'className' - */ + /** Test the property 'className' */ @Test public void classNameTest() { // TODO: test className } - }