diff --git a/bin/configs/java-native.yaml b/bin/configs/java-native.yaml
index cac729a68aa..ba1795d9de3 100644
--- a/bin/configs/java-native.yaml
+++ b/bin/configs/java-native.yaml
@@ -6,3 +6,4 @@ templateDir: modules/openapi-generator/src/main/resources/Java
additionalProperties:
artifactId: petstore-native
hideGenerationTimestamp: "true"
+ generateBuilders: true
diff --git a/bin/configs/java-resttemplate.yaml b/bin/configs/java-resttemplate.yaml
index cedcc574dbb..9d8bec57461 100644
--- a/bin/configs/java-resttemplate.yaml
+++ b/bin/configs/java-resttemplate.yaml
@@ -9,3 +9,4 @@ additionalProperties:
java8: true
containerDefaultToNull: true
generateConstructorWithAllArgs: true
+ generateBuilders: true
diff --git a/bin/configs/spring-boot-3.yaml b/bin/configs/spring-boot-3.yaml
index 6096b1a50e1..472f660ac7a 100644
--- a/bin/configs/spring-boot-3.yaml
+++ b/bin/configs/spring-boot-3.yaml
@@ -12,3 +12,4 @@ additionalProperties:
withXml: true
hideGenerationTimestamp: "true"
generateConstructorWithAllArgs: true
+ generateBuilders: true
diff --git a/bin/configs/spring-boot-lombok-data.yaml b/bin/configs/spring-boot-lombok-data.yaml
index 51939d31d54..57f54d71d3d 100644
--- a/bin/configs/spring-boot-lombok-data.yaml
+++ b/bin/configs/spring-boot-lombok-data.yaml
@@ -8,3 +8,4 @@ additionalProperties:
hideGenerationTimestamp: "true"
additionalModelTypeAnnotations: "@lombok.Data;@lombok.Builder;@lombok.NoArgsConstructor;@lombok.AllArgsConstructor"
generateConstructorWithAllArgs: true
+ generateBuilders: true
diff --git a/bin/configs/spring-boot-oneof.yaml b/bin/configs/spring-boot-oneof.yaml
index a986fc8fabe..f4a7ca7a99c 100644
--- a/bin/configs/spring-boot-oneof.yaml
+++ b/bin/configs/spring-boot-oneof.yaml
@@ -8,3 +8,4 @@ additionalProperties:
artifactId: springboot-oneof
snapshotVersion: "true"
hideGenerationTimestamp: "true"
+ generateBuilders: true
diff --git a/bin/configs/spring-boot-useoptional.yaml b/bin/configs/spring-boot-useoptional.yaml
index 2b3dbdc1a86..82530260d67 100644
--- a/bin/configs/spring-boot-useoptional.yaml
+++ b/bin/configs/spring-boot-useoptional.yaml
@@ -8,3 +8,4 @@ additionalProperties:
useOptional: true
artifactId: spring-boot-useoptional
hideGenerationTimestamp: "true"
+ generateBuilders: true
diff --git a/docs/generators/groovy.md b/docs/generators/groovy.md
index f4d30d839d0..12bc9a24ae9 100644
--- a/docs/generators/groovy.md
+++ b/docs/generators/groovy.md
@@ -39,6 +39,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|
**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/java-camel.md b/docs/generators/java-camel.md
index e1b5c883da2..1c7efa14ec8 100644
--- a/docs/generators/java-camel.md
+++ b/docs/generators/java-camel.md
@@ -55,6 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|documentationProvider|Select the OpenAPI documentation provider.|**none** Do not publish an OpenAPI specification. **source** Publish the original input OpenAPI specification. **springfox** Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead. **springdoc** Generate an OpenAPI 3 specification using SpringDoc. |springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
diff --git a/docs/generators/java-helidon-client.md b/docs/generators/java-helidon-client.md
index 2395a241582..7f60cf91dbd 100644
--- a/docs/generators/java-helidon-client.md
+++ b/docs/generators/java-helidon-client.md
@@ -38,6 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
|fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| ||
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|helidonVersion|Helidon complete version identifier or major version number. The specified exact Helidon release or, if specified as a major version the latest release of that major version, is used in the generated code.| |Highest released version.|
diff --git a/docs/generators/java-helidon-server.md b/docs/generators/java-helidon-server.md
index 57105ba91cd..2035bb8c6fb 100644
--- a/docs/generators/java-helidon-server.md
+++ b/docs/generators/java-helidon-server.md
@@ -37,6 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
|fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| ||
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|gradleProject|Whether to generate gradle project instead of maven.| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
diff --git a/docs/generators/java-inflector.md b/docs/generators/java-inflector.md
index ef93ebfa947..c97cc488b15 100644
--- a/docs/generators/java-inflector.md
+++ b/docs/generators/java-inflector.md
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/java-micronaut-client.md b/docs/generators/java-micronaut-client.md
index 5a02be5ce71..f8c968280ec 100644
--- a/docs/generators/java-micronaut-client.md
+++ b/docs/generators/java-micronaut-client.md
@@ -50,6 +50,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateOperationOnlyForFirstTag|When false, the operation method will be duplicated in each of the tags if multiple tags are assigned to this operation. If true, each operation will be generated only once in the first assigned tag.| |false|
|generateSwaggerAnnotations|Specify if you want to generate swagger annotations and which version|**swagger2** Use io.swagger.core.v3:swagger-annotations for annotating operations and schemas **true** Equivalent to "swagger2" **false** Do not generate swagger annotations **swagger1** Use io.swagger:swagger-annotations for annotating operations and schemas |false|
diff --git a/docs/generators/java-micronaut-server.md b/docs/generators/java-micronaut-server.md
index dbf99b6d81d..9cb2ad4dbbc 100644
--- a/docs/generators/java-micronaut-server.md
+++ b/docs/generators/java-micronaut-server.md
@@ -45,6 +45,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateControllerAsAbstract|Generate an abstract class for controller to be extended. (apiPackage is then used for the abstract class, and controllerPackage is used for implementation that extends it.)| |false|
|generateControllerFromExamples|Generate the implementation of controller and tests from parameter and return examples that will verify that the api works as desired (for testing)| |false|
diff --git a/docs/generators/java-microprofile.md b/docs/generators/java-microprofile.md
index 255ecb891ef..dada45f96d5 100644
--- a/docs/generators/java-microprofile.md
+++ b/docs/generators/java-microprofile.md
@@ -49,6 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
|errorObjectType|Error Object type. (This option is for okhttp-gson only)| |null|
+|generateBuilders|Whether to generate builders for models| |false|
|generateClientAsBean|For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|gradleProperties|Append additional Gradle properties to the gradle.properties file| |null|
diff --git a/docs/generators/java-msf4j.md b/docs/generators/java-msf4j.md
index ee7ede5d082..52455c5fea1 100644
--- a/docs/generators/java-msf4j.md
+++ b/docs/generators/java-msf4j.md
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/java-pkmst.md b/docs/generators/java-pkmst.md
index 074ba58ea94..6ecb576ac90 100644
--- a/docs/generators/java-pkmst.md
+++ b/docs/generators/java-pkmst.md
@@ -43,6 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
|eurekaUri|Eureka URI| |null|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |com.prokarma|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/java-play-framework.md b/docs/generators/java-play-framework.md
index 91206d35863..bfdef88970f 100644
--- a/docs/generators/java-play-framework.md
+++ b/docs/generators/java-play-framework.md
@@ -44,6 +44,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true|
diff --git a/docs/generators/java-undertow-server.md b/docs/generators/java-undertow-server.md
index 7bbf2cc6f18..202f013209d 100644
--- a/docs/generators/java-undertow-server.md
+++ b/docs/generators/java-undertow-server.md
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/java-vertx-web.md b/docs/generators/java-vertx-web.md
index 65af14ea9dc..3144df23e1a 100644
--- a/docs/generators/java-vertx-web.md
+++ b/docs/generators/java-vertx-web.md
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/java-vertx.md b/docs/generators/java-vertx.md
index 8456d54beaa..4592996516e 100644
--- a/docs/generators/java-vertx.md
+++ b/docs/generators/java-vertx.md
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/java-wiremock.md b/docs/generators/java-wiremock.md
index 91d46a8c3cb..1ae178f9927 100644
--- a/docs/generators/java-wiremock.md
+++ b/docs/generators/java-wiremock.md
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/java.md b/docs/generators/java.md
index acf44d3854e..028280b4562 100644
--- a/docs/generators/java.md
+++ b/docs/generators/java.md
@@ -49,6 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
|errorObjectType|Error Object type. (This option is for okhttp-gson only)| |null|
+|generateBuilders|Whether to generate builders for models| |false|
|generateClientAsBean|For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|gradleProperties|Append additional Gradle properties to the gradle.properties file| |null|
diff --git a/docs/generators/jaxrs-cxf-cdi.md b/docs/generators/jaxrs-cxf-cdi.md
index f62da7ca428..f990de40ddb 100644
--- a/docs/generators/jaxrs-cxf-cdi.md
+++ b/docs/generators/jaxrs-cxf-cdi.md
@@ -41,7 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
-|generateBuilders|Whether to generate builders for models.| |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatePom|Whether to generate pom.xml if the file does not already exist.| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
diff --git a/docs/generators/jaxrs-cxf-client.md b/docs/generators/jaxrs-cxf-client.md
index e71f240e876..68d153daf20 100644
--- a/docs/generators/jaxrs-cxf-client.md
+++ b/docs/generators/jaxrs-cxf-client.md
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/jaxrs-cxf-extended.md b/docs/generators/jaxrs-cxf-extended.md
index 401db4e918e..f72c477c3b7 100644
--- a/docs/generators/jaxrs-cxf-extended.md
+++ b/docs/generators/jaxrs-cxf-extended.md
@@ -42,6 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false|
|generateNonSpringApplication|Generate non-Spring application| |false|
diff --git a/docs/generators/jaxrs-cxf.md b/docs/generators/jaxrs-cxf.md
index d0a73f24217..89caf27c7ad 100644
--- a/docs/generators/jaxrs-cxf.md
+++ b/docs/generators/jaxrs-cxf.md
@@ -42,6 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false|
|generateNonSpringApplication|Generate non-Spring application| |false|
diff --git a/docs/generators/jaxrs-jersey.md b/docs/generators/jaxrs-jersey.md
index 81af0a811e1..d3b30f001e4 100644
--- a/docs/generators/jaxrs-jersey.md
+++ b/docs/generators/jaxrs-jersey.md
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
diff --git a/docs/generators/jaxrs-resteasy-eap.md b/docs/generators/jaxrs-resteasy-eap.md
index 50bd75bc929..8645361f843 100644
--- a/docs/generators/jaxrs-resteasy-eap.md
+++ b/docs/generators/jaxrs-resteasy-eap.md
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
diff --git a/docs/generators/jaxrs-resteasy.md b/docs/generators/jaxrs-resteasy.md
index 7204ab79be7..af6e8c0aa2d 100644
--- a/docs/generators/jaxrs-resteasy.md
+++ b/docs/generators/jaxrs-resteasy.md
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
diff --git a/docs/generators/jaxrs-spec.md b/docs/generators/jaxrs-spec.md
index 1d45f8a1a19..f1ff6d31bb6 100644
--- a/docs/generators/jaxrs-spec.md
+++ b/docs/generators/jaxrs-spec.md
@@ -41,7 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
-|generateBuilders|Whether to generate builders for models.| |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatePom|Whether to generate pom.xml if the file does not already exist.| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
diff --git a/docs/generators/spring.md b/docs/generators/spring.md
index 9bf9b50cfda..6ae3b647ac6 100644
--- a/docs/generators/spring.md
+++ b/docs/generators/spring.md
@@ -48,6 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|documentationProvider|Select the OpenAPI documentation provider.|**none** Do not publish an OpenAPI specification. **source** Publish the original input OpenAPI specification. **springfox** Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead. **springdoc** Generate an OpenAPI 3 specification using SpringDoc. |springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|**false** No changes to the enum's are made, this is the default option. **true** With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case. |false|
+|generateBuilders|Whether to generate builders for models| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
index d860a344b2a..f582e0d2256 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java
@@ -95,7 +95,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
public static final String LOMBOK = "lombok";
public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi";
public static final String GENERATE_CONSTRUCTOR_WITH_ALL_ARGS = "generateConstructorWithAllArgs";
-
+ public static final String GENERATE_BUILDERS = "generateBuilders";
protected String dateLibrary = "java8";
protected boolean supportAsync = false;
protected boolean withXml = false;
@@ -145,6 +145,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
protected boolean useJakartaEe = false;
protected boolean containerDefaultToNull = false;
protected boolean generateConstructorWithAllArgs = false;
+ protected boolean generateBuilder = false;
private Map schemaKeyToModelNameCache = new HashMap<>();
public AbstractJavaCodegen() {
@@ -285,6 +286,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
cliOptions.add(CliOption.newBoolean(USE_JAKARTA_EE, "whether to use Jakarta EE namespace instead of javax"));
cliOptions.add(CliOption.newBoolean(CONTAINER_DEFAULT_TO_NULL, "Set containers (array, set, map) default to null"));
cliOptions.add(CliOption.newBoolean(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, "whether to generate a constructor for all arguments").defaultValue(Boolean.FALSE.toString()));
+ cliOptions.add(CliOption.newBoolean(GENERATE_BUILDERS, "Whether to generate builders for models").defaultValue(Boolean.FALSE.toString()));
cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC));
cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_ID_DESC));
@@ -359,10 +361,14 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
}
if (additionalProperties.containsKey(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS)) {
- this.setgenerateConstructorWithAllArgs(convertPropertyToBoolean(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS));
+ this.setGenerateConstructorWithAllArgs(convertPropertyToBoolean(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS));
}
writePropertyBack(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, generateConstructorWithAllArgs);
+ if (additionalProperties.containsKey(GENERATE_BUILDERS)) {
+ this.setGenerateBuilder(convertPropertyToBoolean(GENERATE_BUILDERS));
+ }
+ writePropertyBack(GENERATE_BUILDERS, generateBuilder);
if (StringUtils.isEmpty(System.getenv("JAVA_POST_PROCESS_FILE"))) {
LOGGER.info("Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE=\"/usr/local/bin/clang-format -i\"' (Linux/Mac)");
LOGGER.info("NOTE: To enable file post-processing, 'enablePostProcessFile' must be set to `true` (--enable-post-process-file for CLI).");
@@ -686,14 +692,22 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
});
}
- public void setgenerateConstructorWithAllArgs(boolean aValue) {
+ public void setGenerateConstructorWithAllArgs(boolean aValue) {
this.generateConstructorWithAllArgs = aValue;
}
- public boolean isgenerateConstructorWithAllArgs() {
+ public boolean isGenerateConstructorWithAllArgs() {
return generateConstructorWithAllArgs;
}
+ public void setGenerateBuilder(boolean aValue) {
+ this.generateBuilder = aValue;
+ }
+
+ public boolean isGenerateBuilder() {
+ return generateBuilder;
+ }
+
/**
* Analyse and post process all Models.
* @param objs the models map.
@@ -779,7 +793,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
}
}
- if (isgenerateConstructorWithAllArgs()) {
+ if (isGenerateConstructorWithAllArgs()) {
// conditionally force the generation of all args constructor.
for (CodegenModel cm : allModels.values()) {
if (isConstructorWithAllArgsAllowed(cm)) {
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java
index 373ac795d86..ef2c3097a9f 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaJAXRSSpecServerCodegen.java
@@ -40,7 +40,6 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
public static final String USE_MICROPROFILE_OPENAPI_ANNOTATIONS = "useMicroProfileOpenAPIAnnotations";
public static final String USE_MUTINY = "useMutiny";
public static final String OPEN_API_SPEC_FILE_LOCATION = "openApiSpecFileLocation";
- public static final String GENERATE_BUILDERS = "generateBuilders";
public static final String QUARKUS_LIBRARY = "quarkus";
public static final String THORNTAIL_LIBRARY = "thorntail";
@@ -51,7 +50,6 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
private boolean interfaceOnly = false;
private boolean returnResponse = false;
private boolean generatePom = true;
- private boolean generateBuilders = false;
private boolean useSwaggerAnnotations = true;
private boolean useMicroProfileOpenAPIAnnotations = false;
private boolean useMutiny = false;
@@ -115,7 +113,6 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
cliOptions.add(library);
cliOptions.add(CliOption.newBoolean(GENERATE_POM, "Whether to generate pom.xml if the file does not already exist.").defaultValue(String.valueOf(generatePom)));
- cliOptions.add(CliOption.newBoolean(GENERATE_BUILDERS, "Whether to generate builders for models.").defaultValue(String.valueOf(generateBuilders)));
cliOptions.add(CliOption.newBoolean(INTERFACE_ONLY, "Whether to generate only API interface stubs without the server files.").defaultValue(String.valueOf(interfaceOnly)));
cliOptions.add(CliOption.newBoolean(RETURN_RESPONSE, "Whether generate API interface should return javax.ws.rs.core.Response instead of a deserialized entity. Only useful if interfaceOnly is true.").defaultValue(String.valueOf(returnResponse)));
cliOptions.add(CliOption.newBoolean(USE_SWAGGER_ANNOTATIONS, "Whether to generate Swagger annotations.", useSwaggerAnnotations));
@@ -177,11 +174,6 @@ public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen {
writePropertyBack(USE_MUTINY, useMutiny);
}
- if (additionalProperties.containsKey(GENERATE_BUILDERS)) {
- generateBuilders = Boolean.parseBoolean(additionalProperties.get(GENERATE_BUILDERS).toString());
- }
- additionalProperties.put(GENERATE_BUILDERS, generateBuilders);
-
if (additionalProperties.containsKey(OPEN_API_SPEC_FILE_LOCATION)) {
openApiSpecFileLocation = additionalProperties.get(OPEN_API_SPEC_FILE_LOCATION).toString();
} else if(QUARKUS_LIBRARY.equals(library) || THORNTAIL_LIBRARY.equals(library) || HELIDON_LIBRARY.equals(library) || KUMULUZEE_LIBRARY.equals(library)) {
diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
index fb225cf6e58..bb241bf0501 100644
--- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
+++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java
@@ -1170,7 +1170,7 @@ public class SpringCodegen extends AbstractJavaCodegen
@Override
protected boolean isConstructorWithAllArgsAllowed(CodegenModel codegenModel) {
- if (lombokAnnotations != null && lombokAnnotations.containsKey("allArgsConstructor")) {
+ if (lombokAnnotations != null && lombokAnnotations.containsKey("AllArgsConstructor")) {
// constructor generated by lombok
return false;
}
@@ -1306,6 +1306,21 @@ public class SpringCodegen extends AbstractJavaCodegen
return provideArgsClassSet;
}
+ @Override
+ public Map postProcessAllModels(Map objs) {
+ objs = super.postProcessAllModels(objs);
+
+ Map allModels = getAllModels(objs);
+ // conditionally force the generation of no args constructor
+ for (CodegenModel cm : allModels.values()) {
+ boolean hasLombokNoArgsConstructor = lombokAnnotations != null && lombokAnnotations.containsKey("NoArgsConstructor");
+ if (!hasLombokNoArgsConstructor
+ && (cm.hasRequired || cm.vendorExtensions.containsKey("x-java-all-args-constructor"))) {
+ cm.vendorExtensions.put("x-java-no-args-constructor", true);
+ }
+ }
+ return objs;
+ }
@Override
public ModelsMap postProcessModelsEnum(ModelsMap objs) {
diff --git a/modules/openapi-generator/src/main/resources/Java/javaBuilder.mustache b/modules/openapi-generator/src/main/resources/Java/javaBuilder.mustache
new file mode 100644
index 00000000000..c02730081ca
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/Java/javaBuilder.mustache
@@ -0,0 +1,82 @@
+public static class Builder {{#parentModel}}extends {{classname}}.Builder {{/parentModel}}{
+
+ private {{classname}} instance;
+
+ public Builder() {
+ this(new {{classname}}());
+ }
+
+ protected Builder({{classname}} instance) {
+ {{#parentModel}}
+ super(instance);
+ {{/parentModel}}
+ this.instance = instance;
+ }
+
+ {{#vars}}
+ public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) {
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ this.instance.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{^vendorExtensions.x-is-jackson-optional-nullable}}
+ this.instance.{{name}} = {{name}};
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ return this;
+ }
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
+ this.instance.{{name}} = {{name}};
+ return this;
+ }
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+ {{/vars}}
+
+{{#parentVars}}
+ public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) { // inherited: {{isInherited}}
+ super.{{name}}({{name}});
+ return this;
+ }
+ {{#vendorExtensions.x-is-jackson-optional-nullable}}
+ public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
+ this.instance.{{name}} = {{name}};
+ return this;
+ }
+ {{/vendorExtensions.x-is-jackson-optional-nullable}}
+
+ {{/parentVars}}
+
+ /**
+ * returns a built {{classname}} instance.
+ *
+ * The builder is not reusable.
+ */
+ public {{classname}} build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused{{#parentModel}}
+ super.build();{{/parentModel}}
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static {{classname}}.Builder builder() {
+ return new {{classname}}.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public {{classname}}.Builder toBuilder() {
+ return new {{classname}}.Builder(){{#allVars}}
+ .{{name}}({{getter}}()){{/allVars}};
+ }
diff --git a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache
index c440057eb76..15bd2f96d24 100644
--- a/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache
@@ -593,4 +593,8 @@ static {
JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings);
}
{{/discriminator}}
+{{#generateBuilders}}
+
+ {{>javaBuilder}}
+{{/generateBuilders}}
}
diff --git a/modules/openapi-generator/src/main/resources/Java/pojo.mustache b/modules/openapi-generator/src/main/resources/Java/pojo.mustache
index 8cee0ac5a56..d4c6ec8d154 100644
--- a/modules/openapi-generator/src/main/resources/Java/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/Java/pojo.mustache
@@ -629,5 +629,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
}
};
{{/parcelableModel}}
+{{#generateBuilders}}
+
+ {{>javaBuilder}}
+{{/generateBuilders}}
}
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache
new file mode 100644
index 00000000000..9f369e65cfc
--- /dev/null
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache
@@ -0,0 +1,96 @@
+
+ public static class Builder {{#parentModel}}extends {{classname}}.Builder {{/parentModel}}{
+
+ private {{classname}} instance;
+
+ public Builder() {
+ this(new {{classname}}());
+ }
+
+ protected Builder({{classname}} instance) {
+ {{#parentModel}}
+ super(instance); // the parent builder shares the same instance
+ {{/parentModel}}
+ this.instance = instance;
+ }
+
+ protected Builder copyOf({{classname}} value) { {{#parentModel}}
+ super.copyOf(instance);{{/parentModel}}{{#vars}}
+ this.instance.{{setter}}(value.{{name}});{{/vars}}
+ return this;
+ }
+
+{{#vars}}
+ {{#deprecated}}
+ @Deprecated
+ {{/deprecated}}
+ public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) {
+ this.instance.{{name}}({{name}});
+ return this;
+ }
+ {{#deprecated}}
+ @Deprecated
+ {{/deprecated}}
+ {{#openApiNullable}}{{#isNullable}}
+ public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
+ this.instance.{{name}} = {{name}};
+ return this;
+ }
+ {{/isNullable}}{{/openApiNullable}}
+{{/vars}}
+{{#parentVars}}
+ @Override
+ public {{classname}}.Builder {{name}}({{{datatypeWithEnum}}} {{name}}) {
+ this.instance.{{name}}({{name}});
+ return this;
+ }
+ {{#openApiNullable}}{{#isNullable}}
+ public {{classname}}.Builder {{name}}(JsonNullable<{{{datatypeWithEnum}}}> {{name}}) {
+ this.instance.{{setter}}({{name}});
+ return this;
+ }
+ {{/isNullable}}{{/openApiNullable}}
+{{/parentVars}}
+{{#additionalPropertiesType}}
+ public {{classname}}.Builder additionalProperties(Map additionalProperties) {
+ this.instance.additionalProperties = additionalProperties;
+ return this;
+ }
+
+{{/additionalPropertiesType}}
+ /**
+ * returns a built {{classname}} instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public {{classname}} build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused{{#parentModel}}
+ super.build();{{/parentModel}}
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static {{classname}}.Builder builder() {
+ return new {{classname}}.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public {{classname}}.Builder toBuilder() {
+ {{! using the instance setter ensure compatibility with Optional and JsonNullable}}
+ {{classname}}.Builder builder = new {{classname}}.Builder();
+ return builder.copyOf(this);
+ }
diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
index db03e875533..44be9a40898 100644
--- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
+++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache
@@ -93,17 +93,17 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{/openApiNullable}}
{{/isContainer}}
{{/vars}}
+ {{#vendorExtensions.x-java-no-args-constructor}}
+
+ public {{classname}}() {
+ super();
+ }
+ {{/vendorExtensions.x-java-no-args-constructor}}
{{^lombok.Data}}
{{^lombok.RequiredArgsConstructor}}
{{#generatedConstructorWithRequiredArgs}}
{{#hasRequired}}
- {{^lombok.NoArgsConstructor}}
- public {{classname}}() {
- super();
- }
-
- {{/lombok.NoArgsConstructor}}
/**
* Constructor with only required parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}}
*/
@@ -351,5 +351,8 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
return o.toString().replace("\n", "\n ");
}
{{/lombok.ToString}}
+ {{#generateBuilders}}
+ {{>javaBuilder}}
+ {{/generateBuilders}}
{{/lombok.Data}}
}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
index 7266d71341c..daaea9a2637 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/DefaultCodegenTest.java
@@ -4918,32 +4918,21 @@ public class DefaultCodegenTest {
@Test
public void testAllVars_issue_18340() {
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/issue_18340.yaml");
- new OpenAPINormalizer(openAPI, Map.of("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", " true"))
+ new OpenAPINormalizer(openAPI, Map.of("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "true"))
.normalize();
Schema catModel = ModelUtils.getSchema(openAPI, "Cat");
Schema cat2Model = ModelUtils.getSchema(openAPI, "Cat2");
DefaultCodegen defaultCodegen = new DefaultCodegen();
defaultCodegen.setOpenAPI(openAPI);
CodegenModel defaultCat = defaultCodegen.fromModel("Cat", catModel);
- assertThat(getNames(defaultCat.allVars)).isEqualTo(List.of("name", "petType"));
+ assertThat(getNames(defaultCat.allVars)).isEqualTo(List.of("petType", "name"));
- // same model gives an invalid var when using SpringCodegen. name is missing
+ // the normalizer makes it work even for generators supporting inheritance
SpringCodegen springCodegen = new SpringCodegen();
springCodegen.setOpenAPI(openAPI);
CodegenModel springCat = springCodegen.fromModel("Cat", catModel);
- assertThat(getNames(springCat.allVars)).isEqualTo(List.of("petType")); // should be name,petType
+ assertThat(getNames(springCat.allVars)).isEqualTo(List.of("petType", "name"));
CodegenModel springCat2 = springCodegen.fromModel("Cat2", cat2Model);
assertThat(getNames(springCat2.allVars)).isEqualTo(List.of("petType", "name"));
-
- // Prove that supportsInheritance is the culprit
- SpringCodegen springCodegenNoSupportInheritance = new SpringCodegen() {
- {
- this.supportsInheritance = false;
- }
- };
- springCodegenNoSupportInheritance.setOpenAPI(openAPI);
- CodegenModel springCatNoSupportInheritance = springCodegenNoSupportInheritance.fromModel("Cat", catModel);
- assertThat(getNames(springCatNoSupportInheritance.allVars)).isEqualTo(List.of("name", "petType"));
}
-
}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java
index a4b1a0d0b78..dcb6aa56ea1 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/JavaClientCodegenTest.java
@@ -3456,4 +3456,22 @@ public class JavaClientCodegenTest {
);
}
+ @Test
+ void testBuilderJavaClient() throws IOException {
+ Map files = generateFromContract("src/test/resources/3_0/java/builder.yaml", JavaClientCodegen.RESTTEMPLATE,
+ Map.of(AbstractJavaCodegen.GENERATE_BUILDERS, Boolean.TRUE));
+ JavaFileAssert.assertThat(files.get("Pet.java"))
+ .fileContains("protected String petReadonlyProperty",
+ "toBuilder()",
+ "builder()",
+ "public static class Builder {");
+ JavaFileAssert.assertThat(files.get("Snake.java"))
+ .fileContains("toBuilder()",
+ "builder()",
+ "public static class Builder extends Reptile.Builder {",
+ ".petType(getPetType())",
+ ".name(getName())",
+ "hasLegs(getHasLegs())");
+ }
+
}
diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java
index 29ac5199d74..4d5d68090cb 100644
--- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java
+++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/java/spring/SpringCodegenTest.java
@@ -21,6 +21,7 @@ import static java.util.stream.Collectors.groupingBy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.openapitools.codegen.TestUtils.assertFileContains;
import static org.openapitools.codegen.TestUtils.assertFileNotContains;
+import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_BUILDERS;
import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS;
import static org.openapitools.codegen.languages.SpringCodegen.ASYNC;
import static org.openapitools.codegen.languages.SpringCodegen.DELEGATE_PATTERN;
@@ -4702,6 +4703,52 @@ public class SpringCodegenTest {
;
}
+ @Test
+ void testBuilderJavaSpring_noOptional() throws IOException {
+ Map files = generateFromContract("src/test/resources/3_0/java/builder.yaml", SPRING_BOOT,
+ Map.of(GENERATE_BUILDERS, true,
+ SpringCodegen.OPENAPI_NULLABLE, false,
+ SpringCodegen.USE_OPTIONAL, false));
+
+ JavaFileAssert.assertThat(files.get("Pet.java"))
+ .fileContains("toBuilder()",
+ "builder()",
+ "public static class Builder {");
+ JavaFileAssert.assertThat(files.get("Snake.java"))
+ .fileContains("toBuilder()",
+ "builder()",
+ "public static class Builder extends Reptile.Builder {",
+ "return builder.copyOf(this);");
+ JavaFileAssert.assertThat(files.get("SimpleObject.java"))
+ .fileContains("public SimpleObject.Builder additionalProperties(Map additionalProperties) {",
+ "SimpleObject.Builder nullableObject(String nullableObject) {",
+ "SimpleObject.Builder nb(BigDecimal nb) {")
+ .fileDoesNotContains("SimpleObject.Builder nullableObject(JsonNullable nullableObject) {");
+ }
+
+ @Test
+ void testBuilderJavaSpring_useOptional() throws IOException {
+ Map files = generateFromContract("src/test/resources/3_0/java/builder.yaml", SPRING_BOOT,
+ Map.of(GENERATE_BUILDERS, true,
+ SpringCodegen.OPENAPI_NULLABLE, true,
+ SpringCodegen.USE_OPTIONAL, true));
+
+ JavaFileAssert.assertThat(files.get("Pet.java"))
+ .fileContains("toBuilder()",
+ "builder()",
+ "public static class Builder {");
+ JavaFileAssert.assertThat(files.get("Snake.java"))
+ .fileContains("toBuilder()",
+ "builder()",
+ "public static class Builder extends Reptile.Builder {",
+ "return builder.copyOf(this);");
+ JavaFileAssert.assertThat(files.get("SimpleObject.java"))
+ .fileContains("public SimpleObject.Builder additionalProperties(Map additionalProperties) {",
+ "SimpleObject.Builder nullableObject(String nullableObject) {",
+ "SimpleObject.Builder nullableObject(JsonNullable nullableObject) {",
+ "SimpleObject.Builder nb(BigDecimal nb) {");
+ }
+
@Test
public void optionalListShouldBeEmpty() throws IOException {
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
diff --git a/modules/openapi-generator/src/test/resources/3_0/java/builder.yaml b/modules/openapi-generator/src/test/resources/3_0/java/builder.yaml
new file mode 100644
index 00000000000..bf77f24a400
--- /dev/null
+++ b/modules/openapi-generator/src/test/resources/3_0/java/builder.yaml
@@ -0,0 +1,140 @@
+openapi: 3.0.2
+info:
+ title: OAI Specification example for Polymorphism
+ version: 1.0.0
+paths:
+ /pet:
+ get:
+ responses:
+ '200':
+ description: desc
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Pet'
+ /reptile:
+ get:
+ responses:
+ '200':
+ description: desc
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Reptile'
+ /mypets:
+ get:
+ responses:
+ '200':
+ description: desc
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/MyPets'
+components:
+ schemas:
+ SimpleObject:
+ type: object
+ properties:
+ nb:
+ type: number
+ minimum: 1
+ simple:
+ type: string
+ list:
+ type: array
+ items:
+ minLength: 1
+ type: string
+ nullableObject:
+ type: string
+ nullable: true
+ nullableList:
+ type: array
+ nullable: true
+ items:
+ maxLength: 100
+ type: string
+ additionalProperties:
+ type: integer
+ Pet:
+ type: object
+ required:
+ - petType
+ properties:
+ petType:
+ type: string
+ name:
+ type: string
+ petReadonlyProperty:
+ type: string
+ readOnly: true
+ petNullableProperty:
+ type: string
+ nullable: true
+ discriminator:
+ propertyName: petType
+ additionalProperties:
+ type: number
+ Cat:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ name:
+ type: string
+ Reptile:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ Dog:
+ allOf:
+ - $ref: '#/components/schemas/Pet'
+ - type: object
+ properties:
+ bark:
+ type: string
+ simple:
+ $ref: '#/components/schemas/SimpleObject'
+ Lizard:
+ allOf:
+ - $ref: '#/components/schemas/Reptile'
+ - type: object
+ properties:
+ lovesRocks:
+ type: boolean
+ readOnly: true
+ Snake:
+ allOf:
+ - $ref: '#/components/schemas/Reptile'
+ - type: object
+ properties:
+ hasLegs:
+ type: boolean
+ MyPets:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Lizard'
+ discriminator:
+ propertyName: petType
+ # per https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#discriminatorObject
+ # this discriminator must be included to use it as a hint to pick a schema
+ MyPetsNoDisc:
+ oneOf:
+ - $ref: '#/components/schemas/Cat'
+ - $ref: '#/components/schemas/Lizard'
+ A:
+ type: object
+ required:
+ - petType
+ properties:
+ petType:
+ type: string
+ discriminator:
+ propertyName: petType
+ mapping:
+ b: '#/components/schemas/B'
+ B:
+ allOf:
+ - $ref: '#/components/schemas/A'
+ C:
+ allOf:
+ - $ref: '#/components/schemas/B'
diff --git a/pom.xml b/pom.xml
index f20f903e874..ac40cf6de02 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1263,4 +1263,4 @@
1.12
1.0-beta-2
-
\ No newline at end of file
+
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 9d68404cdc4..391d5fb581f 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
@@ -471,5 +471,98 @@ public class AdditionalPropertiesClass {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private AdditionalPropertiesClass instance;
+
+ public Builder() {
+ this(new AdditionalPropertiesClass());
+ }
+
+ protected Builder(AdditionalPropertiesClass instance) {
+ this.instance = instance;
+ }
+
+ public AdditionalPropertiesClass.Builder mapProperty(Map mapProperty) {
+ this.instance.mapProperty = mapProperty;
+ return this;
+ }
+ public AdditionalPropertiesClass.Builder mapOfMapProperty(Map> mapOfMapProperty) {
+ this.instance.mapOfMapProperty = mapOfMapProperty;
+ return this;
+ }
+ public AdditionalPropertiesClass.Builder anytype1(Object anytype1) {
+ this.instance.anytype1 = JsonNullable.of(anytype1);
+ return this;
+ }
+ public AdditionalPropertiesClass.Builder anytype1(JsonNullable anytype1) {
+ this.instance.anytype1 = anytype1;
+ return this;
+ }
+ public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesAnytype1(Object mapWithUndeclaredPropertiesAnytype1) {
+ this.instance.mapWithUndeclaredPropertiesAnytype1 = mapWithUndeclaredPropertiesAnytype1;
+ return this;
+ }
+ public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesAnytype2(Object mapWithUndeclaredPropertiesAnytype2) {
+ this.instance.mapWithUndeclaredPropertiesAnytype2 = mapWithUndeclaredPropertiesAnytype2;
+ return this;
+ }
+ public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesAnytype3(Map mapWithUndeclaredPropertiesAnytype3) {
+ this.instance.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3;
+ return this;
+ }
+ public AdditionalPropertiesClass.Builder emptyMap(Object emptyMap) {
+ this.instance.emptyMap = emptyMap;
+ return this;
+ }
+ public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesString(Map mapWithUndeclaredPropertiesString) {
+ this.instance.mapWithUndeclaredPropertiesString = mapWithUndeclaredPropertiesString;
+ return this;
+ }
+
+
+ /**
+ * returns a built AdditionalPropertiesClass instance.
+ *
+ * The builder is not reusable.
+ */
+ public AdditionalPropertiesClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static AdditionalPropertiesClass.Builder builder() {
+ return new AdditionalPropertiesClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AdditionalPropertiesClass.Builder toBuilder() {
+ return new AdditionalPropertiesClass.Builder()
+ .mapProperty(getMapProperty())
+ .mapOfMapProperty(getMapOfMapProperty())
+ .anytype1(getAnytype1())
+ .mapWithUndeclaredPropertiesAnytype1(getMapWithUndeclaredPropertiesAnytype1())
+ .mapWithUndeclaredPropertiesAnytype2(getMapWithUndeclaredPropertiesAnytype2())
+ .mapWithUndeclaredPropertiesAnytype3(getMapWithUndeclaredPropertiesAnytype3())
+ .emptyMap(getEmptyMap())
+ .mapWithUndeclaredPropertiesString(getMapWithUndeclaredPropertiesString());
+ }
+
}
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 80e9b5ac695..247d9913725 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
@@ -204,5 +204,64 @@ static {
mappings.put("Animal", Animal.class);
JSON.registerDiscriminator(Animal.class, "className", mappings);
}
+
+ public static class Builder {
+
+ private Animal instance;
+
+ public Builder() {
+ this(new Animal());
+ }
+
+ protected Builder(Animal instance) {
+ this.instance = instance;
+ }
+
+ public Animal.Builder className(String className) {
+ this.instance.className = className;
+ return this;
+ }
+ public Animal.Builder color(String color) {
+ this.instance.color = color;
+ return this;
+ }
+
+
+ /**
+ * returns a built Animal instance.
+ *
+ * The builder is not reusable.
+ */
+ public Animal build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Animal.Builder builder() {
+ return new Animal.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Animal.Builder toBuilder() {
+ return new Animal.Builder()
+ .className(getClassName())
+ .color(getColor());
+ }
+
}
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 112040a6b78..bd1819184f6 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
@@ -182,5 +182,64 @@ public class Apple {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Apple instance;
+
+ public Builder() {
+ this(new Apple());
+ }
+
+ protected Builder(Apple instance) {
+ this.instance = instance;
+ }
+
+ public Apple.Builder cultivar(String cultivar) {
+ this.instance.cultivar = cultivar;
+ return this;
+ }
+ public Apple.Builder origin(String origin) {
+ this.instance.origin = origin;
+ return this;
+ }
+
+
+ /**
+ * returns a built Apple instance.
+ *
+ * The builder is not reusable.
+ */
+ public Apple build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Apple.Builder builder() {
+ return new Apple.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Apple.Builder toBuilder() {
+ return new Apple.Builder()
+ .cultivar(getCultivar())
+ .origin(getOrigin());
+ }
+
}
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 490cae0f608..a014241fd20 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
@@ -182,5 +182,64 @@ public class AppleReq {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private AppleReq instance;
+
+ public Builder() {
+ this(new AppleReq());
+ }
+
+ protected Builder(AppleReq instance) {
+ this.instance = instance;
+ }
+
+ public AppleReq.Builder cultivar(String cultivar) {
+ this.instance.cultivar = cultivar;
+ return this;
+ }
+ public AppleReq.Builder mealy(Boolean mealy) {
+ this.instance.mealy = mealy;
+ return this;
+ }
+
+
+ /**
+ * returns a built AppleReq instance.
+ *
+ * The builder is not reusable.
+ */
+ public AppleReq build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static AppleReq.Builder builder() {
+ return new AppleReq.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AppleReq.Builder toBuilder() {
+ return new AppleReq.Builder()
+ .cultivar(getCultivar())
+ .mealy(getMealy());
+ }
+
}
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 36d6717577d..a39ddd0305c 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
@@ -163,5 +163,59 @@ public class ArrayOfArrayOfNumberOnly {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ArrayOfArrayOfNumberOnly instance;
+
+ public Builder() {
+ this(new ArrayOfArrayOfNumberOnly());
+ }
+
+ protected Builder(ArrayOfArrayOfNumberOnly instance) {
+ this.instance = instance;
+ }
+
+ public ArrayOfArrayOfNumberOnly.Builder arrayArrayNumber(List> arrayArrayNumber) {
+ this.instance.arrayArrayNumber = arrayArrayNumber;
+ return this;
+ }
+
+
+ /**
+ * returns a built ArrayOfArrayOfNumberOnly instance.
+ *
+ * The builder is not reusable.
+ */
+ public ArrayOfArrayOfNumberOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ArrayOfArrayOfNumberOnly.Builder builder() {
+ return new ArrayOfArrayOfNumberOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ArrayOfArrayOfNumberOnly.Builder toBuilder() {
+ return new ArrayOfArrayOfNumberOnly.Builder()
+ .arrayArrayNumber(getArrayArrayNumber());
+ }
+
}
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 ad577abfc98..49a76a2f667 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
@@ -163,5 +163,59 @@ public class ArrayOfNumberOnly {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ArrayOfNumberOnly instance;
+
+ public Builder() {
+ this(new ArrayOfNumberOnly());
+ }
+
+ protected Builder(ArrayOfNumberOnly instance) {
+ this.instance = instance;
+ }
+
+ public ArrayOfNumberOnly.Builder arrayNumber(List arrayNumber) {
+ this.instance.arrayNumber = arrayNumber;
+ return this;
+ }
+
+
+ /**
+ * returns a built ArrayOfNumberOnly instance.
+ *
+ * The builder is not reusable.
+ */
+ public ArrayOfNumberOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ArrayOfNumberOnly.Builder builder() {
+ return new ArrayOfNumberOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ArrayOfNumberOnly.Builder toBuilder() {
+ return new ArrayOfNumberOnly.Builder()
+ .arrayNumber(getArrayNumber());
+ }
+
}
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 5c51748d98c..db037a5fbe5 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
@@ -259,5 +259,69 @@ public class ArrayTest {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ArrayTest instance;
+
+ public Builder() {
+ this(new ArrayTest());
+ }
+
+ protected Builder(ArrayTest instance) {
+ this.instance = instance;
+ }
+
+ public ArrayTest.Builder arrayOfString(List arrayOfString) {
+ this.instance.arrayOfString = arrayOfString;
+ return this;
+ }
+ public ArrayTest.Builder arrayArrayOfInteger(List> arrayArrayOfInteger) {
+ this.instance.arrayArrayOfInteger = arrayArrayOfInteger;
+ return this;
+ }
+ public ArrayTest.Builder arrayArrayOfModel(List> arrayArrayOfModel) {
+ this.instance.arrayArrayOfModel = arrayArrayOfModel;
+ return this;
+ }
+
+
+ /**
+ * returns a built ArrayTest instance.
+ *
+ * The builder is not reusable.
+ */
+ public ArrayTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ArrayTest.Builder builder() {
+ return new ArrayTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ArrayTest.Builder toBuilder() {
+ return new ArrayTest.Builder()
+ .arrayOfString(getArrayOfString())
+ .arrayArrayOfInteger(getArrayArrayOfInteger())
+ .arrayArrayOfModel(getArrayArrayOfModel());
+ }
+
}
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 7494955a349..5b51ab86ad6 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
@@ -147,5 +147,59 @@ public class Banana {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Banana instance;
+
+ public Builder() {
+ this(new Banana());
+ }
+
+ protected Builder(Banana instance) {
+ this.instance = instance;
+ }
+
+ public Banana.Builder lengthCm(BigDecimal lengthCm) {
+ this.instance.lengthCm = lengthCm;
+ return this;
+ }
+
+
+ /**
+ * returns a built Banana instance.
+ *
+ * The builder is not reusable.
+ */
+ public Banana build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Banana.Builder builder() {
+ return new Banana.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Banana.Builder toBuilder() {
+ return new Banana.Builder()
+ .lengthCm(getLengthCm());
+ }
+
}
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 a9ef9909cad..969909bb57b 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
@@ -183,5 +183,64 @@ public class BananaReq {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private BananaReq instance;
+
+ public Builder() {
+ this(new BananaReq());
+ }
+
+ protected Builder(BananaReq instance) {
+ this.instance = instance;
+ }
+
+ public BananaReq.Builder lengthCm(BigDecimal lengthCm) {
+ this.instance.lengthCm = lengthCm;
+ return this;
+ }
+ public BananaReq.Builder sweet(Boolean sweet) {
+ this.instance.sweet = sweet;
+ return this;
+ }
+
+
+ /**
+ * returns a built BananaReq instance.
+ *
+ * The builder is not reusable.
+ */
+ public BananaReq build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static BananaReq.Builder builder() {
+ return new BananaReq.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public BananaReq.Builder toBuilder() {
+ return new BananaReq.Builder()
+ .lengthCm(getLengthCm())
+ .sweet(getSweet());
+ }
+
}
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 ea2c7ba5fad..ca19c9225d1 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
@@ -146,5 +146,59 @@ public class BasquePig {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private BasquePig instance;
+
+ public Builder() {
+ this(new BasquePig());
+ }
+
+ protected Builder(BasquePig instance) {
+ this.instance = instance;
+ }
+
+ public BasquePig.Builder className(String className) {
+ this.instance.className = className;
+ return this;
+ }
+
+
+ /**
+ * returns a built BasquePig instance.
+ *
+ * The builder is not reusable.
+ */
+ public BasquePig build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static BasquePig.Builder builder() {
+ return new BasquePig.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public BasquePig.Builder toBuilder() {
+ return new BasquePig.Builder()
+ .className(getClassName());
+ }
+
}
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 bebb9787a2b..edbe3cf8dcd 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
@@ -326,5 +326,84 @@ public class Capitalization {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Capitalization instance;
+
+ public Builder() {
+ this(new Capitalization());
+ }
+
+ protected Builder(Capitalization instance) {
+ this.instance = instance;
+ }
+
+ public Capitalization.Builder smallCamel(String smallCamel) {
+ this.instance.smallCamel = smallCamel;
+ return this;
+ }
+ public Capitalization.Builder capitalCamel(String capitalCamel) {
+ this.instance.capitalCamel = capitalCamel;
+ return this;
+ }
+ public Capitalization.Builder smallSnake(String smallSnake) {
+ this.instance.smallSnake = smallSnake;
+ return this;
+ }
+ public Capitalization.Builder capitalSnake(String capitalSnake) {
+ this.instance.capitalSnake = capitalSnake;
+ return this;
+ }
+ public Capitalization.Builder scAETHFlowPoints(String scAETHFlowPoints) {
+ this.instance.scAETHFlowPoints = scAETHFlowPoints;
+ return this;
+ }
+ public Capitalization.Builder ATT_NAME(String ATT_NAME) {
+ this.instance.ATT_NAME = ATT_NAME;
+ return this;
+ }
+
+
+ /**
+ * returns a built Capitalization instance.
+ *
+ * The builder is not reusable.
+ */
+ public Capitalization build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Capitalization.Builder builder() {
+ return new Capitalization.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Capitalization.Builder toBuilder() {
+ return new Capitalization.Builder()
+ .smallCamel(getSmallCamel())
+ .capitalCamel(getCapitalCamel())
+ .smallSnake(getSmallSnake())
+ .capitalSnake(getCapitalSnake())
+ .scAETHFlowPoints(getScAETHFlowPoints())
+ .ATT_NAME(getATTNAME());
+ }
+
}
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 c6d360b2dd8..e54b41ecd2a 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
@@ -188,5 +188,73 @@ static {
mappings.put("Cat", Cat.class);
JSON.registerDiscriminator(Cat.class, "className", mappings);
}
+
+ public static class Builder extends Animal.Builder {
+
+ private Cat instance;
+
+ public Builder() {
+ this(new Cat());
+ }
+
+ protected Builder(Cat instance) {
+ super(instance);
+ this.instance = instance;
+ }
+
+ public Cat.Builder declawed(Boolean declawed) {
+ this.instance.declawed = declawed;
+ return this;
+ }
+
+ public Cat.Builder className(String className) { // inherited: true
+ super.className(className);
+ return this;
+ }
+
+ public Cat.Builder color(String color) { // inherited: true
+ super.color(color);
+ return this;
+ }
+
+
+ /**
+ * returns a built Cat instance.
+ *
+ * The builder is not reusable.
+ */
+ public Cat build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Cat.Builder builder() {
+ return new Cat.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Cat.Builder toBuilder() {
+ return new Cat.Builder()
+ .className(getClassName())
+ .color(getColor())
+ .declawed(getDeclawed());
+ }
+
}
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 0f1ddd05c05..7ea4d607ef5 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
@@ -182,5 +182,64 @@ public class Category {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Category instance;
+
+ public Builder() {
+ this(new Category());
+ }
+
+ protected Builder(Category instance) {
+ this.instance = instance;
+ }
+
+ public Category.Builder id(Long id) {
+ this.instance.id = id;
+ return this;
+ }
+ public Category.Builder name(String name) {
+ this.instance.name = name;
+ return this;
+ }
+
+
+ /**
+ * returns a built Category instance.
+ *
+ * The builder is not reusable.
+ */
+ public Category build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Category.Builder builder() {
+ return new Category.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Category.Builder toBuilder() {
+ return new Category.Builder()
+ .id(getId())
+ .name(getName());
+ }
+
}
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 2ff8e58cd3e..c661e05c4dc 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
@@ -215,5 +215,66 @@ static {
mappings.put("ChildCat", ChildCat.class);
JSON.registerDiscriminator(ChildCat.class, "pet_type", mappings);
}
+
+ public static class Builder extends ParentPet.Builder {
+
+ private ChildCat instance;
+
+ public Builder() {
+ this(new ChildCat());
+ }
+
+ protected Builder(ChildCat instance) {
+ super(instance);
+ this.instance = instance;
+ }
+
+ public ChildCat.Builder name(String name) {
+ this.instance.name = name;
+ return this;
+ }
+ public ChildCat.Builder petType(String petType) {
+ this.instance.petType = petType;
+ return this;
+ }
+
+
+ /**
+ * returns a built ChildCat instance.
+ *
+ * The builder is not reusable.
+ */
+ public ChildCat build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ChildCat.Builder builder() {
+ return new ChildCat.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ChildCat.Builder toBuilder() {
+ return new ChildCat.Builder()
+ .petType(getPetType())
+ .name(getName());
+ }
+
}
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 4d4a1be3c35..9ac1403cf0e 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
@@ -146,5 +146,59 @@ public class ClassModel {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ClassModel instance;
+
+ public Builder() {
+ this(new ClassModel());
+ }
+
+ protected Builder(ClassModel instance) {
+ this.instance = instance;
+ }
+
+ public ClassModel.Builder propertyClass(String propertyClass) {
+ this.instance.propertyClass = propertyClass;
+ return this;
+ }
+
+
+ /**
+ * returns a built ClassModel instance.
+ *
+ * The builder is not reusable.
+ */
+ public ClassModel build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ClassModel.Builder builder() {
+ return new ClassModel.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ClassModel.Builder toBuilder() {
+ return new ClassModel.Builder()
+ .propertyClass(getPropertyClass());
+ }
+
}
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 bbb8bf6c067..1fb96d8cdc2 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
@@ -146,5 +146,59 @@ public class Client {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Client instance;
+
+ public Builder() {
+ this(new Client());
+ }
+
+ protected Builder(Client instance) {
+ this.instance = instance;
+ }
+
+ public Client.Builder client(String client) {
+ this.instance.client = client;
+ return this;
+ }
+
+
+ /**
+ * returns a built Client instance.
+ *
+ * The builder is not reusable.
+ */
+ public Client build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Client.Builder builder() {
+ return new Client.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Client.Builder toBuilder() {
+ return new Client.Builder()
+ .client(getClient());
+ }
+
}
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 6eca37898d5..345b324963c 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
@@ -182,5 +182,64 @@ public class ComplexQuadrilateral {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ComplexQuadrilateral instance;
+
+ public Builder() {
+ this(new ComplexQuadrilateral());
+ }
+
+ protected Builder(ComplexQuadrilateral instance) {
+ this.instance = instance;
+ }
+
+ public ComplexQuadrilateral.Builder shapeType(String shapeType) {
+ this.instance.shapeType = shapeType;
+ return this;
+ }
+ public ComplexQuadrilateral.Builder quadrilateralType(String quadrilateralType) {
+ this.instance.quadrilateralType = quadrilateralType;
+ return this;
+ }
+
+
+ /**
+ * returns a built ComplexQuadrilateral instance.
+ *
+ * The builder is not reusable.
+ */
+ public ComplexQuadrilateral build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ComplexQuadrilateral.Builder builder() {
+ return new ComplexQuadrilateral.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ComplexQuadrilateral.Builder toBuilder() {
+ return new ComplexQuadrilateral.Builder()
+ .shapeType(getShapeType())
+ .quadrilateralType(getQuadrilateralType());
+ }
+
}
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 04c1f03c018..49ae57b8d6a 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
@@ -146,5 +146,59 @@ public class DanishPig {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private DanishPig instance;
+
+ public Builder() {
+ this(new DanishPig());
+ }
+
+ protected Builder(DanishPig instance) {
+ this.instance = instance;
+ }
+
+ public DanishPig.Builder className(String className) {
+ this.instance.className = className;
+ return this;
+ }
+
+
+ /**
+ * returns a built DanishPig instance.
+ *
+ * The builder is not reusable.
+ */
+ public DanishPig build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static DanishPig.Builder builder() {
+ return new DanishPig.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public DanishPig.Builder toBuilder() {
+ return new DanishPig.Builder()
+ .className(getClassName());
+ }
+
}
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 c738a92c3ce..7190a79911f 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
@@ -148,5 +148,59 @@ public class DeprecatedObject {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private DeprecatedObject instance;
+
+ public Builder() {
+ this(new DeprecatedObject());
+ }
+
+ protected Builder(DeprecatedObject instance) {
+ this.instance = instance;
+ }
+
+ public DeprecatedObject.Builder name(String name) {
+ this.instance.name = name;
+ return this;
+ }
+
+
+ /**
+ * returns a built DeprecatedObject instance.
+ *
+ * The builder is not reusable.
+ */
+ public DeprecatedObject build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static DeprecatedObject.Builder builder() {
+ return new DeprecatedObject.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public DeprecatedObject.Builder toBuilder() {
+ return new DeprecatedObject.Builder()
+ .name(getName());
+ }
+
}
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 9c4a2ec84ff..5c2d4ebf796 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
@@ -187,5 +187,73 @@ static {
mappings.put("Dog", Dog.class);
JSON.registerDiscriminator(Dog.class, "className", mappings);
}
+
+ public static class Builder extends Animal.Builder {
+
+ private Dog instance;
+
+ public Builder() {
+ this(new Dog());
+ }
+
+ protected Builder(Dog instance) {
+ super(instance);
+ this.instance = instance;
+ }
+
+ public Dog.Builder breed(String breed) {
+ this.instance.breed = breed;
+ return this;
+ }
+
+ public Dog.Builder className(String className) { // inherited: true
+ super.className(className);
+ return this;
+ }
+
+ public Dog.Builder color(String color) { // inherited: true
+ super.color(color);
+ return this;
+ }
+
+
+ /**
+ * returns a built Dog instance.
+ *
+ * The builder is not reusable.
+ */
+ public Dog build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Dog.Builder builder() {
+ return new Dog.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Dog.Builder toBuilder() {
+ return new Dog.Builder()
+ .className(getClassName())
+ .color(getColor())
+ .breed(getBreed());
+ }
+
}
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 e9d2beb1456..6e56f7bb4c0 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
@@ -349,5 +349,78 @@ public class Drawing extends HashMap {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Drawing instance;
+
+ public Builder() {
+ this(new Drawing());
+ }
+
+ protected Builder(Drawing instance) {
+ this.instance = instance;
+ }
+
+ public Drawing.Builder mainShape(Shape mainShape) {
+ this.instance.mainShape = mainShape;
+ return this;
+ }
+ public Drawing.Builder shapeOrNull(ShapeOrNull shapeOrNull) {
+ this.instance.shapeOrNull = shapeOrNull;
+ return this;
+ }
+ public Drawing.Builder nullableShape(NullableShape nullableShape) {
+ this.instance.nullableShape = JsonNullable.of(nullableShape);
+ return this;
+ }
+ public Drawing.Builder nullableShape(JsonNullable nullableShape) {
+ this.instance.nullableShape = nullableShape;
+ return this;
+ }
+ public Drawing.Builder shapes(List shapes) {
+ this.instance.shapes = shapes;
+ return this;
+ }
+
+
+ /**
+ * returns a built Drawing instance.
+ *
+ * The builder is not reusable.
+ */
+ public Drawing build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Drawing.Builder builder() {
+ return new Drawing.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Drawing.Builder toBuilder() {
+ return new Drawing.Builder()
+ .mainShape(getMainShape())
+ .shapeOrNull(getShapeOrNull())
+ .nullableShape(getNullableShape())
+ .shapes(getShapes());
+ }
+
}
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 84dd4ab29c0..f22832556ec 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
@@ -266,5 +266,64 @@ public class EnumArrays {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private EnumArrays instance;
+
+ public Builder() {
+ this(new EnumArrays());
+ }
+
+ protected Builder(EnumArrays instance) {
+ this.instance = instance;
+ }
+
+ public EnumArrays.Builder justSymbol(JustSymbolEnum justSymbol) {
+ this.instance.justSymbol = justSymbol;
+ return this;
+ }
+ public EnumArrays.Builder arrayEnum(List arrayEnum) {
+ this.instance.arrayEnum = arrayEnum;
+ return this;
+ }
+
+
+ /**
+ * returns a built EnumArrays instance.
+ *
+ * The builder is not reusable.
+ */
+ public EnumArrays build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static EnumArrays.Builder builder() {
+ return new EnumArrays.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public EnumArrays.Builder toBuilder() {
+ return new EnumArrays.Builder()
+ .justSymbol(getJustSymbol())
+ .arrayEnum(getArrayEnum());
+ }
+
}
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 27b3afeb4a1..1e8bcd3b95f 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
@@ -640,5 +640,103 @@ public class EnumTest {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private EnumTest instance;
+
+ public Builder() {
+ this(new EnumTest());
+ }
+
+ protected Builder(EnumTest instance) {
+ this.instance = instance;
+ }
+
+ public EnumTest.Builder enumString(EnumStringEnum enumString) {
+ this.instance.enumString = enumString;
+ return this;
+ }
+ public EnumTest.Builder enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
+ this.instance.enumStringRequired = enumStringRequired;
+ return this;
+ }
+ public EnumTest.Builder enumInteger(EnumIntegerEnum enumInteger) {
+ this.instance.enumInteger = enumInteger;
+ return this;
+ }
+ public EnumTest.Builder enumIntegerOnly(EnumIntegerOnlyEnum enumIntegerOnly) {
+ this.instance.enumIntegerOnly = enumIntegerOnly;
+ return this;
+ }
+ public EnumTest.Builder enumNumber(EnumNumberEnum enumNumber) {
+ this.instance.enumNumber = enumNumber;
+ return this;
+ }
+ public EnumTest.Builder outerEnum(OuterEnum outerEnum) {
+ this.instance.outerEnum = JsonNullable.of(outerEnum);
+ return this;
+ }
+ public EnumTest.Builder outerEnum(JsonNullable outerEnum) {
+ this.instance.outerEnum = outerEnum;
+ return this;
+ }
+ public EnumTest.Builder outerEnumInteger(OuterEnumInteger outerEnumInteger) {
+ this.instance.outerEnumInteger = outerEnumInteger;
+ return this;
+ }
+ public EnumTest.Builder outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) {
+ this.instance.outerEnumDefaultValue = outerEnumDefaultValue;
+ return this;
+ }
+ public EnumTest.Builder outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) {
+ this.instance.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
+ return this;
+ }
+
+
+ /**
+ * returns a built EnumTest instance.
+ *
+ * The builder is not reusable.
+ */
+ public EnumTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static EnumTest.Builder builder() {
+ return new EnumTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public EnumTest.Builder toBuilder() {
+ return new EnumTest.Builder()
+ .enumString(getEnumString())
+ .enumStringRequired(getEnumStringRequired())
+ .enumInteger(getEnumInteger())
+ .enumIntegerOnly(getEnumIntegerOnly())
+ .enumNumber(getEnumNumber())
+ .outerEnum(getOuterEnum())
+ .outerEnumInteger(getOuterEnumInteger())
+ .outerEnumDefaultValue(getOuterEnumDefaultValue())
+ .outerEnumIntegerDefaultValue(getOuterEnumIntegerDefaultValue());
+ }
+
}
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 24a4a3a7645..6cdc1e6b511 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
@@ -182,5 +182,64 @@ public class EquilateralTriangle {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private EquilateralTriangle instance;
+
+ public Builder() {
+ this(new EquilateralTriangle());
+ }
+
+ protected Builder(EquilateralTriangle instance) {
+ this.instance = instance;
+ }
+
+ public EquilateralTriangle.Builder shapeType(String shapeType) {
+ this.instance.shapeType = shapeType;
+ return this;
+ }
+ public EquilateralTriangle.Builder triangleType(String triangleType) {
+ this.instance.triangleType = triangleType;
+ return this;
+ }
+
+
+ /**
+ * returns a built EquilateralTriangle instance.
+ *
+ * The builder is not reusable.
+ */
+ public EquilateralTriangle build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static EquilateralTriangle.Builder builder() {
+ return new EquilateralTriangle.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public EquilateralTriangle.Builder toBuilder() {
+ return new EquilateralTriangle.Builder()
+ .shapeType(getShapeType())
+ .triangleType(getTriangleType());
+ }
+
}
diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
index da04aa2b30d..8c934609663 100644
--- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
+++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
@@ -197,5 +197,64 @@ public class FakeBigDecimalMap200Response {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private FakeBigDecimalMap200Response instance;
+
+ public Builder() {
+ this(new FakeBigDecimalMap200Response());
+ }
+
+ protected Builder(FakeBigDecimalMap200Response instance) {
+ this.instance = instance;
+ }
+
+ public FakeBigDecimalMap200Response.Builder someId(BigDecimal someId) {
+ this.instance.someId = someId;
+ return this;
+ }
+ public FakeBigDecimalMap200Response.Builder someMap(Map someMap) {
+ this.instance.someMap = someMap;
+ return this;
+ }
+
+
+ /**
+ * returns a built FakeBigDecimalMap200Response instance.
+ *
+ * The builder is not reusable.
+ */
+ public FakeBigDecimalMap200Response build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static FakeBigDecimalMap200Response.Builder builder() {
+ return new FakeBigDecimalMap200Response.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FakeBigDecimalMap200Response.Builder toBuilder() {
+ return new FakeBigDecimalMap200Response.Builder()
+ .someId(getSomeId())
+ .someMap(getSomeMap());
+ }
+
}
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 2d147509563..530e3dd27b0 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
@@ -198,5 +198,64 @@ public class FileSchemaTestClass {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private FileSchemaTestClass instance;
+
+ public Builder() {
+ this(new FileSchemaTestClass());
+ }
+
+ protected Builder(FileSchemaTestClass instance) {
+ this.instance = instance;
+ }
+
+ public FileSchemaTestClass.Builder _file(ModelFile _file) {
+ this.instance._file = _file;
+ return this;
+ }
+ public FileSchemaTestClass.Builder files(List files) {
+ this.instance.files = files;
+ return this;
+ }
+
+
+ /**
+ * returns a built FileSchemaTestClass instance.
+ *
+ * The builder is not reusable.
+ */
+ public FileSchemaTestClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static FileSchemaTestClass.Builder builder() {
+ return new FileSchemaTestClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FileSchemaTestClass.Builder toBuilder() {
+ return new FileSchemaTestClass.Builder()
+ ._file(getFile())
+ .files(getFiles());
+ }
+
}
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 de7c6d78f94..db3312b55e5 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
@@ -146,5 +146,59 @@ public class Foo {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Foo instance;
+
+ public Builder() {
+ this(new Foo());
+ }
+
+ protected Builder(Foo instance) {
+ this.instance = instance;
+ }
+
+ public Foo.Builder bar(String bar) {
+ this.instance.bar = bar;
+ return this;
+ }
+
+
+ /**
+ * returns a built Foo instance.
+ *
+ * The builder is not reusable.
+ */
+ public Foo build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Foo.Builder builder() {
+ return new Foo.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Foo.Builder toBuilder() {
+ return new Foo.Builder()
+ .bar(getBar());
+ }
+
}
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 19f871f4a66..f3524b642b3 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
@@ -147,5 +147,59 @@ public class FooGetDefaultResponse {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private FooGetDefaultResponse instance;
+
+ public Builder() {
+ this(new FooGetDefaultResponse());
+ }
+
+ protected Builder(FooGetDefaultResponse instance) {
+ this.instance = instance;
+ }
+
+ public FooGetDefaultResponse.Builder string(Foo string) {
+ this.instance.string = string;
+ return this;
+ }
+
+
+ /**
+ * returns a built FooGetDefaultResponse instance.
+ *
+ * The builder is not reusable.
+ */
+ public FooGetDefaultResponse build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static FooGetDefaultResponse.Builder builder() {
+ return new FooGetDefaultResponse.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FooGetDefaultResponse.Builder toBuilder() {
+ return new FooGetDefaultResponse.Builder()
+ .string(getString());
+ }
+
}
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 39bd1171556..5b9ec0d0689 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
@@ -701,5 +701,134 @@ public class FormatTest {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private FormatTest instance;
+
+ public Builder() {
+ this(new FormatTest());
+ }
+
+ protected Builder(FormatTest instance) {
+ this.instance = instance;
+ }
+
+ public FormatTest.Builder integer(Integer integer) {
+ this.instance.integer = integer;
+ return this;
+ }
+ public FormatTest.Builder int32(Integer int32) {
+ this.instance.int32 = int32;
+ return this;
+ }
+ public FormatTest.Builder int64(Long int64) {
+ this.instance.int64 = int64;
+ return this;
+ }
+ public FormatTest.Builder number(BigDecimal number) {
+ this.instance.number = number;
+ return this;
+ }
+ public FormatTest.Builder _float(Float _float) {
+ this.instance._float = _float;
+ return this;
+ }
+ public FormatTest.Builder _double(Double _double) {
+ this.instance._double = _double;
+ return this;
+ }
+ public FormatTest.Builder decimal(BigDecimal decimal) {
+ this.instance.decimal = decimal;
+ return this;
+ }
+ public FormatTest.Builder string(String string) {
+ this.instance.string = string;
+ return this;
+ }
+ public FormatTest.Builder _byte(byte[] _byte) {
+ this.instance._byte = _byte;
+ return this;
+ }
+ public FormatTest.Builder binary(File binary) {
+ this.instance.binary = binary;
+ return this;
+ }
+ public FormatTest.Builder date(LocalDate date) {
+ this.instance.date = date;
+ return this;
+ }
+ public FormatTest.Builder dateTime(OffsetDateTime dateTime) {
+ this.instance.dateTime = dateTime;
+ return this;
+ }
+ public FormatTest.Builder uuid(UUID uuid) {
+ this.instance.uuid = uuid;
+ return this;
+ }
+ public FormatTest.Builder password(String password) {
+ this.instance.password = password;
+ return this;
+ }
+ public FormatTest.Builder patternWithDigits(String patternWithDigits) {
+ this.instance.patternWithDigits = patternWithDigits;
+ return this;
+ }
+ public FormatTest.Builder patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) {
+ this.instance.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
+ return this;
+ }
+
+
+ /**
+ * returns a built FormatTest instance.
+ *
+ * The builder is not reusable.
+ */
+ public FormatTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static FormatTest.Builder builder() {
+ return new FormatTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FormatTest.Builder toBuilder() {
+ return new FormatTest.Builder()
+ .integer(getInteger())
+ .int32(getInt32())
+ .int64(getInt64())
+ .number(getNumber())
+ ._float(getFloat())
+ ._double(getDouble())
+ .decimal(getDecimal())
+ .string(getString())
+ ._byte(getByte())
+ .binary(getBinary())
+ .date(getDate())
+ .dateTime(getDateTime())
+ .uuid(getUuid())
+ .password(getPassword())
+ .patternWithDigits(getPatternWithDigits())
+ .patternWithDigitsAndDelimiter(getPatternWithDigitsAndDelimiter());
+ }
+
}
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 7abf493f1ab..93ac2e76394 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
@@ -168,5 +168,59 @@ static {
mappings.put("GrandparentAnimal", GrandparentAnimal.class);
JSON.registerDiscriminator(GrandparentAnimal.class, "pet_type", mappings);
}
+
+ public static class Builder {
+
+ private GrandparentAnimal instance;
+
+ public Builder() {
+ this(new GrandparentAnimal());
+ }
+
+ protected Builder(GrandparentAnimal instance) {
+ this.instance = instance;
+ }
+
+ public GrandparentAnimal.Builder petType(String petType) {
+ this.instance.petType = petType;
+ return this;
+ }
+
+
+ /**
+ * returns a built GrandparentAnimal instance.
+ *
+ * The builder is not reusable.
+ */
+ public GrandparentAnimal build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static GrandparentAnimal.Builder builder() {
+ return new GrandparentAnimal.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public GrandparentAnimal.Builder toBuilder() {
+ return new GrandparentAnimal.Builder()
+ .petType(getPetType());
+ }
+
}
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 92a86f6189e..d1eaa12325c 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
@@ -172,5 +172,64 @@ public class HasOnlyReadOnly {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private HasOnlyReadOnly instance;
+
+ public Builder() {
+ this(new HasOnlyReadOnly());
+ }
+
+ protected Builder(HasOnlyReadOnly instance) {
+ this.instance = instance;
+ }
+
+ public HasOnlyReadOnly.Builder bar(String bar) {
+ this.instance.bar = bar;
+ return this;
+ }
+ public HasOnlyReadOnly.Builder foo(String foo) {
+ this.instance.foo = foo;
+ return this;
+ }
+
+
+ /**
+ * returns a built HasOnlyReadOnly instance.
+ *
+ * The builder is not reusable.
+ */
+ public HasOnlyReadOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static HasOnlyReadOnly.Builder builder() {
+ return new HasOnlyReadOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public HasOnlyReadOnly.Builder toBuilder() {
+ return new HasOnlyReadOnly.Builder()
+ .bar(getBar())
+ .foo(getFoo());
+ }
+
}
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 a064f9619c4..ce1ab0df10e 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
@@ -169,5 +169,63 @@ public class HealthCheckResult {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private HealthCheckResult instance;
+
+ public Builder() {
+ this(new HealthCheckResult());
+ }
+
+ protected Builder(HealthCheckResult instance) {
+ this.instance = instance;
+ }
+
+ public HealthCheckResult.Builder nullableMessage(String nullableMessage) {
+ this.instance.nullableMessage = JsonNullable.of(nullableMessage);
+ return this;
+ }
+ public HealthCheckResult.Builder nullableMessage(JsonNullable nullableMessage) {
+ this.instance.nullableMessage = nullableMessage;
+ return this;
+ }
+
+
+ /**
+ * returns a built HealthCheckResult instance.
+ *
+ * The builder is not reusable.
+ */
+ public HealthCheckResult build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static HealthCheckResult.Builder builder() {
+ return new HealthCheckResult.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public HealthCheckResult.Builder toBuilder() {
+ return new HealthCheckResult.Builder()
+ .nullableMessage(getNullableMessage());
+ }
+
}
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 9f82687b397..cd1f2247240 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
@@ -182,5 +182,64 @@ public class IsoscelesTriangle {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private IsoscelesTriangle instance;
+
+ public Builder() {
+ this(new IsoscelesTriangle());
+ }
+
+ protected Builder(IsoscelesTriangle instance) {
+ this.instance = instance;
+ }
+
+ public IsoscelesTriangle.Builder shapeType(String shapeType) {
+ this.instance.shapeType = shapeType;
+ return this;
+ }
+ public IsoscelesTriangle.Builder triangleType(String triangleType) {
+ this.instance.triangleType = triangleType;
+ return this;
+ }
+
+
+ /**
+ * returns a built IsoscelesTriangle instance.
+ *
+ * The builder is not reusable.
+ */
+ public IsoscelesTriangle build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static IsoscelesTriangle.Builder builder() {
+ return new IsoscelesTriangle.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public IsoscelesTriangle.Builder toBuilder() {
+ return new IsoscelesTriangle.Builder()
+ .shapeType(getShapeType())
+ .triangleType(getTriangleType());
+ }
+
}
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 0800e433594..cdb5f84bf79 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
@@ -339,5 +339,74 @@ public class MapTest {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private MapTest instance;
+
+ public Builder() {
+ this(new MapTest());
+ }
+
+ protected Builder(MapTest instance) {
+ this.instance = instance;
+ }
+
+ public MapTest.Builder mapMapOfString(Map> mapMapOfString) {
+ this.instance.mapMapOfString = mapMapOfString;
+ return this;
+ }
+ public MapTest.Builder mapOfEnumString(Map mapOfEnumString) {
+ this.instance.mapOfEnumString = mapOfEnumString;
+ return this;
+ }
+ public MapTest.Builder directMap(Map directMap) {
+ this.instance.directMap = directMap;
+ return this;
+ }
+ public MapTest.Builder indirectMap(Map indirectMap) {
+ this.instance.indirectMap = indirectMap;
+ return this;
+ }
+
+
+ /**
+ * returns a built MapTest instance.
+ *
+ * The builder is not reusable.
+ */
+ public MapTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static MapTest.Builder builder() {
+ return new MapTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public MapTest.Builder toBuilder() {
+ return new MapTest.Builder()
+ .mapMapOfString(getMapMapOfString())
+ .mapOfEnumString(getMapOfEnumString())
+ .directMap(getDirectMap())
+ .indirectMap(getIndirectMap());
+ }
+
}
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 a27b1a6a124..9985f74172f 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
@@ -236,5 +236,69 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private MixedPropertiesAndAdditionalPropertiesClass instance;
+
+ public Builder() {
+ this(new MixedPropertiesAndAdditionalPropertiesClass());
+ }
+
+ protected Builder(MixedPropertiesAndAdditionalPropertiesClass instance) {
+ this.instance = instance;
+ }
+
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder uuid(UUID uuid) {
+ this.instance.uuid = uuid;
+ return this;
+ }
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder dateTime(OffsetDateTime dateTime) {
+ this.instance.dateTime = dateTime;
+ return this;
+ }
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder map(Map map) {
+ this.instance.map = map;
+ return this;
+ }
+
+
+ /**
+ * returns a built MixedPropertiesAndAdditionalPropertiesClass instance.
+ *
+ * The builder is not reusable.
+ */
+ public MixedPropertiesAndAdditionalPropertiesClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static MixedPropertiesAndAdditionalPropertiesClass.Builder builder() {
+ return new MixedPropertiesAndAdditionalPropertiesClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder toBuilder() {
+ return new MixedPropertiesAndAdditionalPropertiesClass.Builder()
+ .uuid(getUuid())
+ .dateTime(getDateTime())
+ .map(getMap());
+ }
+
}
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 ed0607aff27..ad32c4aba0f 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
@@ -182,5 +182,64 @@ public class Model200Response {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Model200Response instance;
+
+ public Builder() {
+ this(new Model200Response());
+ }
+
+ protected Builder(Model200Response instance) {
+ this.instance = instance;
+ }
+
+ public Model200Response.Builder name(Integer name) {
+ this.instance.name = name;
+ return this;
+ }
+ public Model200Response.Builder propertyClass(String propertyClass) {
+ this.instance.propertyClass = propertyClass;
+ return this;
+ }
+
+
+ /**
+ * returns a built Model200Response instance.
+ *
+ * The builder is not reusable.
+ */
+ public Model200Response build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Model200Response.Builder builder() {
+ return new Model200Response.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Model200Response.Builder toBuilder() {
+ return new Model200Response.Builder()
+ .name(getName())
+ .propertyClass(getPropertyClass());
+ }
+
}
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 33bd2afe5c3..8b0bebfedee 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
@@ -218,5 +218,69 @@ public class ModelApiResponse {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ModelApiResponse instance;
+
+ public Builder() {
+ this(new ModelApiResponse());
+ }
+
+ protected Builder(ModelApiResponse instance) {
+ this.instance = instance;
+ }
+
+ public ModelApiResponse.Builder code(Integer code) {
+ this.instance.code = code;
+ return this;
+ }
+ public ModelApiResponse.Builder type(String type) {
+ this.instance.type = type;
+ return this;
+ }
+ public ModelApiResponse.Builder message(String message) {
+ this.instance.message = message;
+ return this;
+ }
+
+
+ /**
+ * returns a built ModelApiResponse instance.
+ *
+ * The builder is not reusable.
+ */
+ public ModelApiResponse build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ModelApiResponse.Builder builder() {
+ return new ModelApiResponse.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelApiResponse.Builder toBuilder() {
+ return new ModelApiResponse.Builder()
+ .code(getCode())
+ .type(getType())
+ .message(getMessage());
+ }
+
}
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 de7a131ca9c..af900f9924e 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
@@ -146,5 +146,59 @@ public class ModelFile {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ModelFile instance;
+
+ public Builder() {
+ this(new ModelFile());
+ }
+
+ protected Builder(ModelFile instance) {
+ this.instance = instance;
+ }
+
+ public ModelFile.Builder sourceURI(String sourceURI) {
+ this.instance.sourceURI = sourceURI;
+ return this;
+ }
+
+
+ /**
+ * returns a built ModelFile instance.
+ *
+ * The builder is not reusable.
+ */
+ public ModelFile build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ModelFile.Builder builder() {
+ return new ModelFile.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelFile.Builder toBuilder() {
+ return new ModelFile.Builder()
+ .sourceURI(getSourceURI());
+ }
+
}
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 7f76a7e9c43..73cd57459b8 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
@@ -146,5 +146,59 @@ public class ModelList {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ModelList instance;
+
+ public Builder() {
+ this(new ModelList());
+ }
+
+ protected Builder(ModelList instance) {
+ this.instance = instance;
+ }
+
+ public ModelList.Builder _123list(String _123list) {
+ this.instance._123list = _123list;
+ return this;
+ }
+
+
+ /**
+ * returns a built ModelList instance.
+ *
+ * The builder is not reusable.
+ */
+ public ModelList build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ModelList.Builder builder() {
+ return new ModelList.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelList.Builder toBuilder() {
+ return new ModelList.Builder()
+ ._123list(get123list());
+ }
+
}
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 1b6a64318c1..3a0f71e77e6 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
@@ -146,5 +146,59 @@ public class ModelReturn {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ModelReturn instance;
+
+ public Builder() {
+ this(new ModelReturn());
+ }
+
+ protected Builder(ModelReturn instance) {
+ this.instance = instance;
+ }
+
+ public ModelReturn.Builder _return(Integer _return) {
+ this.instance._return = _return;
+ return this;
+ }
+
+
+ /**
+ * returns a built ModelReturn instance.
+ *
+ * The builder is not reusable.
+ */
+ public ModelReturn build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ModelReturn.Builder builder() {
+ return new ModelReturn.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelReturn.Builder toBuilder() {
+ return new ModelReturn.Builder()
+ ._return(getReturn());
+ }
+
}
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 a4a5f038a24..7e76714db86 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
@@ -244,5 +244,74 @@ public class Name {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Name instance;
+
+ public Builder() {
+ this(new Name());
+ }
+
+ protected Builder(Name instance) {
+ this.instance = instance;
+ }
+
+ public Name.Builder name(Integer name) {
+ this.instance.name = name;
+ return this;
+ }
+ public Name.Builder snakeCase(Integer snakeCase) {
+ this.instance.snakeCase = snakeCase;
+ return this;
+ }
+ public Name.Builder property(String property) {
+ this.instance.property = property;
+ return this;
+ }
+ public Name.Builder _123number(Integer _123number) {
+ this.instance._123number = _123number;
+ return this;
+ }
+
+
+ /**
+ * returns a built Name instance.
+ *
+ * The builder is not reusable.
+ */
+ public Name build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Name.Builder builder() {
+ return new Name.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Name.Builder toBuilder() {
+ return new Name.Builder()
+ .name(getName())
+ .snakeCase(getSnakeCase())
+ .property(getProperty())
+ ._123number(get123number());
+ }
+
}
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 3b6121b6bd8..07ca8e7e7bb 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
@@ -783,5 +783,154 @@ public class NullableClass extends HashMap {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private NullableClass instance;
+
+ public Builder() {
+ this(new NullableClass());
+ }
+
+ protected Builder(NullableClass instance) {
+ this.instance = instance;
+ }
+
+ public NullableClass.Builder integerProp(Integer integerProp) {
+ this.instance.integerProp = JsonNullable.of(integerProp);
+ return this;
+ }
+ public NullableClass.Builder integerProp(JsonNullable integerProp) {
+ this.instance.integerProp = integerProp;
+ return this;
+ }
+ public NullableClass.Builder numberProp(BigDecimal numberProp) {
+ this.instance.numberProp = JsonNullable.of(numberProp);
+ return this;
+ }
+ public NullableClass.Builder numberProp(JsonNullable numberProp) {
+ this.instance.numberProp = numberProp;
+ return this;
+ }
+ public NullableClass.Builder booleanProp(Boolean booleanProp) {
+ this.instance.booleanProp = JsonNullable.of(booleanProp);
+ return this;
+ }
+ public NullableClass.Builder booleanProp(JsonNullable booleanProp) {
+ this.instance.booleanProp = booleanProp;
+ return this;
+ }
+ public NullableClass.Builder stringProp(String stringProp) {
+ this.instance.stringProp = JsonNullable.of(stringProp);
+ return this;
+ }
+ public NullableClass.Builder stringProp(JsonNullable stringProp) {
+ this.instance.stringProp = stringProp;
+ return this;
+ }
+ public NullableClass.Builder dateProp(LocalDate dateProp) {
+ this.instance.dateProp = JsonNullable.of(dateProp);
+ return this;
+ }
+ public NullableClass.Builder dateProp(JsonNullable dateProp) {
+ this.instance.dateProp = dateProp;
+ return this;
+ }
+ public NullableClass.Builder datetimeProp(OffsetDateTime datetimeProp) {
+ this.instance.datetimeProp = JsonNullable.of(datetimeProp);
+ return this;
+ }
+ public NullableClass.Builder datetimeProp(JsonNullable datetimeProp) {
+ this.instance.datetimeProp = datetimeProp;
+ return this;
+ }
+ public NullableClass.Builder arrayNullableProp(List arrayNullableProp) {
+ this.instance.arrayNullableProp = JsonNullable.>of(arrayNullableProp);
+ return this;
+ }
+ public NullableClass.Builder arrayNullableProp(JsonNullable> arrayNullableProp) {
+ this.instance.arrayNullableProp = arrayNullableProp;
+ return this;
+ }
+ public NullableClass.Builder arrayAndItemsNullableProp(List arrayAndItemsNullableProp) {
+ this.instance.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp);
+ return this;
+ }
+ public NullableClass.Builder arrayAndItemsNullableProp(JsonNullable> arrayAndItemsNullableProp) {
+ this.instance.arrayAndItemsNullableProp = arrayAndItemsNullableProp;
+ return this;
+ }
+ public NullableClass.Builder arrayItemsNullable(List arrayItemsNullable) {
+ this.instance.arrayItemsNullable = arrayItemsNullable;
+ return this;
+ }
+ public NullableClass.Builder objectNullableProp(Map objectNullableProp) {
+ this.instance.objectNullableProp = JsonNullable.>of(objectNullableProp);
+ return this;
+ }
+ public NullableClass.Builder objectNullableProp(JsonNullable> objectNullableProp) {
+ this.instance.objectNullableProp = objectNullableProp;
+ return this;
+ }
+ public NullableClass.Builder objectAndItemsNullableProp(Map objectAndItemsNullableProp) {
+ this.instance.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp);
+ return this;
+ }
+ public NullableClass.Builder objectAndItemsNullableProp(JsonNullable> objectAndItemsNullableProp) {
+ this.instance.objectAndItemsNullableProp = objectAndItemsNullableProp;
+ return this;
+ }
+ public NullableClass.Builder objectItemsNullable(Map objectItemsNullable) {
+ this.instance.objectItemsNullable = objectItemsNullable;
+ return this;
+ }
+
+
+ /**
+ * returns a built NullableClass instance.
+ *
+ * The builder is not reusable.
+ */
+ public NullableClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static NullableClass.Builder builder() {
+ return new NullableClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public NullableClass.Builder toBuilder() {
+ return new NullableClass.Builder()
+ .integerProp(getIntegerProp())
+ .numberProp(getNumberProp())
+ .booleanProp(getBooleanProp())
+ .stringProp(getStringProp())
+ .dateProp(getDateProp())
+ .datetimeProp(getDatetimeProp())
+ .arrayNullableProp(getArrayNullableProp())
+ .arrayAndItemsNullableProp(getArrayAndItemsNullableProp())
+ .arrayItemsNullable(getArrayItemsNullable())
+ .objectNullableProp(getObjectNullableProp())
+ .objectAndItemsNullableProp(getObjectAndItemsNullableProp())
+ .objectItemsNullable(getObjectItemsNullable());
+ }
+
}
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 dae1f554024..7845866a4f7 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
@@ -147,5 +147,59 @@ public class NumberOnly {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private NumberOnly instance;
+
+ public Builder() {
+ this(new NumberOnly());
+ }
+
+ protected Builder(NumberOnly instance) {
+ this.instance = instance;
+ }
+
+ public NumberOnly.Builder justNumber(BigDecimal justNumber) {
+ this.instance.justNumber = justNumber;
+ return this;
+ }
+
+
+ /**
+ * returns a built NumberOnly instance.
+ *
+ * The builder is not reusable.
+ */
+ public NumberOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static NumberOnly.Builder builder() {
+ return new NumberOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public NumberOnly.Builder toBuilder() {
+ return new NumberOnly.Builder()
+ .justNumber(getJustNumber());
+ }
+
}
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 0b1ce875a71..0e3c6b8729c 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
@@ -276,5 +276,74 @@ public class ObjectWithDeprecatedFields {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ObjectWithDeprecatedFields instance;
+
+ public Builder() {
+ this(new ObjectWithDeprecatedFields());
+ }
+
+ protected Builder(ObjectWithDeprecatedFields instance) {
+ this.instance = instance;
+ }
+
+ public ObjectWithDeprecatedFields.Builder uuid(String uuid) {
+ this.instance.uuid = uuid;
+ return this;
+ }
+ public ObjectWithDeprecatedFields.Builder id(BigDecimal id) {
+ this.instance.id = id;
+ return this;
+ }
+ public ObjectWithDeprecatedFields.Builder deprecatedRef(DeprecatedObject deprecatedRef) {
+ this.instance.deprecatedRef = deprecatedRef;
+ return this;
+ }
+ public ObjectWithDeprecatedFields.Builder bars(List bars) {
+ this.instance.bars = bars;
+ return this;
+ }
+
+
+ /**
+ * returns a built ObjectWithDeprecatedFields instance.
+ *
+ * The builder is not reusable.
+ */
+ public ObjectWithDeprecatedFields build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ObjectWithDeprecatedFields.Builder builder() {
+ return new ObjectWithDeprecatedFields.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ObjectWithDeprecatedFields.Builder toBuilder() {
+ return new ObjectWithDeprecatedFields.Builder()
+ .uuid(getUuid())
+ .id(getId())
+ .deprecatedRef(getDeprecatedRef())
+ .bars(getBars());
+ }
+
}
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 0b4ace24f55..481ba02ea46 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
@@ -364,5 +364,84 @@ public class Order {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Order instance;
+
+ public Builder() {
+ this(new Order());
+ }
+
+ protected Builder(Order instance) {
+ this.instance = instance;
+ }
+
+ public Order.Builder id(Long id) {
+ this.instance.id = id;
+ return this;
+ }
+ public Order.Builder petId(Long petId) {
+ this.instance.petId = petId;
+ return this;
+ }
+ public Order.Builder quantity(Integer quantity) {
+ this.instance.quantity = quantity;
+ return this;
+ }
+ public Order.Builder shipDate(OffsetDateTime shipDate) {
+ this.instance.shipDate = shipDate;
+ return this;
+ }
+ public Order.Builder status(StatusEnum status) {
+ this.instance.status = status;
+ return this;
+ }
+ public Order.Builder complete(Boolean complete) {
+ this.instance.complete = complete;
+ return this;
+ }
+
+
+ /**
+ * returns a built Order instance.
+ *
+ * The builder is not reusable.
+ */
+ public Order build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Order.Builder builder() {
+ return new Order.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Order.Builder toBuilder() {
+ return new Order.Builder()
+ .id(getId())
+ .petId(getPetId())
+ .quantity(getQuantity())
+ .shipDate(getShipDate())
+ .status(getStatus())
+ .complete(getComplete());
+ }
+
}
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 4fb578c5113..53e4a3bc18f 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
@@ -219,5 +219,69 @@ public class OuterComposite {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private OuterComposite instance;
+
+ public Builder() {
+ this(new OuterComposite());
+ }
+
+ protected Builder(OuterComposite instance) {
+ this.instance = instance;
+ }
+
+ public OuterComposite.Builder myNumber(BigDecimal myNumber) {
+ this.instance.myNumber = myNumber;
+ return this;
+ }
+ public OuterComposite.Builder myString(String myString) {
+ this.instance.myString = myString;
+ return this;
+ }
+ public OuterComposite.Builder myBoolean(Boolean myBoolean) {
+ this.instance.myBoolean = myBoolean;
+ return this;
+ }
+
+
+ /**
+ * returns a built OuterComposite instance.
+ *
+ * The builder is not reusable.
+ */
+ public OuterComposite build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static OuterComposite.Builder builder() {
+ return new OuterComposite.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public OuterComposite.Builder toBuilder() {
+ return new OuterComposite.Builder()
+ .myNumber(getMyNumber())
+ .myString(getMyString())
+ .myBoolean(getMyBoolean());
+ }
+
}
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 5763379cc93..f096793c28f 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
@@ -143,5 +143,62 @@ static {
mappings.put("ParentPet", ParentPet.class);
JSON.registerDiscriminator(ParentPet.class, "pet_type", mappings);
}
+
+ public static class Builder extends GrandparentAnimal.Builder {
+
+ private ParentPet instance;
+
+ public Builder() {
+ this(new ParentPet());
+ }
+
+ protected Builder(ParentPet instance) {
+ super(instance);
+ this.instance = instance;
+ }
+
+
+ public ParentPet.Builder petType(String petType) { // inherited: true
+ super.petType(petType);
+ return this;
+ }
+
+
+ /**
+ * returns a built ParentPet instance.
+ *
+ * The builder is not reusable.
+ */
+ public ParentPet build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ParentPet.Builder builder() {
+ return new ParentPet.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ParentPet.Builder toBuilder() {
+ return new ParentPet.Builder()
+ .petType(getPetType());
+ }
+
}
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 e56e1044839..60af4469f14 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
@@ -392,5 +392,84 @@ public class Pet {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Pet instance;
+
+ public Builder() {
+ this(new Pet());
+ }
+
+ protected Builder(Pet instance) {
+ this.instance = instance;
+ }
+
+ public Pet.Builder id(Long id) {
+ this.instance.id = id;
+ return this;
+ }
+ public Pet.Builder category(Category category) {
+ this.instance.category = category;
+ return this;
+ }
+ public Pet.Builder name(String name) {
+ this.instance.name = name;
+ return this;
+ }
+ public Pet.Builder photoUrls(List photoUrls) {
+ this.instance.photoUrls = photoUrls;
+ return this;
+ }
+ public Pet.Builder tags(List tags) {
+ this.instance.tags = tags;
+ return this;
+ }
+ public Pet.Builder status(StatusEnum status) {
+ this.instance.status = status;
+ return this;
+ }
+
+
+ /**
+ * returns a built Pet instance.
+ *
+ * The builder is not reusable.
+ */
+ public Pet build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Pet.Builder builder() {
+ return new Pet.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Pet.Builder toBuilder() {
+ return new Pet.Builder()
+ .id(getId())
+ .category(getCategory())
+ .name(getName())
+ .photoUrls(getPhotoUrls())
+ .tags(getTags())
+ .status(getStatus());
+ }
+
}
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 c7b896ab77f..5a6da2a4797 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
@@ -146,5 +146,59 @@ public class QuadrilateralInterface {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private QuadrilateralInterface instance;
+
+ public Builder() {
+ this(new QuadrilateralInterface());
+ }
+
+ protected Builder(QuadrilateralInterface instance) {
+ this.instance = instance;
+ }
+
+ public QuadrilateralInterface.Builder quadrilateralType(String quadrilateralType) {
+ this.instance.quadrilateralType = quadrilateralType;
+ return this;
+ }
+
+
+ /**
+ * returns a built QuadrilateralInterface instance.
+ *
+ * The builder is not reusable.
+ */
+ public QuadrilateralInterface build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static QuadrilateralInterface.Builder builder() {
+ return new QuadrilateralInterface.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public QuadrilateralInterface.Builder toBuilder() {
+ return new QuadrilateralInterface.Builder()
+ .quadrilateralType(getQuadrilateralType());
+ }
+
}
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 df727d0fe29..67d7bd8aeb4 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
@@ -180,5 +180,64 @@ public class ReadOnlyFirst {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ReadOnlyFirst instance;
+
+ public Builder() {
+ this(new ReadOnlyFirst());
+ }
+
+ protected Builder(ReadOnlyFirst instance) {
+ this.instance = instance;
+ }
+
+ public ReadOnlyFirst.Builder bar(String bar) {
+ this.instance.bar = bar;
+ return this;
+ }
+ public ReadOnlyFirst.Builder baz(String baz) {
+ this.instance.baz = baz;
+ return this;
+ }
+
+
+ /**
+ * returns a built ReadOnlyFirst instance.
+ *
+ * The builder is not reusable.
+ */
+ public ReadOnlyFirst build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ReadOnlyFirst.Builder builder() {
+ return new ReadOnlyFirst.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ReadOnlyFirst.Builder toBuilder() {
+ return new ReadOnlyFirst.Builder()
+ .bar(getBar())
+ .baz(getBaz());
+ }
+
}
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 0ce2388da20..00c4b8c665a 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
@@ -182,5 +182,64 @@ public class ScaleneTriangle {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ScaleneTriangle instance;
+
+ public Builder() {
+ this(new ScaleneTriangle());
+ }
+
+ protected Builder(ScaleneTriangle instance) {
+ this.instance = instance;
+ }
+
+ public ScaleneTriangle.Builder shapeType(String shapeType) {
+ this.instance.shapeType = shapeType;
+ return this;
+ }
+ public ScaleneTriangle.Builder triangleType(String triangleType) {
+ this.instance.triangleType = triangleType;
+ return this;
+ }
+
+
+ /**
+ * returns a built ScaleneTriangle instance.
+ *
+ * The builder is not reusable.
+ */
+ public ScaleneTriangle build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ScaleneTriangle.Builder builder() {
+ return new ScaleneTriangle.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ScaleneTriangle.Builder toBuilder() {
+ return new ScaleneTriangle.Builder()
+ .shapeType(getShapeType())
+ .triangleType(getTriangleType());
+ }
+
}
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 3c14999397b..6107f3b3831 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
@@ -146,5 +146,59 @@ public class ShapeInterface {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private ShapeInterface instance;
+
+ public Builder() {
+ this(new ShapeInterface());
+ }
+
+ protected Builder(ShapeInterface instance) {
+ this.instance = instance;
+ }
+
+ public ShapeInterface.Builder shapeType(String shapeType) {
+ this.instance.shapeType = shapeType;
+ return this;
+ }
+
+
+ /**
+ * returns a built ShapeInterface instance.
+ *
+ * The builder is not reusable.
+ */
+ public ShapeInterface build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ShapeInterface.Builder builder() {
+ return new ShapeInterface.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ShapeInterface.Builder toBuilder() {
+ return new ShapeInterface.Builder()
+ .shapeType(getShapeType());
+ }
+
}
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 2aa9603f9f3..3bb456e24b4 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
@@ -182,5 +182,64 @@ public class SimpleQuadrilateral {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private SimpleQuadrilateral instance;
+
+ public Builder() {
+ this(new SimpleQuadrilateral());
+ }
+
+ protected Builder(SimpleQuadrilateral instance) {
+ this.instance = instance;
+ }
+
+ public SimpleQuadrilateral.Builder shapeType(String shapeType) {
+ this.instance.shapeType = shapeType;
+ return this;
+ }
+ public SimpleQuadrilateral.Builder quadrilateralType(String quadrilateralType) {
+ this.instance.quadrilateralType = quadrilateralType;
+ return this;
+ }
+
+
+ /**
+ * returns a built SimpleQuadrilateral instance.
+ *
+ * The builder is not reusable.
+ */
+ public SimpleQuadrilateral build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static SimpleQuadrilateral.Builder builder() {
+ return new SimpleQuadrilateral.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public SimpleQuadrilateral.Builder toBuilder() {
+ return new SimpleQuadrilateral.Builder()
+ .shapeType(getShapeType())
+ .quadrilateralType(getQuadrilateralType());
+ }
+
}
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 d249b8ebb2a..2dd27290bfb 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
@@ -182,5 +182,64 @@ public class SpecialModelName {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private SpecialModelName instance;
+
+ public Builder() {
+ this(new SpecialModelName());
+ }
+
+ protected Builder(SpecialModelName instance) {
+ this.instance = instance;
+ }
+
+ public SpecialModelName.Builder $specialPropertyName(Long $specialPropertyName) {
+ this.instance.$specialPropertyName = $specialPropertyName;
+ return this;
+ }
+ public SpecialModelName.Builder specialModelName(String specialModelName) {
+ this.instance.specialModelName = specialModelName;
+ return this;
+ }
+
+
+ /**
+ * returns a built SpecialModelName instance.
+ *
+ * The builder is not reusable.
+ */
+ public SpecialModelName build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static SpecialModelName.Builder builder() {
+ return new SpecialModelName.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public SpecialModelName.Builder toBuilder() {
+ return new SpecialModelName.Builder()
+ .$specialPropertyName(get$SpecialPropertyName())
+ .specialModelName(getSpecialModelName());
+ }
+
}
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 69c8b48e751..29b61a1c9a7 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
@@ -182,5 +182,64 @@ public class Tag {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Tag instance;
+
+ public Builder() {
+ this(new Tag());
+ }
+
+ protected Builder(Tag instance) {
+ this.instance = instance;
+ }
+
+ public Tag.Builder id(Long id) {
+ this.instance.id = id;
+ return this;
+ }
+ public Tag.Builder name(String name) {
+ this.instance.name = name;
+ return this;
+ }
+
+
+ /**
+ * returns a built Tag instance.
+ *
+ * The builder is not reusable.
+ */
+ public Tag build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Tag.Builder builder() {
+ return new Tag.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Tag.Builder toBuilder() {
+ return new Tag.Builder()
+ .id(getId())
+ .name(getName());
+ }
+
}
diff --git a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java
index befdf7ccf87..237e99b970d 100644
--- a/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java
+++ b/samples/client/petstore/java/native/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java
@@ -199,5 +199,59 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMapof(objectWithNoDeclaredPropsNullable);
+ return this;
+ }
+ public User.Builder objectWithNoDeclaredPropsNullable(JsonNullable objectWithNoDeclaredPropsNullable) {
+ this.instance.objectWithNoDeclaredPropsNullable = objectWithNoDeclaredPropsNullable;
+ return this;
+ }
+ public User.Builder anyTypeProp(Object anyTypeProp) {
+ this.instance.anyTypeProp = JsonNullable.of(anyTypeProp);
+ return this;
+ }
+ public User.Builder anyTypeProp(JsonNullable anyTypeProp) {
+ this.instance.anyTypeProp = anyTypeProp;
+ return this;
+ }
+ public User.Builder anyTypePropNullable(Object anyTypePropNullable) {
+ this.instance.anyTypePropNullable = JsonNullable.of(anyTypePropNullable);
+ return this;
+ }
+ public User.Builder anyTypePropNullable(JsonNullable anyTypePropNullable) {
+ this.instance.anyTypePropNullable = anyTypePropNullable;
+ return this;
+ }
+
+
+ /**
+ * returns a built User instance.
+ *
+ * The builder is not reusable.
+ */
+ public User build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static User.Builder builder() {
+ return new User.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public User.Builder toBuilder() {
+ return new User.Builder()
+ .id(getId())
+ .username(getUsername())
+ .firstName(getFirstName())
+ .lastName(getLastName())
+ .email(getEmail())
+ .password(getPassword())
+ .phone(getPhone())
+ .userStatus(getUserStatus())
+ .objectWithNoDeclaredProps(getObjectWithNoDeclaredProps())
+ .objectWithNoDeclaredPropsNullable(getObjectWithNoDeclaredPropsNullable())
+ .anyTypeProp(getAnyTypeProp())
+ .anyTypePropNullable(getAnyTypePropNullable());
+ }
+
}
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 8e4c411a161..399cf4520b3 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
@@ -218,5 +218,69 @@ public class Whale {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Whale instance;
+
+ public Builder() {
+ this(new Whale());
+ }
+
+ protected Builder(Whale instance) {
+ this.instance = instance;
+ }
+
+ public Whale.Builder hasBaleen(Boolean hasBaleen) {
+ this.instance.hasBaleen = hasBaleen;
+ return this;
+ }
+ public Whale.Builder hasTeeth(Boolean hasTeeth) {
+ this.instance.hasTeeth = hasTeeth;
+ return this;
+ }
+ public Whale.Builder className(String className) {
+ this.instance.className = className;
+ return this;
+ }
+
+
+ /**
+ * returns a built Whale instance.
+ *
+ * The builder is not reusable.
+ */
+ public Whale build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Whale.Builder builder() {
+ return new Whale.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Whale.Builder toBuilder() {
+ return new Whale.Builder()
+ .hasBaleen(getHasBaleen())
+ .hasTeeth(getHasTeeth())
+ .className(getClassName());
+ }
+
}
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 ead7009c858..5b1b559f28f 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
@@ -272,5 +272,64 @@ public class Zebra extends HashMap {
return joiner.toString();
}
+
+ public static class Builder {
+
+ private Zebra instance;
+
+ public Builder() {
+ this(new Zebra());
+ }
+
+ protected Builder(Zebra instance) {
+ this.instance = instance;
+ }
+
+ public Zebra.Builder type(TypeEnum type) {
+ this.instance.type = type;
+ return this;
+ }
+ public Zebra.Builder className(String className) {
+ this.instance.className = className;
+ return this;
+ }
+
+
+ /**
+ * returns a built Zebra instance.
+ *
+ * The builder is not reusable.
+ */
+ public Zebra build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Zebra.Builder builder() {
+ return new Zebra.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Zebra.Builder toBuilder() {
+ return new Zebra.Builder()
+ .type(getType())
+ .className(getClassName());
+ }
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
index 3d717080f4e..c369a0f2e0a 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AdditionalPropertiesClass.java
@@ -156,5 +156,64 @@ public class AdditionalPropertiesClass {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private AdditionalPropertiesClass instance;
+
+ public Builder() {
+ this(new AdditionalPropertiesClass());
+ }
+
+ protected Builder(AdditionalPropertiesClass instance) {
+ this.instance = instance;
+ }
+
+ public AdditionalPropertiesClass.Builder mapProperty(Map mapProperty) {
+ this.instance.mapProperty = mapProperty;
+ return this;
+ }
+ public AdditionalPropertiesClass.Builder mapOfMapProperty(Map> mapOfMapProperty) {
+ this.instance.mapOfMapProperty = mapOfMapProperty;
+ return this;
+ }
+
+
+ /**
+ * returns a built AdditionalPropertiesClass instance.
+ *
+ * The builder is not reusable.
+ */
+ public AdditionalPropertiesClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static AdditionalPropertiesClass.Builder builder() {
+ return new AdditionalPropertiesClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AdditionalPropertiesClass.Builder toBuilder() {
+ return new AdditionalPropertiesClass.Builder()
+ .mapProperty(getMapProperty())
+ .mapOfMapProperty(getMapOfMapProperty());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java
index 5a77bf23384..35c2e78eeb7 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/AllOfWithSingleRef.java
@@ -139,5 +139,64 @@ public class AllOfWithSingleRef {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private AllOfWithSingleRef instance;
+
+ public Builder() {
+ this(new AllOfWithSingleRef());
+ }
+
+ protected Builder(AllOfWithSingleRef instance) {
+ this.instance = instance;
+ }
+
+ public AllOfWithSingleRef.Builder username(String username) {
+ this.instance.username = username;
+ return this;
+ }
+ public AllOfWithSingleRef.Builder singleRefType(SingleRefType singleRefType) {
+ this.instance.singleRefType = singleRefType;
+ return this;
+ }
+
+
+ /**
+ * returns a built AllOfWithSingleRef instance.
+ *
+ * The builder is not reusable.
+ */
+ public AllOfWithSingleRef build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static AllOfWithSingleRef.Builder builder() {
+ return new AllOfWithSingleRef.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AllOfWithSingleRef.Builder toBuilder() {
+ return new AllOfWithSingleRef.Builder()
+ .username(getUsername())
+ .singleRefType(getSingleRefType());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java
index 6693afeb06f..c444d76130e 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Animal.java
@@ -151,5 +151,64 @@ public class Animal {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private Animal instance;
+
+ public Builder() {
+ this(new Animal());
+ }
+
+ protected Builder(Animal instance) {
+ this.instance = instance;
+ }
+
+ public Animal.Builder className(String className) {
+ this.instance.className = className;
+ return this;
+ }
+ public Animal.Builder color(String color) {
+ this.instance.color = color;
+ return this;
+ }
+
+
+ /**
+ * returns a built Animal instance.
+ *
+ * The builder is not reusable.
+ */
+ public Animal build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Animal.Builder builder() {
+ return new Animal.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Animal.Builder toBuilder() {
+ return new Animal.Builder()
+ .className(getClassName())
+ .color(getColor());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
index b08931a7817..45abfb5c76c 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfArrayOfNumberOnly.java
@@ -118,5 +118,59 @@ public class ArrayOfArrayOfNumberOnly {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ArrayOfArrayOfNumberOnly instance;
+
+ public Builder() {
+ this(new ArrayOfArrayOfNumberOnly());
+ }
+
+ protected Builder(ArrayOfArrayOfNumberOnly instance) {
+ this.instance = instance;
+ }
+
+ public ArrayOfArrayOfNumberOnly.Builder arrayArrayNumber(List> arrayArrayNumber) {
+ this.instance.arrayArrayNumber = arrayArrayNumber;
+ return this;
+ }
+
+
+ /**
+ * returns a built ArrayOfArrayOfNumberOnly instance.
+ *
+ * The builder is not reusable.
+ */
+ public ArrayOfArrayOfNumberOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ArrayOfArrayOfNumberOnly.Builder builder() {
+ return new ArrayOfArrayOfNumberOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ArrayOfArrayOfNumberOnly.Builder toBuilder() {
+ return new ArrayOfArrayOfNumberOnly.Builder()
+ .arrayArrayNumber(getArrayArrayNumber());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java
index e3c28990a87..fff46bca0b7 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayOfNumberOnly.java
@@ -118,5 +118,59 @@ public class ArrayOfNumberOnly {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ArrayOfNumberOnly instance;
+
+ public Builder() {
+ this(new ArrayOfNumberOnly());
+ }
+
+ protected Builder(ArrayOfNumberOnly instance) {
+ this.instance = instance;
+ }
+
+ public ArrayOfNumberOnly.Builder arrayNumber(List arrayNumber) {
+ this.instance.arrayNumber = arrayNumber;
+ return this;
+ }
+
+
+ /**
+ * returns a built ArrayOfNumberOnly instance.
+ *
+ * The builder is not reusable.
+ */
+ public ArrayOfNumberOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ArrayOfNumberOnly.Builder builder() {
+ return new ArrayOfNumberOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ArrayOfNumberOnly.Builder toBuilder() {
+ return new ArrayOfNumberOnly.Builder()
+ .arrayNumber(getArrayNumber());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java
index 94c3e22c304..9cdf71c6e69 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ArrayTest.java
@@ -198,5 +198,69 @@ public class ArrayTest {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ArrayTest instance;
+
+ public Builder() {
+ this(new ArrayTest());
+ }
+
+ protected Builder(ArrayTest instance) {
+ this.instance = instance;
+ }
+
+ public ArrayTest.Builder arrayOfString(List arrayOfString) {
+ this.instance.arrayOfString = arrayOfString;
+ return this;
+ }
+ public ArrayTest.Builder arrayArrayOfInteger(List> arrayArrayOfInteger) {
+ this.instance.arrayArrayOfInteger = arrayArrayOfInteger;
+ return this;
+ }
+ public ArrayTest.Builder arrayArrayOfModel(List> arrayArrayOfModel) {
+ this.instance.arrayArrayOfModel = arrayArrayOfModel;
+ return this;
+ }
+
+
+ /**
+ * returns a built ArrayTest instance.
+ *
+ * The builder is not reusable.
+ */
+ public ArrayTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ArrayTest.Builder builder() {
+ return new ArrayTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ArrayTest.Builder toBuilder() {
+ return new ArrayTest.Builder()
+ .arrayOfString(getArrayOfString())
+ .arrayArrayOfInteger(getArrayArrayOfInteger())
+ .arrayArrayOfModel(getArrayArrayOfModel());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java
index 2153176018b..2ba31cef7d3 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Capitalization.java
@@ -266,5 +266,84 @@ public class Capitalization {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private Capitalization instance;
+
+ public Builder() {
+ this(new Capitalization());
+ }
+
+ protected Builder(Capitalization instance) {
+ this.instance = instance;
+ }
+
+ public Capitalization.Builder smallCamel(String smallCamel) {
+ this.instance.smallCamel = smallCamel;
+ return this;
+ }
+ public Capitalization.Builder capitalCamel(String capitalCamel) {
+ this.instance.capitalCamel = capitalCamel;
+ return this;
+ }
+ public Capitalization.Builder smallSnake(String smallSnake) {
+ this.instance.smallSnake = smallSnake;
+ return this;
+ }
+ public Capitalization.Builder capitalSnake(String capitalSnake) {
+ this.instance.capitalSnake = capitalSnake;
+ return this;
+ }
+ public Capitalization.Builder scAETHFlowPoints(String scAETHFlowPoints) {
+ this.instance.scAETHFlowPoints = scAETHFlowPoints;
+ return this;
+ }
+ public Capitalization.Builder ATT_NAME(String ATT_NAME) {
+ this.instance.ATT_NAME = ATT_NAME;
+ return this;
+ }
+
+
+ /**
+ * returns a built Capitalization instance.
+ *
+ * The builder is not reusable.
+ */
+ public Capitalization build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Capitalization.Builder builder() {
+ return new Capitalization.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Capitalization.Builder toBuilder() {
+ return new Capitalization.Builder()
+ .smallCamel(getSmallCamel())
+ .capitalCamel(getCapitalCamel())
+ .smallSnake(getSmallSnake())
+ .capitalSnake(getCapitalSnake())
+ .scAETHFlowPoints(getScAETHFlowPoints())
+ .ATT_NAME(getATTNAME());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java
index 2332f820a37..977a2f47eb4 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Cat.java
@@ -132,5 +132,73 @@ public class Cat extends Animal {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder extends Animal.Builder {
+
+ private Cat instance;
+
+ public Builder() {
+ this(new Cat());
+ }
+
+ protected Builder(Cat instance) {
+ super(instance);
+ this.instance = instance;
+ }
+
+ public Cat.Builder declawed(Boolean declawed) {
+ this.instance.declawed = declawed;
+ return this;
+ }
+
+ public Cat.Builder className(String className) { // inherited: true
+ super.className(className);
+ return this;
+ }
+
+ public Cat.Builder color(String color) { // inherited: true
+ super.color(color);
+ return this;
+ }
+
+
+ /**
+ * returns a built Cat instance.
+ *
+ * The builder is not reusable.
+ */
+ public Cat build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Cat.Builder builder() {
+ return new Cat.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Cat.Builder toBuilder() {
+ return new Cat.Builder()
+ .className(getClassName())
+ .color(getColor())
+ .declawed(getDeclawed());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java
index db90b22d2cc..ca18702c2cf 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Category.java
@@ -138,5 +138,64 @@ public class Category {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private Category instance;
+
+ public Builder() {
+ this(new Category());
+ }
+
+ protected Builder(Category instance) {
+ this.instance = instance;
+ }
+
+ public Category.Builder id(Long id) {
+ this.instance.id = id;
+ return this;
+ }
+ public Category.Builder name(String name) {
+ this.instance.name = name;
+ return this;
+ }
+
+
+ /**
+ * returns a built Category instance.
+ *
+ * The builder is not reusable.
+ */
+ public Category build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Category.Builder builder() {
+ return new Category.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Category.Builder toBuilder() {
+ return new Category.Builder()
+ .id(getId())
+ .name(getName());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java
index 0fcfd2e82bf..70ea145ffcb 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ChildWithNullable.java
@@ -144,5 +144,77 @@ public class ChildWithNullable extends ParentWithNullable {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder extends ParentWithNullable.Builder {
+
+ private ChildWithNullable instance;
+
+ public Builder() {
+ this(new ChildWithNullable());
+ }
+
+ protected Builder(ChildWithNullable instance) {
+ super(instance);
+ this.instance = instance;
+ }
+
+ public ChildWithNullable.Builder otherProperty(String otherProperty) {
+ this.instance.otherProperty = otherProperty;
+ return this;
+ }
+
+ public ChildWithNullable.Builder type(TypeEnum type) { // inherited: true
+ super.type(type);
+ return this;
+ }
+
+ public ChildWithNullable.Builder nullableProperty(String nullableProperty) { // inherited: true
+ super.nullableProperty(nullableProperty);
+ return this;
+ }
+ public ChildWithNullable.Builder nullableProperty(JsonNullable nullableProperty) {
+ this.instance.nullableProperty = nullableProperty;
+ return this;
+ }
+
+
+ /**
+ * returns a built ChildWithNullable instance.
+ *
+ * The builder is not reusable.
+ */
+ public ChildWithNullable build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ChildWithNullable.Builder builder() {
+ return new ChildWithNullable.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ChildWithNullable.Builder toBuilder() {
+ return new ChildWithNullable.Builder()
+ .type(getType())
+ .nullableProperty(getNullableProperty())
+ .otherProperty(getOtherProperty());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java
index 6bb5958e9b4..450a4b006b5 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ClassModel.java
@@ -106,5 +106,59 @@ public class ClassModel {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ClassModel instance;
+
+ public Builder() {
+ this(new ClassModel());
+ }
+
+ protected Builder(ClassModel instance) {
+ this.instance = instance;
+ }
+
+ public ClassModel.Builder propertyClass(String propertyClass) {
+ this.instance.propertyClass = propertyClass;
+ return this;
+ }
+
+
+ /**
+ * returns a built ClassModel instance.
+ *
+ * The builder is not reusable.
+ */
+ public ClassModel build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ClassModel.Builder builder() {
+ return new ClassModel.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ClassModel.Builder toBuilder() {
+ return new ClassModel.Builder()
+ .propertyClass(getPropertyClass());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java
index 7c6b6d4c799..4a576df513d 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Client.java
@@ -106,5 +106,59 @@ public class Client {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private Client instance;
+
+ public Builder() {
+ this(new Client());
+ }
+
+ protected Builder(Client instance) {
+ this.instance = instance;
+ }
+
+ public Client.Builder client(String client) {
+ this.instance.client = client;
+ return this;
+ }
+
+
+ /**
+ * returns a built Client instance.
+ *
+ * The builder is not reusable.
+ */
+ public Client build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Client.Builder builder() {
+ return new Client.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Client.Builder toBuilder() {
+ return new Client.Builder()
+ .client(getClient());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java
index 196f0c5340c..1e3733259f9 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/DeprecatedObject.java
@@ -108,5 +108,59 @@ public class DeprecatedObject {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private DeprecatedObject instance;
+
+ public Builder() {
+ this(new DeprecatedObject());
+ }
+
+ protected Builder(DeprecatedObject instance) {
+ this.instance = instance;
+ }
+
+ public DeprecatedObject.Builder name(String name) {
+ this.instance.name = name;
+ return this;
+ }
+
+
+ /**
+ * returns a built DeprecatedObject instance.
+ *
+ * The builder is not reusable.
+ */
+ public DeprecatedObject build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static DeprecatedObject.Builder builder() {
+ return new DeprecatedObject.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public DeprecatedObject.Builder toBuilder() {
+ return new DeprecatedObject.Builder()
+ .name(getName());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java
index e3f7dd0a02c..6e19d24e25e 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Dog.java
@@ -132,5 +132,73 @@ public class Dog extends Animal {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder extends Animal.Builder {
+
+ private Dog instance;
+
+ public Builder() {
+ this(new Dog());
+ }
+
+ protected Builder(Dog instance) {
+ super(instance);
+ this.instance = instance;
+ }
+
+ public Dog.Builder breed(String breed) {
+ this.instance.breed = breed;
+ return this;
+ }
+
+ public Dog.Builder className(String className) { // inherited: true
+ super.className(className);
+ return this;
+ }
+
+ public Dog.Builder color(String color) { // inherited: true
+ super.color(color);
+ return this;
+ }
+
+
+ /**
+ * returns a built Dog instance.
+ *
+ * The builder is not reusable.
+ */
+ public Dog build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Dog.Builder builder() {
+ return new Dog.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Dog.Builder toBuilder() {
+ return new Dog.Builder()
+ .className(getClassName())
+ .color(getColor())
+ .breed(getBreed());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java
index 8c0470467c6..2d4c6b8a979 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumArrays.java
@@ -219,5 +219,64 @@ public class EnumArrays {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private EnumArrays instance;
+
+ public Builder() {
+ this(new EnumArrays());
+ }
+
+ protected Builder(EnumArrays instance) {
+ this.instance = instance;
+ }
+
+ public EnumArrays.Builder justSymbol(JustSymbolEnum justSymbol) {
+ this.instance.justSymbol = justSymbol;
+ return this;
+ }
+ public EnumArrays.Builder arrayEnum(List arrayEnum) {
+ this.instance.arrayEnum = arrayEnum;
+ return this;
+ }
+
+
+ /**
+ * returns a built EnumArrays instance.
+ *
+ * The builder is not reusable.
+ */
+ public EnumArrays build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static EnumArrays.Builder builder() {
+ return new EnumArrays.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public EnumArrays.Builder toBuilder() {
+ return new EnumArrays.Builder()
+ .justSymbol(getJustSymbol())
+ .arrayEnum(getArrayEnum());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java
index fda5fa5b6b6..add6575e0a9 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/EnumTest.java
@@ -502,5 +502,98 @@ public class EnumTest {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private EnumTest instance;
+
+ public Builder() {
+ this(new EnumTest());
+ }
+
+ protected Builder(EnumTest instance) {
+ this.instance = instance;
+ }
+
+ public EnumTest.Builder enumString(EnumStringEnum enumString) {
+ this.instance.enumString = enumString;
+ return this;
+ }
+ public EnumTest.Builder enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
+ this.instance.enumStringRequired = enumStringRequired;
+ return this;
+ }
+ public EnumTest.Builder enumInteger(EnumIntegerEnum enumInteger) {
+ this.instance.enumInteger = enumInteger;
+ return this;
+ }
+ public EnumTest.Builder enumNumber(EnumNumberEnum enumNumber) {
+ this.instance.enumNumber = enumNumber;
+ return this;
+ }
+ public EnumTest.Builder outerEnum(OuterEnum outerEnum) {
+ this.instance.outerEnum = JsonNullable.of(outerEnum);
+ return this;
+ }
+ public EnumTest.Builder outerEnum(JsonNullable outerEnum) {
+ this.instance.outerEnum = outerEnum;
+ return this;
+ }
+ public EnumTest.Builder outerEnumInteger(OuterEnumInteger outerEnumInteger) {
+ this.instance.outerEnumInteger = outerEnumInteger;
+ return this;
+ }
+ public EnumTest.Builder outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) {
+ this.instance.outerEnumDefaultValue = outerEnumDefaultValue;
+ return this;
+ }
+ public EnumTest.Builder outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) {
+ this.instance.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;
+ return this;
+ }
+
+
+ /**
+ * returns a built EnumTest instance.
+ *
+ * The builder is not reusable.
+ */
+ public EnumTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static EnumTest.Builder builder() {
+ return new EnumTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public EnumTest.Builder toBuilder() {
+ return new EnumTest.Builder()
+ .enumString(getEnumString())
+ .enumStringRequired(getEnumStringRequired())
+ .enumInteger(getEnumInteger())
+ .enumNumber(getEnumNumber())
+ .outerEnum(getOuterEnum())
+ .outerEnumInteger(getOuterEnumInteger())
+ .outerEnumDefaultValue(getOuterEnumDefaultValue())
+ .outerEnumIntegerDefaultValue(getOuterEnumIntegerDefaultValue());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
index 45ff11851c9..4af66beca82 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FakeBigDecimalMap200Response.java
@@ -150,5 +150,64 @@ public class FakeBigDecimalMap200Response {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private FakeBigDecimalMap200Response instance;
+
+ public Builder() {
+ this(new FakeBigDecimalMap200Response());
+ }
+
+ protected Builder(FakeBigDecimalMap200Response instance) {
+ this.instance = instance;
+ }
+
+ public FakeBigDecimalMap200Response.Builder someId(BigDecimal someId) {
+ this.instance.someId = someId;
+ return this;
+ }
+ public FakeBigDecimalMap200Response.Builder someMap(Map someMap) {
+ this.instance.someMap = someMap;
+ return this;
+ }
+
+
+ /**
+ * returns a built FakeBigDecimalMap200Response instance.
+ *
+ * The builder is not reusable.
+ */
+ public FakeBigDecimalMap200Response build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static FakeBigDecimalMap200Response.Builder builder() {
+ return new FakeBigDecimalMap200Response.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FakeBigDecimalMap200Response.Builder toBuilder() {
+ return new FakeBigDecimalMap200Response.Builder()
+ .someId(getSomeId())
+ .someMap(getSomeMap());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
index aa09b8c4383..544a958564b 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FileSchemaTestClass.java
@@ -150,5 +150,64 @@ public class FileSchemaTestClass {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private FileSchemaTestClass instance;
+
+ public Builder() {
+ this(new FileSchemaTestClass());
+ }
+
+ protected Builder(FileSchemaTestClass instance) {
+ this.instance = instance;
+ }
+
+ public FileSchemaTestClass.Builder _file(ModelFile _file) {
+ this.instance._file = _file;
+ return this;
+ }
+ public FileSchemaTestClass.Builder files(List files) {
+ this.instance.files = files;
+ return this;
+ }
+
+
+ /**
+ * returns a built FileSchemaTestClass instance.
+ *
+ * The builder is not reusable.
+ */
+ public FileSchemaTestClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static FileSchemaTestClass.Builder builder() {
+ return new FileSchemaTestClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FileSchemaTestClass.Builder toBuilder() {
+ return new FileSchemaTestClass.Builder()
+ ._file(getFile())
+ .files(getFiles());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java
index 52baa4bbfd9..fe2af3988ee 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Foo.java
@@ -106,5 +106,59 @@ public class Foo {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private Foo instance;
+
+ public Builder() {
+ this(new Foo());
+ }
+
+ protected Builder(Foo instance) {
+ this.instance = instance;
+ }
+
+ public Foo.Builder bar(String bar) {
+ this.instance.bar = bar;
+ return this;
+ }
+
+
+ /**
+ * returns a built Foo instance.
+ *
+ * The builder is not reusable.
+ */
+ public Foo build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Foo.Builder builder() {
+ return new Foo.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Foo.Builder toBuilder() {
+ return new Foo.Builder()
+ .bar(getBar());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java
index 2b266cae697..70a12d6c7e0 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FooGetDefaultResponse.java
@@ -108,5 +108,59 @@ public class FooGetDefaultResponse {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private FooGetDefaultResponse instance;
+
+ public Builder() {
+ this(new FooGetDefaultResponse());
+ }
+
+ protected Builder(FooGetDefaultResponse instance) {
+ this.instance = instance;
+ }
+
+ public FooGetDefaultResponse.Builder string(Foo string) {
+ this.instance.string = string;
+ return this;
+ }
+
+
+ /**
+ * returns a built FooGetDefaultResponse instance.
+ *
+ * The builder is not reusable.
+ */
+ public FooGetDefaultResponse build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static FooGetDefaultResponse.Builder builder() {
+ return new FooGetDefaultResponse.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FooGetDefaultResponse.Builder toBuilder() {
+ return new FooGetDefaultResponse.Builder()
+ .string(getString());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java
index b1a8b4f2628..5ff76a8a9cc 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/FormatTest.java
@@ -602,5 +602,134 @@ public class FormatTest {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private FormatTest instance;
+
+ public Builder() {
+ this(new FormatTest());
+ }
+
+ protected Builder(FormatTest instance) {
+ this.instance = instance;
+ }
+
+ public FormatTest.Builder integer(Integer integer) {
+ this.instance.integer = integer;
+ return this;
+ }
+ public FormatTest.Builder int32(Integer int32) {
+ this.instance.int32 = int32;
+ return this;
+ }
+ public FormatTest.Builder int64(Long int64) {
+ this.instance.int64 = int64;
+ return this;
+ }
+ public FormatTest.Builder number(BigDecimal number) {
+ this.instance.number = number;
+ return this;
+ }
+ public FormatTest.Builder _float(Float _float) {
+ this.instance._float = _float;
+ return this;
+ }
+ public FormatTest.Builder _double(Double _double) {
+ this.instance._double = _double;
+ return this;
+ }
+ public FormatTest.Builder decimal(BigDecimal decimal) {
+ this.instance.decimal = decimal;
+ return this;
+ }
+ public FormatTest.Builder string(String string) {
+ this.instance.string = string;
+ return this;
+ }
+ public FormatTest.Builder _byte(byte[] _byte) {
+ this.instance._byte = _byte;
+ return this;
+ }
+ public FormatTest.Builder binary(File binary) {
+ this.instance.binary = binary;
+ return this;
+ }
+ public FormatTest.Builder date(LocalDate date) {
+ this.instance.date = date;
+ return this;
+ }
+ public FormatTest.Builder dateTime(OffsetDateTime dateTime) {
+ this.instance.dateTime = dateTime;
+ return this;
+ }
+ public FormatTest.Builder uuid(UUID uuid) {
+ this.instance.uuid = uuid;
+ return this;
+ }
+ public FormatTest.Builder password(String password) {
+ this.instance.password = password;
+ return this;
+ }
+ public FormatTest.Builder patternWithDigits(String patternWithDigits) {
+ this.instance.patternWithDigits = patternWithDigits;
+ return this;
+ }
+ public FormatTest.Builder patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) {
+ this.instance.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;
+ return this;
+ }
+
+
+ /**
+ * returns a built FormatTest instance.
+ *
+ * The builder is not reusable.
+ */
+ public FormatTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static FormatTest.Builder builder() {
+ return new FormatTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FormatTest.Builder toBuilder() {
+ return new FormatTest.Builder()
+ .integer(getInteger())
+ .int32(getInt32())
+ .int64(getInt64())
+ .number(getNumber())
+ ._float(getFloat())
+ ._double(getDouble())
+ .decimal(getDecimal())
+ .string(getString())
+ ._byte(getByte())
+ .binary(getBinary())
+ .date(getDate())
+ .dateTime(getDateTime())
+ .uuid(getUuid())
+ .password(getPassword())
+ .patternWithDigits(getPatternWithDigits())
+ .patternWithDigitsAndDelimiter(getPatternWithDigitsAndDelimiter());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
index 382c30d1bb7..2814acc8062 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HasOnlyReadOnly.java
@@ -121,5 +121,64 @@ public class HasOnlyReadOnly {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private HasOnlyReadOnly instance;
+
+ public Builder() {
+ this(new HasOnlyReadOnly());
+ }
+
+ protected Builder(HasOnlyReadOnly instance) {
+ this.instance = instance;
+ }
+
+ public HasOnlyReadOnly.Builder bar(String bar) {
+ this.instance.bar = bar;
+ return this;
+ }
+ public HasOnlyReadOnly.Builder foo(String foo) {
+ this.instance.foo = foo;
+ return this;
+ }
+
+
+ /**
+ * returns a built HasOnlyReadOnly instance.
+ *
+ * The builder is not reusable.
+ */
+ public HasOnlyReadOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static HasOnlyReadOnly.Builder builder() {
+ return new HasOnlyReadOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public HasOnlyReadOnly.Builder toBuilder() {
+ return new HasOnlyReadOnly.Builder()
+ .bar(getBar())
+ .foo(getFoo());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java
index 9047d758d17..719dcb90370 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/HealthCheckResult.java
@@ -129,5 +129,63 @@ public class HealthCheckResult {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private HealthCheckResult instance;
+
+ public Builder() {
+ this(new HealthCheckResult());
+ }
+
+ protected Builder(HealthCheckResult instance) {
+ this.instance = instance;
+ }
+
+ public HealthCheckResult.Builder nullableMessage(String nullableMessage) {
+ this.instance.nullableMessage = JsonNullable.of(nullableMessage);
+ return this;
+ }
+ public HealthCheckResult.Builder nullableMessage(JsonNullable nullableMessage) {
+ this.instance.nullableMessage = nullableMessage;
+ return this;
+ }
+
+
+ /**
+ * returns a built HealthCheckResult instance.
+ *
+ * The builder is not reusable.
+ */
+ public HealthCheckResult build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static HealthCheckResult.Builder builder() {
+ return new HealthCheckResult.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public HealthCheckResult.Builder toBuilder() {
+ return new HealthCheckResult.Builder()
+ .nullableMessage(getNullableMessage());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java
index 1520c3cb11f..32c53753713 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MapTest.java
@@ -271,5 +271,74 @@ public class MapTest {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private MapTest instance;
+
+ public Builder() {
+ this(new MapTest());
+ }
+
+ protected Builder(MapTest instance) {
+ this.instance = instance;
+ }
+
+ public MapTest.Builder mapMapOfString(Map> mapMapOfString) {
+ this.instance.mapMapOfString = mapMapOfString;
+ return this;
+ }
+ public MapTest.Builder mapOfEnumString(Map mapOfEnumString) {
+ this.instance.mapOfEnumString = mapOfEnumString;
+ return this;
+ }
+ public MapTest.Builder directMap(Map directMap) {
+ this.instance.directMap = directMap;
+ return this;
+ }
+ public MapTest.Builder indirectMap(Map indirectMap) {
+ this.instance.indirectMap = indirectMap;
+ return this;
+ }
+
+
+ /**
+ * returns a built MapTest instance.
+ *
+ * The builder is not reusable.
+ */
+ public MapTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static MapTest.Builder builder() {
+ return new MapTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public MapTest.Builder toBuilder() {
+ return new MapTest.Builder()
+ .mapMapOfString(getMapMapOfString())
+ .mapOfEnumString(getMapOfEnumString())
+ .directMap(getDirectMap())
+ .indirectMap(getIndirectMap());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
index 2b0ba18327b..effd02165bd 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/MixedPropertiesAndAdditionalPropertiesClass.java
@@ -183,5 +183,69 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private MixedPropertiesAndAdditionalPropertiesClass instance;
+
+ public Builder() {
+ this(new MixedPropertiesAndAdditionalPropertiesClass());
+ }
+
+ protected Builder(MixedPropertiesAndAdditionalPropertiesClass instance) {
+ this.instance = instance;
+ }
+
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder uuid(UUID uuid) {
+ this.instance.uuid = uuid;
+ return this;
+ }
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder dateTime(OffsetDateTime dateTime) {
+ this.instance.dateTime = dateTime;
+ return this;
+ }
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder map(Map map) {
+ this.instance.map = map;
+ return this;
+ }
+
+
+ /**
+ * returns a built MixedPropertiesAndAdditionalPropertiesClass instance.
+ *
+ * The builder is not reusable.
+ */
+ public MixedPropertiesAndAdditionalPropertiesClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static MixedPropertiesAndAdditionalPropertiesClass.Builder builder() {
+ return new MixedPropertiesAndAdditionalPropertiesClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder toBuilder() {
+ return new MixedPropertiesAndAdditionalPropertiesClass.Builder()
+ .uuid(getUuid())
+ .dateTime(getDateTime())
+ .map(getMap());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java
index a514d303f20..d2b87a8bd04 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Model200Response.java
@@ -139,5 +139,64 @@ public class Model200Response {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private Model200Response instance;
+
+ public Builder() {
+ this(new Model200Response());
+ }
+
+ protected Builder(Model200Response instance) {
+ this.instance = instance;
+ }
+
+ public Model200Response.Builder name(Integer name) {
+ this.instance.name = name;
+ return this;
+ }
+ public Model200Response.Builder propertyClass(String propertyClass) {
+ this.instance.propertyClass = propertyClass;
+ return this;
+ }
+
+
+ /**
+ * returns a built Model200Response instance.
+ *
+ * The builder is not reusable.
+ */
+ public Model200Response build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Model200Response.Builder builder() {
+ return new Model200Response.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Model200Response.Builder toBuilder() {
+ return new Model200Response.Builder()
+ .name(getName())
+ .propertyClass(getPropertyClass());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java
index 94bb9257d59..1c4a06aac6e 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelApiResponse.java
@@ -171,5 +171,69 @@ public class ModelApiResponse {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ModelApiResponse instance;
+
+ public Builder() {
+ this(new ModelApiResponse());
+ }
+
+ protected Builder(ModelApiResponse instance) {
+ this.instance = instance;
+ }
+
+ public ModelApiResponse.Builder code(Integer code) {
+ this.instance.code = code;
+ return this;
+ }
+ public ModelApiResponse.Builder type(String type) {
+ this.instance.type = type;
+ return this;
+ }
+ public ModelApiResponse.Builder message(String message) {
+ this.instance.message = message;
+ return this;
+ }
+
+
+ /**
+ * returns a built ModelApiResponse instance.
+ *
+ * The builder is not reusable.
+ */
+ public ModelApiResponse build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ModelApiResponse.Builder builder() {
+ return new ModelApiResponse.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelApiResponse.Builder toBuilder() {
+ return new ModelApiResponse.Builder()
+ .code(getCode())
+ .type(getType())
+ .message(getMessage());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java
index 8bb3ebde92f..5a883db176f 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelFile.java
@@ -107,5 +107,59 @@ public class ModelFile {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ModelFile instance;
+
+ public Builder() {
+ this(new ModelFile());
+ }
+
+ protected Builder(ModelFile instance) {
+ this.instance = instance;
+ }
+
+ public ModelFile.Builder sourceURI(String sourceURI) {
+ this.instance.sourceURI = sourceURI;
+ return this;
+ }
+
+
+ /**
+ * returns a built ModelFile instance.
+ *
+ * The builder is not reusable.
+ */
+ public ModelFile build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ModelFile.Builder builder() {
+ return new ModelFile.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelFile.Builder toBuilder() {
+ return new ModelFile.Builder()
+ .sourceURI(getSourceURI());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java
index 1793d6b4eb3..18cb020faf5 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelList.java
@@ -107,5 +107,59 @@ public class ModelList {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ModelList instance;
+
+ public Builder() {
+ this(new ModelList());
+ }
+
+ protected Builder(ModelList instance) {
+ this.instance = instance;
+ }
+
+ public ModelList.Builder _123list(String _123list) {
+ this.instance._123list = _123list;
+ return this;
+ }
+
+
+ /**
+ * returns a built ModelList instance.
+ *
+ * The builder is not reusable.
+ */
+ public ModelList build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ModelList.Builder builder() {
+ return new ModelList.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelList.Builder toBuilder() {
+ return new ModelList.Builder()
+ ._123list(get123list());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java
index 4d9c567ff4f..94b36fa79f6 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ModelReturn.java
@@ -107,5 +107,59 @@ public class ModelReturn {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ModelReturn instance;
+
+ public Builder() {
+ this(new ModelReturn());
+ }
+
+ protected Builder(ModelReturn instance) {
+ this.instance = instance;
+ }
+
+ public ModelReturn.Builder _return(Integer _return) {
+ this.instance._return = _return;
+ return this;
+ }
+
+
+ /**
+ * returns a built ModelReturn instance.
+ *
+ * The builder is not reusable.
+ */
+ public ModelReturn build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ModelReturn.Builder builder() {
+ return new ModelReturn.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelReturn.Builder toBuilder() {
+ return new ModelReturn.Builder()
+ ._return(getReturn());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java
index db440c74d54..eb859086d4b 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Name.java
@@ -192,5 +192,74 @@ public class Name {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private Name instance;
+
+ public Builder() {
+ this(new Name());
+ }
+
+ protected Builder(Name instance) {
+ this.instance = instance;
+ }
+
+ public Name.Builder name(Integer name) {
+ this.instance.name = name;
+ return this;
+ }
+ public Name.Builder snakeCase(Integer snakeCase) {
+ this.instance.snakeCase = snakeCase;
+ return this;
+ }
+ public Name.Builder property(String property) {
+ this.instance.property = property;
+ return this;
+ }
+ public Name.Builder _123number(Integer _123number) {
+ this.instance._123number = _123number;
+ return this;
+ }
+
+
+ /**
+ * returns a built Name instance.
+ *
+ * The builder is not reusable.
+ */
+ public Name build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Name.Builder builder() {
+ return new Name.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Name.Builder toBuilder() {
+ return new Name.Builder()
+ .name(getName())
+ .snakeCase(getSnakeCase())
+ .property(getProperty())
+ ._123number(get123number());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java
index 6078cbcdff5..b76b998b4dd 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NullableClass.java
@@ -629,5 +629,154 @@ public class NullableClass extends HashMap {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private NullableClass instance;
+
+ public Builder() {
+ this(new NullableClass());
+ }
+
+ protected Builder(NullableClass instance) {
+ this.instance = instance;
+ }
+
+ public NullableClass.Builder integerProp(Integer integerProp) {
+ this.instance.integerProp = JsonNullable.of(integerProp);
+ return this;
+ }
+ public NullableClass.Builder integerProp(JsonNullable integerProp) {
+ this.instance.integerProp = integerProp;
+ return this;
+ }
+ public NullableClass.Builder numberProp(BigDecimal numberProp) {
+ this.instance.numberProp = JsonNullable.of(numberProp);
+ return this;
+ }
+ public NullableClass.Builder numberProp(JsonNullable numberProp) {
+ this.instance.numberProp = numberProp;
+ return this;
+ }
+ public NullableClass.Builder booleanProp(Boolean booleanProp) {
+ this.instance.booleanProp = JsonNullable.of(booleanProp);
+ return this;
+ }
+ public NullableClass.Builder booleanProp(JsonNullable booleanProp) {
+ this.instance.booleanProp = booleanProp;
+ return this;
+ }
+ public NullableClass.Builder stringProp(String stringProp) {
+ this.instance.stringProp = JsonNullable.of(stringProp);
+ return this;
+ }
+ public NullableClass.Builder stringProp(JsonNullable stringProp) {
+ this.instance.stringProp = stringProp;
+ return this;
+ }
+ public NullableClass.Builder dateProp(LocalDate dateProp) {
+ this.instance.dateProp = JsonNullable.of(dateProp);
+ return this;
+ }
+ public NullableClass.Builder dateProp(JsonNullable dateProp) {
+ this.instance.dateProp = dateProp;
+ return this;
+ }
+ public NullableClass.Builder datetimeProp(OffsetDateTime datetimeProp) {
+ this.instance.datetimeProp = JsonNullable.of(datetimeProp);
+ return this;
+ }
+ public NullableClass.Builder datetimeProp(JsonNullable datetimeProp) {
+ this.instance.datetimeProp = datetimeProp;
+ return this;
+ }
+ public NullableClass.Builder arrayNullableProp(List arrayNullableProp) {
+ this.instance.arrayNullableProp = JsonNullable.>of(arrayNullableProp);
+ return this;
+ }
+ public NullableClass.Builder arrayNullableProp(JsonNullable> arrayNullableProp) {
+ this.instance.arrayNullableProp = arrayNullableProp;
+ return this;
+ }
+ public NullableClass.Builder arrayAndItemsNullableProp(List arrayAndItemsNullableProp) {
+ this.instance.arrayAndItemsNullableProp = JsonNullable.>of(arrayAndItemsNullableProp);
+ return this;
+ }
+ public NullableClass.Builder arrayAndItemsNullableProp(JsonNullable> arrayAndItemsNullableProp) {
+ this.instance.arrayAndItemsNullableProp = arrayAndItemsNullableProp;
+ return this;
+ }
+ public NullableClass.Builder arrayItemsNullable(List arrayItemsNullable) {
+ this.instance.arrayItemsNullable = arrayItemsNullable;
+ return this;
+ }
+ public NullableClass.Builder objectNullableProp(Map objectNullableProp) {
+ this.instance.objectNullableProp = JsonNullable.>of(objectNullableProp);
+ return this;
+ }
+ public NullableClass.Builder objectNullableProp(JsonNullable> objectNullableProp) {
+ this.instance.objectNullableProp = objectNullableProp;
+ return this;
+ }
+ public NullableClass.Builder objectAndItemsNullableProp(Map objectAndItemsNullableProp) {
+ this.instance.objectAndItemsNullableProp = JsonNullable.>of(objectAndItemsNullableProp);
+ return this;
+ }
+ public NullableClass.Builder objectAndItemsNullableProp(JsonNullable> objectAndItemsNullableProp) {
+ this.instance.objectAndItemsNullableProp = objectAndItemsNullableProp;
+ return this;
+ }
+ public NullableClass.Builder objectItemsNullable(Map objectItemsNullable) {
+ this.instance.objectItemsNullable = objectItemsNullable;
+ return this;
+ }
+
+
+ /**
+ * returns a built NullableClass instance.
+ *
+ * The builder is not reusable.
+ */
+ public NullableClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static NullableClass.Builder builder() {
+ return new NullableClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public NullableClass.Builder toBuilder() {
+ return new NullableClass.Builder()
+ .integerProp(getIntegerProp())
+ .numberProp(getNumberProp())
+ .booleanProp(getBooleanProp())
+ .stringProp(getStringProp())
+ .dateProp(getDateProp())
+ .datetimeProp(getDatetimeProp())
+ .arrayNullableProp(getArrayNullableProp())
+ .arrayAndItemsNullableProp(getArrayAndItemsNullableProp())
+ .arrayItemsNullable(getArrayItemsNullable())
+ .objectNullableProp(getObjectNullableProp())
+ .objectAndItemsNullableProp(getObjectAndItemsNullableProp())
+ .objectItemsNullable(getObjectItemsNullable());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java
index 61f90262125..2e3e959e3fb 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/NumberOnly.java
@@ -107,5 +107,59 @@ public class NumberOnly {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private NumberOnly instance;
+
+ public Builder() {
+ this(new NumberOnly());
+ }
+
+ protected Builder(NumberOnly instance) {
+ this.instance = instance;
+ }
+
+ public NumberOnly.Builder justNumber(BigDecimal justNumber) {
+ this.instance.justNumber = justNumber;
+ return this;
+ }
+
+
+ /**
+ * returns a built NumberOnly instance.
+ *
+ * The builder is not reusable.
+ */
+ public NumberOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static NumberOnly.Builder builder() {
+ return new NumberOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public NumberOnly.Builder toBuilder() {
+ return new NumberOnly.Builder()
+ .justNumber(getJustNumber());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java
index 1d59c1e8691..d54efdc635b 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ObjectWithDeprecatedFields.java
@@ -221,5 +221,74 @@ public class ObjectWithDeprecatedFields {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ObjectWithDeprecatedFields instance;
+
+ public Builder() {
+ this(new ObjectWithDeprecatedFields());
+ }
+
+ protected Builder(ObjectWithDeprecatedFields instance) {
+ this.instance = instance;
+ }
+
+ public ObjectWithDeprecatedFields.Builder uuid(String uuid) {
+ this.instance.uuid = uuid;
+ return this;
+ }
+ public ObjectWithDeprecatedFields.Builder id(BigDecimal id) {
+ this.instance.id = id;
+ return this;
+ }
+ public ObjectWithDeprecatedFields.Builder deprecatedRef(DeprecatedObject deprecatedRef) {
+ this.instance.deprecatedRef = deprecatedRef;
+ return this;
+ }
+ public ObjectWithDeprecatedFields.Builder bars(List bars) {
+ this.instance.bars = bars;
+ return this;
+ }
+
+
+ /**
+ * returns a built ObjectWithDeprecatedFields instance.
+ *
+ * The builder is not reusable.
+ */
+ public ObjectWithDeprecatedFields build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ObjectWithDeprecatedFields.Builder builder() {
+ return new ObjectWithDeprecatedFields.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ObjectWithDeprecatedFields.Builder toBuilder() {
+ return new ObjectWithDeprecatedFields.Builder()
+ .uuid(getUuid())
+ .id(getId())
+ .deprecatedRef(getDeprecatedRef())
+ .bars(getBars());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java
index f09c51a6920..f2b329fb7f6 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Order.java
@@ -304,5 +304,84 @@ public class Order {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private Order instance;
+
+ public Builder() {
+ this(new Order());
+ }
+
+ protected Builder(Order instance) {
+ this.instance = instance;
+ }
+
+ public Order.Builder id(Long id) {
+ this.instance.id = id;
+ return this;
+ }
+ public Order.Builder petId(Long petId) {
+ this.instance.petId = petId;
+ return this;
+ }
+ public Order.Builder quantity(Integer quantity) {
+ this.instance.quantity = quantity;
+ return this;
+ }
+ public Order.Builder shipDate(OffsetDateTime shipDate) {
+ this.instance.shipDate = shipDate;
+ return this;
+ }
+ public Order.Builder status(StatusEnum status) {
+ this.instance.status = status;
+ return this;
+ }
+ public Order.Builder complete(Boolean complete) {
+ this.instance.complete = complete;
+ return this;
+ }
+
+
+ /**
+ * returns a built Order instance.
+ *
+ * The builder is not reusable.
+ */
+ public Order build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Order.Builder builder() {
+ return new Order.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Order.Builder toBuilder() {
+ return new Order.Builder()
+ .id(getId())
+ .petId(getPetId())
+ .quantity(getQuantity())
+ .shipDate(getShipDate())
+ .status(getStatus())
+ .complete(getComplete());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java
index 200d1214cd1..1ec45f73855 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterComposite.java
@@ -171,5 +171,69 @@ public class OuterComposite {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private OuterComposite instance;
+
+ public Builder() {
+ this(new OuterComposite());
+ }
+
+ protected Builder(OuterComposite instance) {
+ this.instance = instance;
+ }
+
+ public OuterComposite.Builder myNumber(BigDecimal myNumber) {
+ this.instance.myNumber = myNumber;
+ return this;
+ }
+ public OuterComposite.Builder myString(String myString) {
+ this.instance.myString = myString;
+ return this;
+ }
+ public OuterComposite.Builder myBoolean(Boolean myBoolean) {
+ this.instance.myBoolean = myBoolean;
+ return this;
+ }
+
+
+ /**
+ * returns a built OuterComposite instance.
+ *
+ * The builder is not reusable.
+ */
+ public OuterComposite build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static OuterComposite.Builder builder() {
+ return new OuterComposite.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public OuterComposite.Builder toBuilder() {
+ return new OuterComposite.Builder()
+ .myNumber(getMyNumber())
+ .myString(getMyString())
+ .myBoolean(getMyBoolean());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java
index 1e2b30c0fdd..215c7847f05 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/OuterObjectWithEnumProperty.java
@@ -107,5 +107,59 @@ public class OuterObjectWithEnumProperty {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private OuterObjectWithEnumProperty instance;
+
+ public Builder() {
+ this(new OuterObjectWithEnumProperty());
+ }
+
+ protected Builder(OuterObjectWithEnumProperty instance) {
+ this.instance = instance;
+ }
+
+ public OuterObjectWithEnumProperty.Builder value(OuterEnumInteger value) {
+ this.instance.value = value;
+ return this;
+ }
+
+
+ /**
+ * returns a built OuterObjectWithEnumProperty instance.
+ *
+ * The builder is not reusable.
+ */
+ public OuterObjectWithEnumProperty build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static OuterObjectWithEnumProperty.Builder builder() {
+ return new OuterObjectWithEnumProperty.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public OuterObjectWithEnumProperty.Builder toBuilder() {
+ return new OuterObjectWithEnumProperty.Builder()
+ .value(getValue());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java
index 2fff6a8b42b..bfbb6ef68f0 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ParentWithNullable.java
@@ -206,5 +206,68 @@ public class ParentWithNullable {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ParentWithNullable instance;
+
+ public Builder() {
+ this(new ParentWithNullable());
+ }
+
+ protected Builder(ParentWithNullable instance) {
+ this.instance = instance;
+ }
+
+ public ParentWithNullable.Builder type(TypeEnum type) {
+ this.instance.type = type;
+ return this;
+ }
+ public ParentWithNullable.Builder nullableProperty(String nullableProperty) {
+ this.instance.nullableProperty = JsonNullable.of(nullableProperty);
+ return this;
+ }
+ public ParentWithNullable.Builder nullableProperty(JsonNullable nullableProperty) {
+ this.instance.nullableProperty = nullableProperty;
+ return this;
+ }
+
+
+ /**
+ * returns a built ParentWithNullable instance.
+ *
+ * The builder is not reusable.
+ */
+ public ParentWithNullable build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ParentWithNullable.Builder builder() {
+ return new ParentWithNullable.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ParentWithNullable.Builder toBuilder() {
+ return new ParentWithNullable.Builder()
+ .type(getType())
+ .nullableProperty(getNullableProperty());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java
index fbf2acd8628..45cae8bbb70 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Pet.java
@@ -328,5 +328,84 @@ public class Pet {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private Pet instance;
+
+ public Builder() {
+ this(new Pet());
+ }
+
+ protected Builder(Pet instance) {
+ this.instance = instance;
+ }
+
+ public Pet.Builder id(Long id) {
+ this.instance.id = id;
+ return this;
+ }
+ public Pet.Builder category(Category category) {
+ this.instance.category = category;
+ return this;
+ }
+ public Pet.Builder name(String name) {
+ this.instance.name = name;
+ return this;
+ }
+ public Pet.Builder photoUrls(Set photoUrls) {
+ this.instance.photoUrls = photoUrls;
+ return this;
+ }
+ public Pet.Builder tags(List tags) {
+ this.instance.tags = tags;
+ return this;
+ }
+ public Pet.Builder status(StatusEnum status) {
+ this.instance.status = status;
+ return this;
+ }
+
+
+ /**
+ * returns a built Pet instance.
+ *
+ * The builder is not reusable.
+ */
+ public Pet build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Pet.Builder builder() {
+ return new Pet.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Pet.Builder toBuilder() {
+ return new Pet.Builder()
+ .id(getId())
+ .category(getCategory())
+ .name(getName())
+ .photoUrls(getPhotoUrls())
+ .tags(getTags())
+ .status(getStatus());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
index 1de9a07e2d7..82fb4f08242 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/ReadOnlyFirst.java
@@ -137,5 +137,64 @@ public class ReadOnlyFirst {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private ReadOnlyFirst instance;
+
+ public Builder() {
+ this(new ReadOnlyFirst());
+ }
+
+ protected Builder(ReadOnlyFirst instance) {
+ this.instance = instance;
+ }
+
+ public ReadOnlyFirst.Builder bar(String bar) {
+ this.instance.bar = bar;
+ return this;
+ }
+ public ReadOnlyFirst.Builder baz(String baz) {
+ this.instance.baz = baz;
+ return this;
+ }
+
+
+ /**
+ * returns a built ReadOnlyFirst instance.
+ *
+ * The builder is not reusable.
+ */
+ public ReadOnlyFirst build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static ReadOnlyFirst.Builder builder() {
+ return new ReadOnlyFirst.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ReadOnlyFirst.Builder toBuilder() {
+ return new ReadOnlyFirst.Builder()
+ .bar(getBar())
+ .baz(getBaz());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java
index 7de114855b6..2336813d7b3 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/SpecialModelName.java
@@ -107,5 +107,59 @@ public class SpecialModelName {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private SpecialModelName instance;
+
+ public Builder() {
+ this(new SpecialModelName());
+ }
+
+ protected Builder(SpecialModelName instance) {
+ this.instance = instance;
+ }
+
+ public SpecialModelName.Builder $specialPropertyName(Long $specialPropertyName) {
+ this.instance.$specialPropertyName = $specialPropertyName;
+ return this;
+ }
+
+
+ /**
+ * returns a built SpecialModelName instance.
+ *
+ * The builder is not reusable.
+ */
+ public SpecialModelName build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static SpecialModelName.Builder builder() {
+ return new SpecialModelName.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public SpecialModelName.Builder toBuilder() {
+ return new SpecialModelName.Builder()
+ .$specialPropertyName(get$SpecialPropertyName());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java
index 42a0ef4b78a..e67b34efd42 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/Tag.java
@@ -138,5 +138,64 @@ public class Tag {
return o.toString().replace("\n", "\n ");
}
+ public static class Builder {
+
+ private Tag instance;
+
+ public Builder() {
+ this(new Tag());
+ }
+
+ protected Builder(Tag instance) {
+ this.instance = instance;
+ }
+
+ public Tag.Builder id(Long id) {
+ this.instance.id = id;
+ return this;
+ }
+ public Tag.Builder name(String name) {
+ this.instance.name = name;
+ return this;
+ }
+
+
+ /**
+ * returns a built Tag instance.
+ *
+ * The builder is not reusable.
+ */
+ public Tag build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field.
+ */
+ public static Tag.Builder builder() {
+ return new Tag.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Tag.Builder toBuilder() {
+ return new Tag.Builder()
+ .id(getId())
+ .name(getName());
+ }
+
+
}
diff --git a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java
index a7e74f88302..4fb7a166add 100644
--- a/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java
+++ b/samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/model/TestInlineFreeformAdditionalPropertiesRequest.java
@@ -113,5 +113,59 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap> nullableArrayWithDefault = JsonNullable.>undefined();
+ public ContainerDefaultValueDto() {
+ super();
+ }
+
public ContainerDefaultValueDto nullableArray(List nullableArray) {
this.nullableArray = JsonNullable.of(nullableArray);
return this;
diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java
index 748d5c85e1e..2908d6ab58b 100644
--- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java
+++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/DogDto.java
@@ -28,6 +28,10 @@ public class DogDto extends AnimalDto {
private String breed;
+ public DogDto() {
+ super();
+ }
+
public DogDto breed(String breed) {
this.breed = breed;
return this;
diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java
index 8e73ea12f51..886cf55a8d5 100644
--- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java
+++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumTestDto.java
@@ -177,6 +177,10 @@ public class EnumTestDto {
private OuterEnumDto outerEnum;
+ public EnumTestDto() {
+ super();
+ }
+
public EnumTestDto enumString(EnumStringEnum enumString) {
this.enumString = enumString;
return this;
diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java
index 2692c75642c..4b98f966436 100644
--- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java
+++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FormatTestDto.java
@@ -57,6 +57,10 @@ public class FormatTestDto {
private BigDecimal bigDecimal;
+ public FormatTestDto() {
+ super();
+ }
+
public FormatTestDto integer(Integer integer) {
this.integer = integer;
return this;
diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java
index 8a6c2223d55..d29684ae376 100644
--- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java
+++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/NameDto.java
@@ -29,6 +29,10 @@ public class NameDto {
private Integer _123number;
+ public NameDto() {
+ super();
+ }
+
public NameDto name(Integer name) {
this.name = name;
return this;
diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java
index 4726e9d2c1b..214d5c95797 100644
--- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java
+++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java
@@ -82,6 +82,10 @@ public class PetDto {
@Deprecated
private StatusEnum status;
+ public PetDto() {
+ super();
+ }
+
public PetDto id(Long id) {
this.id = id;
return this;
diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java
index bd2d7912f73..34e89c82c02 100644
--- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java
+++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java
@@ -36,6 +36,10 @@ public class TypeHolderDefaultDto {
private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
+ public TypeHolderDefaultDto() {
+ super();
+ }
+
public TypeHolderDefaultDto stringItem(String stringItem) {
this.stringItem = stringItem;
return this;
diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java
index 8d13be7fb34..5157899f0a7 100644
--- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java
+++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java
@@ -38,6 +38,10 @@ public class TypeHolderExampleDto {
private List arrayItem = new ArrayList<>();
+ public TypeHolderExampleDto() {
+ super();
+ }
+
public TypeHolderExampleDto stringItem(String stringItem) {
this.stringItem = stringItem;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java
index 06879995933..b3e28e4f5fe 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Animal.java
@@ -39,6 +39,10 @@ public class Animal {
private String color = "red";
+ public Animal() {
+ super();
+ }
+
public Animal className(String className) {
this.className = className;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java
index c54b405645a..726eaf23ad9 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/BigCat.java
@@ -68,6 +68,10 @@ public class BigCat extends Cat {
private KindEnum kind;
+ public BigCat() {
+ super();
+ }
+
public BigCat kind(KindEnum kind) {
this.kind = kind;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java
index 8366e714925..55794fb0039 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Cat.java
@@ -36,6 +36,10 @@ public class Cat extends Animal {
private Boolean declawed;
+ public Cat() {
+ super();
+ }
+
public Cat declawed(Boolean declawed) {
this.declawed = declawed;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java
index 3fa679c6bbc..2b9f60ef482 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Category.java
@@ -25,6 +25,10 @@ public class Category {
private String name = "default-name";
+ public Category() {
+ super();
+ }
+
public Category id(Long id) {
this.id = id;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java
index bb314c27287..e013f78828e 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java
@@ -38,6 +38,10 @@ public class ContainerDefaultValue {
@Valid
private JsonNullable> nullableArrayWithDefault = JsonNullable.>undefined();
+ public ContainerDefaultValue() {
+ super();
+ }
+
public ContainerDefaultValue nullableArray(List nullableArray) {
this.nullableArray = JsonNullable.of(nullableArray);
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java
index e7777688a7c..d005b69e4fa 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Dog.java
@@ -28,6 +28,10 @@ public class Dog extends Animal {
private String breed;
+ public Dog() {
+ super();
+ }
+
public Dog breed(String breed) {
this.breed = breed;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java
index 1841d6bb31d..1c16a0555ae 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumTest.java
@@ -179,6 +179,10 @@ public class EnumTest {
private OuterEnum outerEnum;
+ public EnumTest() {
+ super();
+ }
+
public EnumTest enumString(EnumStringEnum enumString) {
this.enumString = enumString;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java
index 9b8b3be2de4..50746ecdd61 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FormatTest.java
@@ -59,6 +59,10 @@ public class FormatTest {
private BigDecimal bigDecimal;
+ public FormatTest() {
+ super();
+ }
+
public FormatTest integer(Integer integer) {
this.integer = integer;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java
index 946fb99c46b..a21811357d1 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Name.java
@@ -30,6 +30,10 @@ public class Name {
private Integer _123number;
+ public Name() {
+ super();
+ }
+
public Name name(Integer name) {
this.name = name;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java
index 373403327ba..d76bebcb59b 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java
@@ -82,6 +82,10 @@ public class Pet {
@Deprecated
private StatusEnum status;
+ public Pet() {
+ super();
+ }
+
public Pet id(Long id) {
this.id = id;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java
index aa81da79d44..28e9d3857b1 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java
@@ -36,6 +36,10 @@ public class TypeHolderDefault {
@Valid
private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
+ public TypeHolderDefault() {
+ super();
+ }
+
public TypeHolderDefault stringItem(String stringItem) {
this.stringItem = stringItem;
return this;
diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java
index 56a2b8a20dd..1902ac76685 100644
--- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java
+++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java
@@ -38,6 +38,10 @@ public class TypeHolderExample {
@Valid
private List arrayItem = new ArrayList<>();
+ public TypeHolderExample() {
+ super();
+ }
+
public TypeHolderExample stringItem(String stringItem) {
this.stringItem = stringItem;
return this;
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java
index 6721f36254d..3fc30878a26 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Addressable.java
@@ -104,5 +104,69 @@ public class Addressable {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Addressable instance;
+
+ public Builder() {
+ this(new Addressable());
+ }
+
+ protected Builder(Addressable instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Addressable value) {
+ this.instance.setHref(value.href);
+ this.instance.setId(value.id);
+ return this;
+ }
+
+ public Addressable.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ public Addressable.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ /**
+ * returns a built Addressable instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Addressable build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Addressable.Builder builder() {
+ return new Addressable.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Addressable.Builder toBuilder() {
+ Addressable.Builder builder = new Addressable.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java
index 1fc5fa7895a..00f1544d260 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Apple.java
@@ -119,5 +119,69 @@ public class Apple implements Fruit {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Apple instance;
+
+ public Builder() {
+ this(new Apple());
+ }
+
+ protected Builder(Apple instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Apple value) {
+ this.instance.setSeeds(value.seeds);
+ this.instance.setFruitType(value.fruitType);
+ return this;
+ }
+
+ public Apple.Builder seeds(Integer seeds) {
+ this.instance.seeds(seeds);
+ return this;
+ }
+
+ public Apple.Builder fruitType(FruitType fruitType) {
+ this.instance.fruitType(fruitType);
+ return this;
+ }
+
+ /**
+ * returns a built Apple instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Apple build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Apple.Builder builder() {
+ return new Apple.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Apple.Builder toBuilder() {
+ Apple.Builder builder = new Apple.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java
index f6c34e74025..2887c8a4725 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Banana.java
@@ -119,5 +119,69 @@ public class Banana implements Fruit {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Banana instance;
+
+ public Builder() {
+ this(new Banana());
+ }
+
+ protected Builder(Banana instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Banana value) {
+ this.instance.setLength(value.length);
+ this.instance.setFruitType(value.fruitType);
+ return this;
+ }
+
+ public Banana.Builder length(Integer length) {
+ this.instance.length(length);
+ return this;
+ }
+
+ public Banana.Builder fruitType(FruitType fruitType) {
+ this.instance.fruitType(fruitType);
+ return this;
+ }
+
+ /**
+ * returns a built Banana instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Banana build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Banana.Builder builder() {
+ return new Banana.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Banana.Builder toBuilder() {
+ Banana.Builder builder = new Banana.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java
index c9306e8f7f0..519aa0635d1 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Bar.java
@@ -191,5 +191,108 @@ public class Bar extends Entity implements BarRefOrValue {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends Entity.Builder {
+
+ private Bar instance;
+
+ public Builder() {
+ this(new Bar());
+ }
+
+ protected Builder(Bar instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Bar value) {
+ super.copyOf(instance);
+ this.instance.setId(value.id);
+ this.instance.setBarPropA(value.barPropA);
+ this.instance.setFooPropB(value.fooPropB);
+ this.instance.setFoo(value.foo);
+ return this;
+ }
+
+ public Bar.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Bar.Builder barPropA(String barPropA) {
+ this.instance.barPropA(barPropA);
+ return this;
+ }
+
+ public Bar.Builder fooPropB(String fooPropB) {
+ this.instance.fooPropB(fooPropB);
+ return this;
+ }
+
+ public Bar.Builder foo(FooRefOrValue foo) {
+ this.instance.foo(foo);
+ return this;
+ }
+
+ @Override
+ public Bar.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ @Override
+ public Bar.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ @Override
+ public Bar.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ @Override
+ public Bar.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built Bar instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Bar build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Bar.Builder builder() {
+ return new Bar.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Bar.Builder toBuilder() {
+ Bar.Builder builder = new Bar.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java
index 3ed13e8d924..5b4b4fcebcd 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarCreate.java
@@ -173,5 +173,108 @@ public class BarCreate extends Entity {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends Entity.Builder {
+
+ private BarCreate instance;
+
+ public Builder() {
+ this(new BarCreate());
+ }
+
+ protected Builder(BarCreate instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(BarCreate value) {
+ super.copyOf(instance);
+ this.instance.setBarPropA(value.barPropA);
+ this.instance.setFooPropB(value.fooPropB);
+ this.instance.setFoo(value.foo);
+ return this;
+ }
+
+ public BarCreate.Builder barPropA(String barPropA) {
+ this.instance.barPropA(barPropA);
+ return this;
+ }
+
+ public BarCreate.Builder fooPropB(String fooPropB) {
+ this.instance.fooPropB(fooPropB);
+ return this;
+ }
+
+ public BarCreate.Builder foo(FooRefOrValue foo) {
+ this.instance.foo(foo);
+ return this;
+ }
+
+ @Override
+ public BarCreate.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ @Override
+ public BarCreate.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ @Override
+ public BarCreate.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ @Override
+ public BarCreate.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ @Override
+ public BarCreate.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built BarCreate instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public BarCreate build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static BarCreate.Builder builder() {
+ return new BarCreate.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public BarCreate.Builder toBuilder() {
+ BarCreate.Builder builder = new BarCreate.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java
index 20b4ce97710..86f8668df68 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/BarRef.java
@@ -107,5 +107,102 @@ public class BarRef extends EntityRef implements BarRefOrValue {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends EntityRef.Builder {
+
+ private BarRef instance;
+
+ public Builder() {
+ this(new BarRef());
+ }
+
+ protected Builder(BarRef instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(BarRef value) {
+ super.copyOf(instance);
+ return this;
+ }
+
+ @Override
+ public BarRef.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ @Override
+ public BarRef.Builder atReferredType(String atReferredType) {
+ this.instance.atReferredType(atReferredType);
+ return this;
+ }
+
+ @Override
+ public BarRef.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ @Override
+ public BarRef.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ @Override
+ public BarRef.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ @Override
+ public BarRef.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ @Override
+ public BarRef.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built BarRef instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public BarRef build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static BarRef.Builder builder() {
+ return new BarRef.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public BarRef.Builder toBuilder() {
+ BarRef.Builder builder = new BarRef.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java
index c83c77d7642..a407147435a 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Entity.java
@@ -203,5 +203,87 @@ public class Entity {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Entity instance;
+
+ public Builder() {
+ this(new Entity());
+ }
+
+ protected Builder(Entity instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Entity value) {
+ this.instance.setHref(value.href);
+ this.instance.setId(value.id);
+ this.instance.setAtSchemaLocation(value.atSchemaLocation);
+ this.instance.setAtBaseType(value.atBaseType);
+ this.instance.setAtType(value.atType);
+ return this;
+ }
+
+ public Entity.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ public Entity.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Entity.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ public Entity.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ public Entity.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built Entity instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Entity build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Entity.Builder builder() {
+ return new Entity.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Entity.Builder toBuilder() {
+ Entity.Builder builder = new Entity.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java
index 64656344178..a9a846bf884 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/EntityRef.java
@@ -248,5 +248,99 @@ public class EntityRef {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private EntityRef instance;
+
+ public Builder() {
+ this(new EntityRef());
+ }
+
+ protected Builder(EntityRef instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(EntityRef value) {
+ this.instance.setName(value.name);
+ this.instance.setAtReferredType(value.atReferredType);
+ this.instance.setHref(value.href);
+ this.instance.setId(value.id);
+ this.instance.setAtSchemaLocation(value.atSchemaLocation);
+ this.instance.setAtBaseType(value.atBaseType);
+ this.instance.setAtType(value.atType);
+ return this;
+ }
+
+ public EntityRef.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public EntityRef.Builder atReferredType(String atReferredType) {
+ this.instance.atReferredType(atReferredType);
+ return this;
+ }
+
+ public EntityRef.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ public EntityRef.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public EntityRef.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ public EntityRef.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ public EntityRef.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built EntityRef instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public EntityRef build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static EntityRef.Builder builder() {
+ return new EntityRef.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public EntityRef.Builder toBuilder() {
+ EntityRef.Builder builder = new EntityRef.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java
index e0ba3831c40..15e64edf129 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Extensible.java
@@ -138,5 +138,75 @@ public class Extensible {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Extensible instance;
+
+ public Builder() {
+ this(new Extensible());
+ }
+
+ protected Builder(Extensible instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Extensible value) {
+ this.instance.setAtSchemaLocation(value.atSchemaLocation);
+ this.instance.setAtBaseType(value.atBaseType);
+ this.instance.setAtType(value.atType);
+ return this;
+ }
+
+ public Extensible.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ public Extensible.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ public Extensible.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built Extensible instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Extensible build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Extensible.Builder builder() {
+ return new Extensible.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Extensible.Builder toBuilder() {
+ Extensible.Builder builder = new Extensible.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java
index ab68270f057..ec7bc261702 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Foo.java
@@ -146,5 +146,102 @@ public class Foo extends Entity implements FooRefOrValue {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends Entity.Builder {
+
+ private Foo instance;
+
+ public Builder() {
+ this(new Foo());
+ }
+
+ protected Builder(Foo instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Foo value) {
+ super.copyOf(instance);
+ this.instance.setFooPropA(value.fooPropA);
+ this.instance.setFooPropB(value.fooPropB);
+ return this;
+ }
+
+ public Foo.Builder fooPropA(String fooPropA) {
+ this.instance.fooPropA(fooPropA);
+ return this;
+ }
+
+ public Foo.Builder fooPropB(String fooPropB) {
+ this.instance.fooPropB(fooPropB);
+ return this;
+ }
+
+ @Override
+ public Foo.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ @Override
+ public Foo.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ @Override
+ public Foo.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ @Override
+ public Foo.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ @Override
+ public Foo.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built Foo instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Foo build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Foo.Builder builder() {
+ return new Foo.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Foo.Builder toBuilder() {
+ Foo.Builder builder = new Foo.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java
index 2d4ba32fa7d..b87298b8a91 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/FooRef.java
@@ -132,5 +132,108 @@ public class FooRef extends EntityRef implements FooRefOrValue {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends EntityRef.Builder {
+
+ private FooRef instance;
+
+ public Builder() {
+ this(new FooRef());
+ }
+
+ protected Builder(FooRef instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(FooRef value) {
+ super.copyOf(instance);
+ this.instance.setFoorefPropA(value.foorefPropA);
+ return this;
+ }
+
+ public FooRef.Builder foorefPropA(String foorefPropA) {
+ this.instance.foorefPropA(foorefPropA);
+ return this;
+ }
+
+ @Override
+ public FooRef.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ @Override
+ public FooRef.Builder atReferredType(String atReferredType) {
+ this.instance.atReferredType(atReferredType);
+ return this;
+ }
+
+ @Override
+ public FooRef.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ @Override
+ public FooRef.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ @Override
+ public FooRef.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ @Override
+ public FooRef.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ @Override
+ public FooRef.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built FooRef instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public FooRef build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static FooRef.Builder builder() {
+ return new FooRef.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FooRef.Builder toBuilder() {
+ FooRef.Builder builder = new FooRef.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java
index 7ae080eb44c..e2b77398fab 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pasta.java
@@ -122,5 +122,96 @@ public class Pasta extends Entity {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends Entity.Builder {
+
+ private Pasta instance;
+
+ public Builder() {
+ this(new Pasta());
+ }
+
+ protected Builder(Pasta instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Pasta value) {
+ super.copyOf(instance);
+ this.instance.setVendor(value.vendor);
+ return this;
+ }
+
+ public Pasta.Builder vendor(String vendor) {
+ this.instance.vendor(vendor);
+ return this;
+ }
+
+ @Override
+ public Pasta.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ @Override
+ public Pasta.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ @Override
+ public Pasta.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ @Override
+ public Pasta.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ @Override
+ public Pasta.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built Pasta instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Pasta build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Pasta.Builder builder() {
+ return new Pasta.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Pasta.Builder toBuilder() {
+ Pasta.Builder builder = new Pasta.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java
index b179761095d..eead5daa9ef 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/Pizza.java
@@ -131,5 +131,96 @@ public class Pizza extends Entity {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends Entity.Builder {
+
+ private Pizza instance;
+
+ public Builder() {
+ this(new Pizza());
+ }
+
+ protected Builder(Pizza instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Pizza value) {
+ super.copyOf(instance);
+ this.instance.setPizzaSize(value.pizzaSize);
+ return this;
+ }
+
+ public Pizza.Builder pizzaSize(BigDecimal pizzaSize) {
+ this.instance.pizzaSize(pizzaSize);
+ return this;
+ }
+
+ @Override
+ public Pizza.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ @Override
+ public Pizza.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ @Override
+ public Pizza.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ @Override
+ public Pizza.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ @Override
+ public Pizza.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built Pizza instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Pizza build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Pizza.Builder builder() {
+ return new Pizza.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Pizza.Builder toBuilder() {
+ Pizza.Builder builder = new Pizza.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java
index 18ced1b22e5..9225b04669e 100644
--- a/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java
+++ b/samples/openapi3/server/petstore/spring-boot-oneof/src/main/java/org/openapitools/model/PizzaSpeziale.java
@@ -128,5 +128,102 @@ public class PizzaSpeziale extends Pizza {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends Pizza.Builder {
+
+ private PizzaSpeziale instance;
+
+ public Builder() {
+ this(new PizzaSpeziale());
+ }
+
+ protected Builder(PizzaSpeziale instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(PizzaSpeziale value) {
+ super.copyOf(instance);
+ this.instance.setToppings(value.toppings);
+ return this;
+ }
+
+ public PizzaSpeziale.Builder toppings(String toppings) {
+ this.instance.toppings(toppings);
+ return this;
+ }
+
+ @Override
+ public PizzaSpeziale.Builder pizzaSize(BigDecimal pizzaSize) {
+ this.instance.pizzaSize(pizzaSize);
+ return this;
+ }
+
+ @Override
+ public PizzaSpeziale.Builder href(String href) {
+ this.instance.href(href);
+ return this;
+ }
+
+ @Override
+ public PizzaSpeziale.Builder id(String id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ @Override
+ public PizzaSpeziale.Builder atSchemaLocation(String atSchemaLocation) {
+ this.instance.atSchemaLocation(atSchemaLocation);
+ return this;
+ }
+
+ @Override
+ public PizzaSpeziale.Builder atBaseType(String atBaseType) {
+ this.instance.atBaseType(atBaseType);
+ return this;
+ }
+
+ @Override
+ public PizzaSpeziale.Builder atType(String atType) {
+ this.instance.atType(atType);
+ return this;
+ }
+
+ /**
+ * returns a built PizzaSpeziale instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public PizzaSpeziale build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static PizzaSpeziale.Builder builder() {
+ return new PizzaSpeziale.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public PizzaSpeziale.Builder toBuilder() {
+ PizzaSpeziale.Builder builder = new PizzaSpeziale.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java
index 10be3581d48..c75ecd5a1af 100644
--- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java
+++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Category.java
@@ -33,6 +33,10 @@ public class Category {
private String name;
+ public Category() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
@@ -121,5 +125,69 @@ public class Category {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Category instance;
+
+ public Builder() {
+ this(new Category());
+ }
+
+ protected Builder(Category instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Category value) {
+ this.instance.setId(value.id);
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public Category.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Category.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ /**
+ * returns a built Category instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Category build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Category.Builder builder() {
+ return new Category.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Category.Builder toBuilder() {
+ Category.Builder builder = new Category.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java
index c791e9163df..6d1560586aa 100644
--- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java
+++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/ModelApiResponse.java
@@ -37,6 +37,10 @@ public class ModelApiResponse {
private String message;
+ public ModelApiResponse() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
@@ -149,5 +153,75 @@ public class ModelApiResponse {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ModelApiResponse instance;
+
+ public Builder() {
+ this(new ModelApiResponse());
+ }
+
+ protected Builder(ModelApiResponse instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ModelApiResponse value) {
+ this.instance.setCode(value.code);
+ this.instance.setType(value.type);
+ this.instance.setMessage(value.message);
+ return this;
+ }
+
+ public ModelApiResponse.Builder code(Integer code) {
+ this.instance.code(code);
+ return this;
+ }
+
+ public ModelApiResponse.Builder type(String type) {
+ this.instance.type(type);
+ return this;
+ }
+
+ public ModelApiResponse.Builder message(String message) {
+ this.instance.message(message);
+ return this;
+ }
+
+ /**
+ * returns a built ModelApiResponse instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ModelApiResponse build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ModelApiResponse.Builder builder() {
+ return new ModelApiResponse.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelApiResponse.Builder toBuilder() {
+ ModelApiResponse.Builder builder = new ModelApiResponse.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java
index 2a4bd20e5b2..79949932475 100644
--- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java
+++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Order.java
@@ -82,6 +82,10 @@ public class Order {
private Boolean complete = false;
+ public Order() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
@@ -266,5 +270,93 @@ public class Order {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Order instance;
+
+ public Builder() {
+ this(new Order());
+ }
+
+ protected Builder(Order instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Order value) {
+ this.instance.setId(value.id);
+ this.instance.setPetId(value.petId);
+ this.instance.setQuantity(value.quantity);
+ this.instance.setShipDate(value.shipDate);
+ this.instance.setStatus(value.status);
+ this.instance.setComplete(value.complete);
+ return this;
+ }
+
+ public Order.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Order.Builder petId(Long petId) {
+ this.instance.petId(petId);
+ return this;
+ }
+
+ public Order.Builder quantity(Integer quantity) {
+ this.instance.quantity(quantity);
+ return this;
+ }
+
+ public Order.Builder shipDate(OffsetDateTime shipDate) {
+ this.instance.shipDate(shipDate);
+ return this;
+ }
+
+ public Order.Builder status(StatusEnum status) {
+ this.instance.status(status);
+ return this;
+ }
+
+ public Order.Builder complete(Boolean complete) {
+ this.instance.complete(complete);
+ return this;
+ }
+
+ /**
+ * returns a built Order instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Order build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Order.Builder builder() {
+ return new Order.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Order.Builder toBuilder() {
+ Order.Builder builder = new Order.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java
index 911de2422fb..73e9bbec8c9 100644
--- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java
+++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java
@@ -305,5 +305,95 @@ public class Pet {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Pet instance;
+
+ public Builder() {
+ this(new Pet());
+ }
+
+ protected Builder(Pet instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Pet value) {
+ this.instance.setId(value.id);
+ this.instance.setCategory(value.category);
+ this.instance.setName(value.name);
+ this.instance.setPhotoUrls(value.photoUrls);
+ this.instance.setTags(value.tags);
+ this.instance.setStatus(value.status);
+ return this;
+ }
+
+ public Pet.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Pet.Builder category(Category category) {
+ this.instance.category(category);
+ return this;
+ }
+
+ public Pet.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public Pet.Builder photoUrls(List photoUrls) {
+ this.instance.photoUrls(photoUrls);
+ return this;
+ }
+
+ public Pet.Builder tags(List<@Valid Tag> tags) {
+ this.instance.tags(tags);
+ return this;
+ }
+
+ @Deprecated
+ public Pet.Builder status(StatusEnum status) {
+ this.instance.status(status);
+ return this;
+ }
+ @Deprecated
+
+ /**
+ * returns a built Pet instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Pet build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Pet.Builder builder() {
+ return new Pet.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Pet.Builder toBuilder() {
+ Pet.Builder builder = new Pet.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java
index 2124198f203..dbd8c2e97ca 100644
--- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java
+++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Tag.java
@@ -33,6 +33,10 @@ public class Tag {
private String name;
+ public Tag() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
@@ -121,5 +125,69 @@ public class Tag {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Tag instance;
+
+ public Builder() {
+ this(new Tag());
+ }
+
+ protected Builder(Tag instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Tag value) {
+ this.instance.setId(value.id);
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public Tag.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Tag.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ /**
+ * returns a built Tag instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Tag build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Tag.Builder builder() {
+ return new Tag.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Tag.Builder toBuilder() {
+ Tag.Builder builder = new Tag.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java
index bc06bb7f2a8..0d3453e42ab 100644
--- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java
+++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/User.java
@@ -45,6 +45,10 @@ public class User {
private Integer userStatus;
+ public User() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
@@ -277,5 +281,105 @@ public class User {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private User instance;
+
+ public Builder() {
+ this(new User());
+ }
+
+ protected Builder(User instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(User value) {
+ this.instance.setId(value.id);
+ this.instance.setUsername(value.username);
+ this.instance.setFirstName(value.firstName);
+ this.instance.setLastName(value.lastName);
+ this.instance.setEmail(value.email);
+ this.instance.setPassword(value.password);
+ this.instance.setPhone(value.phone);
+ this.instance.setUserStatus(value.userStatus);
+ return this;
+ }
+
+ public User.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public User.Builder username(String username) {
+ this.instance.username(username);
+ return this;
+ }
+
+ public User.Builder firstName(String firstName) {
+ this.instance.firstName(firstName);
+ return this;
+ }
+
+ public User.Builder lastName(String lastName) {
+ this.instance.lastName(lastName);
+ return this;
+ }
+
+ public User.Builder email(String email) {
+ this.instance.email(email);
+ return this;
+ }
+
+ public User.Builder password(String password) {
+ this.instance.password(password);
+ return this;
+ }
+
+ public User.Builder phone(String phone) {
+ this.instance.phone(phone);
+ return this;
+ }
+
+ public User.Builder userStatus(Integer userStatus) {
+ this.instance.userStatus(userStatus);
+ return this;
+ }
+
+ /**
+ * returns a built User instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public User build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static User.Builder builder() {
+ return new User.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public User.Builder toBuilder() {
+ User.Builder builder = new User.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
index c23b129b45e..f1ba94d0ff1 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
@@ -28,6 +28,10 @@ public class AdditionalPropertiesAnyType {
private String name;
+ public AdditionalPropertiesAnyType() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
index fc51276e7fe..7bcba25e7ea 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
@@ -29,6 +29,10 @@ public class AdditionalPropertiesArray {
private String name;
+ public AdditionalPropertiesArray() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
index a66236a71e5..492427d7098 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
@@ -28,6 +28,10 @@ public class AdditionalPropertiesBoolean {
private String name;
+ public AdditionalPropertiesBoolean() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
index 621c373ed5d..18ce5603da3 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
@@ -59,6 +59,10 @@ public class AdditionalPropertiesClass {
private Object anytype3;
+ public AdditionalPropertiesClass() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
index 8a0b80d732f..501fa16aeb6 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
@@ -28,6 +28,10 @@ public class AdditionalPropertiesInteger {
private String name;
+ public AdditionalPropertiesInteger() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
index ec1fc685cb5..9c9bdc0af3d 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
@@ -29,6 +29,10 @@ public class AdditionalPropertiesNumber {
private String name;
+ public AdditionalPropertiesNumber() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
index 7042e9c8760..5020e0c4a0f 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
@@ -29,6 +29,10 @@ public class AdditionalPropertiesObject {
private String name;
+ public AdditionalPropertiesObject() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
index 0a00d336a0b..3d61884ec64 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
@@ -28,6 +28,10 @@ public class AdditionalPropertiesString {
private String name;
+ public AdditionalPropertiesString() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
index 29e702de920..aa8ac0cb686 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
@@ -29,6 +29,10 @@ public class ArrayOfArrayOfNumberOnly {
@Valid
private List> arrayArrayNumber = new ArrayList<>();
+ public ArrayOfArrayOfNumberOnly() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
index cbe4c35c2ef..1c8cc37f044 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
@@ -29,6 +29,10 @@ public class ArrayOfNumberOnly {
@Valid
private List arrayNumber = new ArrayList<>();
+ public ArrayOfNumberOnly() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java
index 4e6b1b5a649..99139106d80 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java
@@ -35,6 +35,10 @@ public class ArrayTest {
@Valid
private List> arrayArrayOfModel = new ArrayList<>();
+ public ArrayTest() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java
index fd9d326a3fd..2783189e3ec 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Capitalization.java
@@ -34,6 +34,10 @@ public class Capitalization {
private String ATT_NAME;
+ public Capitalization() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java
index b36fda25a2e..92b5bcea558 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ChildWithNullable.java
@@ -32,6 +32,10 @@ public class ChildWithNullable extends ParentWithNullable {
private String otherProperty;
+ public ChildWithNullable() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java
index c8bb2dca34c..77c8c64d966 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ClassModel.java
@@ -25,6 +25,10 @@ public class ClassModel {
private String propertyClass;
+ public ClassModel() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java
index 74819d7c311..5290114a5bd 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Client.java
@@ -24,6 +24,10 @@ public class Client {
private String client;
+ public Client() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java
index ab870b37276..00dd39a8371 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java
@@ -101,6 +101,10 @@ public class EnumArrays {
@Valid
private List arrayEnum = new ArrayList<>();
+ public EnumArrays() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java
index 6ef3c320227..d655a98f4dc 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/File.java
@@ -25,6 +25,10 @@ public class File {
private String sourceURI;
+ public File() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java
index f106dc68e9b..d59eadd12e7 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java
@@ -31,6 +31,10 @@ public class FileSchemaTestClass {
@Valid
private List<@Valid File> files = new ArrayList<>();
+ public FileSchemaTestClass() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
index fc94f54a469..12b1230ba0a 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
@@ -28,6 +28,10 @@ public class HasOnlyReadOnly {
private String foo;
+ public HasOnlyReadOnly() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java
index 6f638c2b72e..5998be729c2 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java
@@ -72,6 +72,10 @@ public class MapTest {
@Valid
private Map indirectMap = new HashMap<>();
+ public MapTest() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
index f7970038721..1842333561b 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
@@ -36,6 +36,10 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
@Valid
private Map map = new HashMap<>();
+ public MixedPropertiesAndAdditionalPropertiesClass() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java
index 3b8a6f1d382..a04376d8a06 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Model200Response.java
@@ -29,6 +29,10 @@ public class Model200Response {
private String propertyClass;
+ public Model200Response() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java
index 28ae571cd55..da593af8efa 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelApiResponse.java
@@ -30,6 +30,10 @@ public class ModelApiResponse {
private String message;
+ public ModelApiResponse() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java
index 5b943156360..2c384f372e8 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelList.java
@@ -26,6 +26,10 @@ public class ModelList {
private String _123list;
+ public ModelList() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java
index a7120970654..235a0e075b9 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ModelReturn.java
@@ -27,6 +27,10 @@ public class ModelReturn {
private Integer _return;
+ public ModelReturn() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java
index 6bec6b28d5e..52fe66679be 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NullableMapProperty.java
@@ -30,6 +30,10 @@ public class NullableMapProperty {
@Valid
private JsonNullable> languageValues = JsonNullable.>undefined();
+ public NullableMapProperty() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java
index 51ddc40e97e..07495c0ca64 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/NumberOnly.java
@@ -25,6 +25,10 @@ public class NumberOnly {
private BigDecimal justNumber;
+ public NumberOnly() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java
index c1145764a9e..ea4ec991768 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Order.java
@@ -75,6 +75,10 @@ public class Order {
private Boolean complete = false;
+ public Order() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java
index 541497ab0f6..3db47074fdf 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/OuterComposite.java
@@ -29,6 +29,10 @@ public class OuterComposite {
private Boolean myBoolean;
+ public OuterComposite() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java
index 1ac5ed42745..5a29afced4d 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ParentWithNullable.java
@@ -75,6 +75,10 @@ public class ParentWithNullable {
private JsonNullable nullableProperty = JsonNullable.undefined();
+ public ParentWithNullable() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java
index 152af21dc2c..3ac0d646503 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ReadOnlyFirst.java
@@ -26,6 +26,10 @@ public class ReadOnlyFirst {
private String baz;
+ public ReadOnlyFirst() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java
index 8687f7af05e..31114324f11 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java
@@ -30,6 +30,10 @@ public class ResponseObjectWithDifferentFieldNames {
private String propertyNameWithSpaces;
+ public ResponseObjectWithDifferentFieldNames() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java
index 8476919848d..f9e5a480938 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java
@@ -26,6 +26,10 @@ public class SpecialModelName {
private Long $specialPropertyName;
+ public SpecialModelName() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java
index 69764cb722e..75698837b57 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Tag.java
@@ -26,6 +26,10 @@ public class Tag {
private String name;
+ public Tag() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java
index 5aff42506b8..5ea2d489d98 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/User.java
@@ -38,6 +38,10 @@ public class User {
private Integer userStatus;
+ public User() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java
index be92432db0e..851db8c707b 100644
--- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java
+++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java
@@ -93,6 +93,10 @@ public class XmlItem {
@Valid
private List prefixNsWrappedArray = new ArrayList<>();
+ public XmlItem() {
+ super();
+ }
+
/**
* Constructor with all args parameters
*/
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
index 4ae2f2bdd96..f3eb9923890 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
@@ -124,5 +124,68 @@ public class AdditionalPropertiesAnyType {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private AdditionalPropertiesAnyType instance;
+
+ public Builder() {
+ this(new AdditionalPropertiesAnyType());
+ }
+
+ protected Builder(AdditionalPropertiesAnyType instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(AdditionalPropertiesAnyType value) {
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public AdditionalPropertiesAnyType.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public AdditionalPropertiesAnyType.Builder additionalProperties(Map additionalProperties) {
+ this.instance.additionalProperties = additionalProperties;
+ return this;
+ }
+
+ /**
+ * returns a built AdditionalPropertiesAnyType instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public AdditionalPropertiesAnyType build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static AdditionalPropertiesAnyType.Builder builder() {
+ return new AdditionalPropertiesAnyType.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AdditionalPropertiesAnyType.Builder toBuilder() {
+ AdditionalPropertiesAnyType.Builder builder = new AdditionalPropertiesAnyType.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
index 2233a85264e..b6bfd56b3e8 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
@@ -125,5 +125,68 @@ public class AdditionalPropertiesArray {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private AdditionalPropertiesArray instance;
+
+ public Builder() {
+ this(new AdditionalPropertiesArray());
+ }
+
+ protected Builder(AdditionalPropertiesArray instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(AdditionalPropertiesArray value) {
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public AdditionalPropertiesArray.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public AdditionalPropertiesArray.Builder additionalProperties(Map additionalProperties) {
+ this.instance.additionalProperties = additionalProperties;
+ return this;
+ }
+
+ /**
+ * returns a built AdditionalPropertiesArray instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public AdditionalPropertiesArray build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static AdditionalPropertiesArray.Builder builder() {
+ return new AdditionalPropertiesArray.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AdditionalPropertiesArray.Builder toBuilder() {
+ AdditionalPropertiesArray.Builder builder = new AdditionalPropertiesArray.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
index 07cb595c94d..b3277d02e17 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
@@ -124,5 +124,68 @@ public class AdditionalPropertiesBoolean {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private AdditionalPropertiesBoolean instance;
+
+ public Builder() {
+ this(new AdditionalPropertiesBoolean());
+ }
+
+ protected Builder(AdditionalPropertiesBoolean instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(AdditionalPropertiesBoolean value) {
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public AdditionalPropertiesBoolean.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public AdditionalPropertiesBoolean.Builder additionalProperties(Map additionalProperties) {
+ this.instance.additionalProperties = additionalProperties;
+ return this;
+ }
+
+ /**
+ * returns a built AdditionalPropertiesBoolean instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public AdditionalPropertiesBoolean build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static AdditionalPropertiesBoolean.Builder builder() {
+ return new AdditionalPropertiesBoolean.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AdditionalPropertiesBoolean.Builder toBuilder() {
+ AdditionalPropertiesBoolean.Builder builder = new AdditionalPropertiesBoolean.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
index 9c16759329f..3a87a5601db 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
@@ -410,5 +410,128 @@ public class AdditionalPropertiesClass {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private AdditionalPropertiesClass instance;
+
+ public Builder() {
+ this(new AdditionalPropertiesClass());
+ }
+
+ protected Builder(AdditionalPropertiesClass instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(AdditionalPropertiesClass value) {
+ this.instance.setMapString(value.mapString);
+ this.instance.setMapNumber(value.mapNumber);
+ this.instance.setMapInteger(value.mapInteger);
+ this.instance.setMapBoolean(value.mapBoolean);
+ this.instance.setMapArrayInteger(value.mapArrayInteger);
+ this.instance.setMapArrayAnytype(value.mapArrayAnytype);
+ this.instance.setMapMapString(value.mapMapString);
+ this.instance.setMapMapAnytype(value.mapMapAnytype);
+ this.instance.setAnytype1(value.anytype1);
+ this.instance.setAnytype2(value.anytype2);
+ this.instance.setAnytype3(value.anytype3);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder mapString(Map mapString) {
+ this.instance.mapString(mapString);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder mapNumber(Map mapNumber) {
+ this.instance.mapNumber(mapNumber);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder mapInteger(Map mapInteger) {
+ this.instance.mapInteger(mapInteger);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder mapBoolean(Map mapBoolean) {
+ this.instance.mapBoolean(mapBoolean);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder mapArrayInteger(Map> mapArrayInteger) {
+ this.instance.mapArrayInteger(mapArrayInteger);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder mapArrayAnytype(Map> mapArrayAnytype) {
+ this.instance.mapArrayAnytype(mapArrayAnytype);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder mapMapString(Map> mapMapString) {
+ this.instance.mapMapString(mapMapString);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder mapMapAnytype(Map> mapMapAnytype) {
+ this.instance.mapMapAnytype(mapMapAnytype);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder anytype1(Object anytype1) {
+ this.instance.anytype1(anytype1);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder anytype2(Object anytype2) {
+ this.instance.anytype2(anytype2);
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder anytype2(JsonNullable anytype2) {
+ this.instance.anytype2 = anytype2;
+ return this;
+ }
+
+ public AdditionalPropertiesClass.Builder anytype3(Object anytype3) {
+ this.instance.anytype3(anytype3);
+ return this;
+ }
+
+ /**
+ * returns a built AdditionalPropertiesClass instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public AdditionalPropertiesClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static AdditionalPropertiesClass.Builder builder() {
+ return new AdditionalPropertiesClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AdditionalPropertiesClass.Builder toBuilder() {
+ AdditionalPropertiesClass.Builder builder = new AdditionalPropertiesClass.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
index 42784d373a0..d049914a7ec 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
@@ -124,5 +124,68 @@ public class AdditionalPropertiesInteger {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private AdditionalPropertiesInteger instance;
+
+ public Builder() {
+ this(new AdditionalPropertiesInteger());
+ }
+
+ protected Builder(AdditionalPropertiesInteger instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(AdditionalPropertiesInteger value) {
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public AdditionalPropertiesInteger.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public AdditionalPropertiesInteger.Builder additionalProperties(Map additionalProperties) {
+ this.instance.additionalProperties = additionalProperties;
+ return this;
+ }
+
+ /**
+ * returns a built AdditionalPropertiesInteger instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public AdditionalPropertiesInteger build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static AdditionalPropertiesInteger.Builder builder() {
+ return new AdditionalPropertiesInteger.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AdditionalPropertiesInteger.Builder toBuilder() {
+ AdditionalPropertiesInteger.Builder builder = new AdditionalPropertiesInteger.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
index fc0ed8c8f31..63ddfaba3bf 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
@@ -125,5 +125,68 @@ public class AdditionalPropertiesNumber {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private AdditionalPropertiesNumber instance;
+
+ public Builder() {
+ this(new AdditionalPropertiesNumber());
+ }
+
+ protected Builder(AdditionalPropertiesNumber instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(AdditionalPropertiesNumber value) {
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public AdditionalPropertiesNumber.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public AdditionalPropertiesNumber.Builder additionalProperties(Map additionalProperties) {
+ this.instance.additionalProperties = additionalProperties;
+ return this;
+ }
+
+ /**
+ * returns a built AdditionalPropertiesNumber instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public AdditionalPropertiesNumber build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static AdditionalPropertiesNumber.Builder builder() {
+ return new AdditionalPropertiesNumber.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AdditionalPropertiesNumber.Builder toBuilder() {
+ AdditionalPropertiesNumber.Builder builder = new AdditionalPropertiesNumber.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
index 964ae18650a..992d20812f6 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
@@ -125,5 +125,68 @@ public class AdditionalPropertiesObject {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private AdditionalPropertiesObject instance;
+
+ public Builder() {
+ this(new AdditionalPropertiesObject());
+ }
+
+ protected Builder(AdditionalPropertiesObject instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(AdditionalPropertiesObject value) {
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public AdditionalPropertiesObject.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public AdditionalPropertiesObject.Builder additionalProperties(Map additionalProperties) {
+ this.instance.additionalProperties = additionalProperties;
+ return this;
+ }
+
+ /**
+ * returns a built AdditionalPropertiesObject instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public AdditionalPropertiesObject build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static AdditionalPropertiesObject.Builder builder() {
+ return new AdditionalPropertiesObject.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AdditionalPropertiesObject.Builder toBuilder() {
+ AdditionalPropertiesObject.Builder builder = new AdditionalPropertiesObject.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
index 6114e367540..e7c88efce4a 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java
@@ -124,5 +124,68 @@ public class AdditionalPropertiesString {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private AdditionalPropertiesString instance;
+
+ public Builder() {
+ this(new AdditionalPropertiesString());
+ }
+
+ protected Builder(AdditionalPropertiesString instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(AdditionalPropertiesString value) {
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public AdditionalPropertiesString.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public AdditionalPropertiesString.Builder additionalProperties(Map additionalProperties) {
+ this.instance.additionalProperties = additionalProperties;
+ return this;
+ }
+
+ /**
+ * returns a built AdditionalPropertiesString instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public AdditionalPropertiesString build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static AdditionalPropertiesString.Builder builder() {
+ return new AdditionalPropertiesString.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public AdditionalPropertiesString.Builder toBuilder() {
+ AdditionalPropertiesString.Builder builder = new AdditionalPropertiesString.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java
index d989505862d..b8839c1929b 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java
@@ -129,5 +129,69 @@ public class Animal {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Animal instance;
+
+ public Builder() {
+ this(new Animal());
+ }
+
+ protected Builder(Animal instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Animal value) {
+ this.instance.setClassName(value.className);
+ this.instance.setColor(value.color);
+ return this;
+ }
+
+ public Animal.Builder className(String className) {
+ this.instance.className(className);
+ return this;
+ }
+
+ public Animal.Builder color(String color) {
+ this.instance.color(color);
+ return this;
+ }
+
+ /**
+ * returns a built Animal instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Animal build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Animal.Builder builder() {
+ return new Animal.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Animal.Builder toBuilder() {
+ Animal.Builder builder = new Animal.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
index e3f4d272de5..79105f8b9e1 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
@@ -93,5 +93,63 @@ public class ArrayOfArrayOfNumberOnly {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ArrayOfArrayOfNumberOnly instance;
+
+ public Builder() {
+ this(new ArrayOfArrayOfNumberOnly());
+ }
+
+ protected Builder(ArrayOfArrayOfNumberOnly instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ArrayOfArrayOfNumberOnly value) {
+ this.instance.setArrayArrayNumber(value.arrayArrayNumber);
+ return this;
+ }
+
+ public ArrayOfArrayOfNumberOnly.Builder arrayArrayNumber(List> arrayArrayNumber) {
+ this.instance.arrayArrayNumber(arrayArrayNumber);
+ return this;
+ }
+
+ /**
+ * returns a built ArrayOfArrayOfNumberOnly instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ArrayOfArrayOfNumberOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ArrayOfArrayOfNumberOnly.Builder builder() {
+ return new ArrayOfArrayOfNumberOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ArrayOfArrayOfNumberOnly.Builder toBuilder() {
+ ArrayOfArrayOfNumberOnly.Builder builder = new ArrayOfArrayOfNumberOnly.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
index 6a71d37dcf1..1257ac5909f 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
@@ -93,5 +93,63 @@ public class ArrayOfNumberOnly {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ArrayOfNumberOnly instance;
+
+ public Builder() {
+ this(new ArrayOfNumberOnly());
+ }
+
+ protected Builder(ArrayOfNumberOnly instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ArrayOfNumberOnly value) {
+ this.instance.setArrayNumber(value.arrayNumber);
+ return this;
+ }
+
+ public ArrayOfNumberOnly.Builder arrayNumber(List arrayNumber) {
+ this.instance.arrayNumber(arrayNumber);
+ return this;
+ }
+
+ /**
+ * returns a built ArrayOfNumberOnly instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ArrayOfNumberOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ArrayOfNumberOnly.Builder builder() {
+ return new ArrayOfNumberOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ArrayOfNumberOnly.Builder toBuilder() {
+ ArrayOfNumberOnly.Builder builder = new ArrayOfNumberOnly.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java
index f5aa226a3d2..fd2675d0e90 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java
@@ -159,5 +159,75 @@ public class ArrayTest {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ArrayTest instance;
+
+ public Builder() {
+ this(new ArrayTest());
+ }
+
+ protected Builder(ArrayTest instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ArrayTest value) {
+ this.instance.setArrayOfString(value.arrayOfString);
+ this.instance.setArrayArrayOfInteger(value.arrayArrayOfInteger);
+ this.instance.setArrayArrayOfModel(value.arrayArrayOfModel);
+ return this;
+ }
+
+ public ArrayTest.Builder arrayOfString(List arrayOfString) {
+ this.instance.arrayOfString(arrayOfString);
+ return this;
+ }
+
+ public ArrayTest.Builder arrayArrayOfInteger(List> arrayArrayOfInteger) {
+ this.instance.arrayArrayOfInteger(arrayArrayOfInteger);
+ return this;
+ }
+
+ public ArrayTest.Builder arrayArrayOfModel(List> arrayArrayOfModel) {
+ this.instance.arrayArrayOfModel(arrayArrayOfModel);
+ return this;
+ }
+
+ /**
+ * returns a built ArrayTest instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ArrayTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ArrayTest.Builder builder() {
+ return new ArrayTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ArrayTest.Builder toBuilder() {
+ ArrayTest.Builder builder = new ArrayTest.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java
index 5d15e8f65a6..cbd8b4a14ef 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java
@@ -153,5 +153,84 @@ public class BigCat extends Cat {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends Cat.Builder {
+
+ private BigCat instance;
+
+ public Builder() {
+ this(new BigCat());
+ }
+
+ protected Builder(BigCat instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(BigCat value) {
+ super.copyOf(instance);
+ this.instance.setKind(value.kind);
+ return this;
+ }
+
+ public BigCat.Builder kind(KindEnum kind) {
+ this.instance.kind(kind);
+ return this;
+ }
+
+ @Override
+ public BigCat.Builder declawed(Boolean declawed) {
+ this.instance.declawed(declawed);
+ return this;
+ }
+
+ @Override
+ public BigCat.Builder className(String className) {
+ this.instance.className(className);
+ return this;
+ }
+
+ @Override
+ public BigCat.Builder color(String color) {
+ this.instance.color(color);
+ return this;
+ }
+
+ /**
+ * returns a built BigCat instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public BigCat build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static BigCat.Builder builder() {
+ return new BigCat.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public BigCat.Builder toBuilder() {
+ BigCat.Builder builder = new BigCat.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java
index 2ff8a2bbf00..48b5e10adae 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java
@@ -200,5 +200,93 @@ public class Capitalization {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Capitalization instance;
+
+ public Builder() {
+ this(new Capitalization());
+ }
+
+ protected Builder(Capitalization instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Capitalization value) {
+ this.instance.setSmallCamel(value.smallCamel);
+ this.instance.setCapitalCamel(value.capitalCamel);
+ this.instance.setSmallSnake(value.smallSnake);
+ this.instance.setCapitalSnake(value.capitalSnake);
+ this.instance.setScAETHFlowPoints(value.scAETHFlowPoints);
+ this.instance.setATTNAME(value.ATT_NAME);
+ return this;
+ }
+
+ public Capitalization.Builder smallCamel(String smallCamel) {
+ this.instance.smallCamel(smallCamel);
+ return this;
+ }
+
+ public Capitalization.Builder capitalCamel(String capitalCamel) {
+ this.instance.capitalCamel(capitalCamel);
+ return this;
+ }
+
+ public Capitalization.Builder smallSnake(String smallSnake) {
+ this.instance.smallSnake(smallSnake);
+ return this;
+ }
+
+ public Capitalization.Builder capitalSnake(String capitalSnake) {
+ this.instance.capitalSnake(capitalSnake);
+ return this;
+ }
+
+ public Capitalization.Builder scAETHFlowPoints(String scAETHFlowPoints) {
+ this.instance.scAETHFlowPoints(scAETHFlowPoints);
+ return this;
+ }
+
+ public Capitalization.Builder ATT_NAME(String ATT_NAME) {
+ this.instance.ATT_NAME(ATT_NAME);
+ return this;
+ }
+
+ /**
+ * returns a built Capitalization instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Capitalization build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Capitalization.Builder builder() {
+ return new Capitalization.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Capitalization.Builder toBuilder() {
+ Capitalization.Builder builder = new Capitalization.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java
index 6eafc4dcfa2..0fe92248312 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java
@@ -116,5 +116,78 @@ public class Cat extends Animal {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends Animal.Builder {
+
+ private Cat instance;
+
+ public Builder() {
+ this(new Cat());
+ }
+
+ protected Builder(Cat instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Cat value) {
+ super.copyOf(instance);
+ this.instance.setDeclawed(value.declawed);
+ return this;
+ }
+
+ public Cat.Builder declawed(Boolean declawed) {
+ this.instance.declawed(declawed);
+ return this;
+ }
+
+ @Override
+ public Cat.Builder className(String className) {
+ this.instance.className(className);
+ return this;
+ }
+
+ @Override
+ public Cat.Builder color(String color) {
+ this.instance.color(color);
+ return this;
+ }
+
+ /**
+ * returns a built Cat instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Cat build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Cat.Builder builder() {
+ return new Cat.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Cat.Builder toBuilder() {
+ Cat.Builder builder = new Cat.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java
index d41d7792134..ce2a64d65e9 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java
@@ -115,5 +115,69 @@ public class Category {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Category instance;
+
+ public Builder() {
+ this(new Category());
+ }
+
+ protected Builder(Category instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Category value) {
+ this.instance.setId(value.id);
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public Category.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Category.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ /**
+ * returns a built Category instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Category build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Category.Builder builder() {
+ return new Category.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Category.Builder toBuilder() {
+ Category.Builder builder = new Category.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java
index d4d72ddaccb..4b3e323e2db 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ChildWithNullable.java
@@ -111,5 +111,83 @@ public class ChildWithNullable extends ParentWithNullable {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends ParentWithNullable.Builder {
+
+ private ChildWithNullable instance;
+
+ public Builder() {
+ this(new ChildWithNullable());
+ }
+
+ protected Builder(ChildWithNullable instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ChildWithNullable value) {
+ super.copyOf(instance);
+ this.instance.setOtherProperty(value.otherProperty);
+ return this;
+ }
+
+ public ChildWithNullable.Builder otherProperty(String otherProperty) {
+ this.instance.otherProperty(otherProperty);
+ return this;
+ }
+
+ @Override
+ public ChildWithNullable.Builder type(TypeEnum type) {
+ this.instance.type(type);
+ return this;
+ }
+
+ @Override
+ public ChildWithNullable.Builder nullableProperty(String nullableProperty) {
+ this.instance.nullableProperty(nullableProperty);
+ return this;
+ }
+
+ public ChildWithNullable.Builder nullableProperty(JsonNullable nullableProperty) {
+ this.instance.setNullableProperty(nullableProperty);
+ return this;
+ }
+
+ /**
+ * returns a built ChildWithNullable instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ChildWithNullable build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ChildWithNullable.Builder builder() {
+ return new ChildWithNullable.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ChildWithNullable.Builder toBuilder() {
+ ChildWithNullable.Builder builder = new ChildWithNullable.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java
index d7304324482..e0b25f6fd7c 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java
@@ -81,5 +81,63 @@ public class ClassModel {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ClassModel instance;
+
+ public Builder() {
+ this(new ClassModel());
+ }
+
+ protected Builder(ClassModel instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ClassModel value) {
+ this.instance.setPropertyClass(value.propertyClass);
+ return this;
+ }
+
+ public ClassModel.Builder propertyClass(String propertyClass) {
+ this.instance.propertyClass(propertyClass);
+ return this;
+ }
+
+ /**
+ * returns a built ClassModel instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ClassModel build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ClassModel.Builder builder() {
+ return new ClassModel.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ClassModel.Builder toBuilder() {
+ ClassModel.Builder builder = new ClassModel.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java
index c2729123789..935c6f813bc 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java
@@ -80,5 +80,63 @@ public class Client {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Client instance;
+
+ public Builder() {
+ this(new Client());
+ }
+
+ protected Builder(Client instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Client value) {
+ this.instance.setClient(value.client);
+ return this;
+ }
+
+ public Client.Builder client(String client) {
+ this.instance.client(client);
+ return this;
+ }
+
+ /**
+ * returns a built Client instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Client build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Client.Builder builder() {
+ return new Client.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Client.Builder toBuilder() {
+ Client.Builder builder = new Client.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java
index f635ce8a4b6..3ab4a13e1f7 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java
@@ -216,5 +216,96 @@ public class ContainerDefaultValue {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ContainerDefaultValue instance;
+
+ public Builder() {
+ this(new ContainerDefaultValue());
+ }
+
+ protected Builder(ContainerDefaultValue instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ContainerDefaultValue value) {
+ this.instance.setNullableArray(value.nullableArray);
+ this.instance.setNullableRequiredArray(value.nullableRequiredArray);
+ this.instance.setRequiredArray(value.requiredArray);
+ this.instance.setNullableArrayWithDefault(value.nullableArrayWithDefault);
+ return this;
+ }
+
+ public ContainerDefaultValue.Builder nullableArray(List nullableArray) {
+ this.instance.nullableArray(nullableArray);
+ return this;
+ }
+
+ public ContainerDefaultValue.Builder nullableArray(JsonNullable> nullableArray) {
+ this.instance.nullableArray = nullableArray;
+ return this;
+ }
+
+ public ContainerDefaultValue.Builder nullableRequiredArray(List nullableRequiredArray) {
+ this.instance.nullableRequiredArray(nullableRequiredArray);
+ return this;
+ }
+
+ public ContainerDefaultValue.Builder nullableRequiredArray(JsonNullable> nullableRequiredArray) {
+ this.instance.nullableRequiredArray = nullableRequiredArray;
+ return this;
+ }
+
+ public ContainerDefaultValue.Builder requiredArray(List requiredArray) {
+ this.instance.requiredArray(requiredArray);
+ return this;
+ }
+
+ public ContainerDefaultValue.Builder nullableArrayWithDefault(List nullableArrayWithDefault) {
+ this.instance.nullableArrayWithDefault(nullableArrayWithDefault);
+ return this;
+ }
+
+ public ContainerDefaultValue.Builder nullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) {
+ this.instance.nullableArrayWithDefault = nullableArrayWithDefault;
+ return this;
+ }
+
+ /**
+ * returns a built ContainerDefaultValue instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ContainerDefaultValue build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ContainerDefaultValue.Builder builder() {
+ return new ContainerDefaultValue.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ContainerDefaultValue.Builder toBuilder() {
+ ContainerDefaultValue.Builder builder = new ContainerDefaultValue.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java
index 2671d3b023d..cde4c8461e0 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java
@@ -108,5 +108,78 @@ public class Dog extends Animal {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder extends Animal.Builder {
+
+ private Dog instance;
+
+ public Builder() {
+ this(new Dog());
+ }
+
+ protected Builder(Dog instance) {
+ super(instance); // the parent builder shares the same instance
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Dog value) {
+ super.copyOf(instance);
+ this.instance.setBreed(value.breed);
+ return this;
+ }
+
+ public Dog.Builder breed(String breed) {
+ this.instance.breed(breed);
+ return this;
+ }
+
+ @Override
+ public Dog.Builder className(String className) {
+ this.instance.className(className);
+ return this;
+ }
+
+ @Override
+ public Dog.Builder color(String color) {
+ this.instance.color(color);
+ return this;
+ }
+
+ /**
+ * returns a built Dog instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Dog build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ super.build();
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Dog.Builder builder() {
+ return new Dog.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Dog.Builder toBuilder() {
+ Dog.Builder builder = new Dog.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java
index 9304eab1352..0d61255a8cb 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java
@@ -187,5 +187,69 @@ public class EnumArrays {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private EnumArrays instance;
+
+ public Builder() {
+ this(new EnumArrays());
+ }
+
+ protected Builder(EnumArrays instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(EnumArrays value) {
+ this.instance.setJustSymbol(value.justSymbol);
+ this.instance.setArrayEnum(value.arrayEnum);
+ return this;
+ }
+
+ public EnumArrays.Builder justSymbol(JustSymbolEnum justSymbol) {
+ this.instance.justSymbol(justSymbol);
+ return this;
+ }
+
+ public EnumArrays.Builder arrayEnum(List arrayEnum) {
+ this.instance.arrayEnum(arrayEnum);
+ return this;
+ }
+
+ /**
+ * returns a built EnumArrays instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public EnumArrays build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static EnumArrays.Builder builder() {
+ return new EnumArrays.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public EnumArrays.Builder toBuilder() {
+ EnumArrays.Builder builder = new EnumArrays.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java
index b8fc67659c7..ce8e80f0235 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java
@@ -335,5 +335,87 @@ public class EnumTest {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private EnumTest instance;
+
+ public Builder() {
+ this(new EnumTest());
+ }
+
+ protected Builder(EnumTest instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(EnumTest value) {
+ this.instance.setEnumString(value.enumString);
+ this.instance.setEnumStringRequired(value.enumStringRequired);
+ this.instance.setEnumInteger(value.enumInteger);
+ this.instance.setEnumNumber(value.enumNumber);
+ this.instance.setOuterEnum(value.outerEnum);
+ return this;
+ }
+
+ public EnumTest.Builder enumString(EnumStringEnum enumString) {
+ this.instance.enumString(enumString);
+ return this;
+ }
+
+ public EnumTest.Builder enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
+ this.instance.enumStringRequired(enumStringRequired);
+ return this;
+ }
+
+ public EnumTest.Builder enumInteger(EnumIntegerEnum enumInteger) {
+ this.instance.enumInteger(enumInteger);
+ return this;
+ }
+
+ public EnumTest.Builder enumNumber(EnumNumberEnum enumNumber) {
+ this.instance.enumNumber(enumNumber);
+ return this;
+ }
+
+ public EnumTest.Builder outerEnum(OuterEnum outerEnum) {
+ this.instance.outerEnum(outerEnum);
+ return this;
+ }
+
+ /**
+ * returns a built EnumTest instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public EnumTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static EnumTest.Builder builder() {
+ return new EnumTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public EnumTest.Builder toBuilder() {
+ EnumTest.Builder builder = new EnumTest.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java
index 7ac760a2954..f591df1c3d5 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java
@@ -81,5 +81,63 @@ public class File {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private File instance;
+
+ public Builder() {
+ this(new File());
+ }
+
+ protected Builder(File instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(File value) {
+ this.instance.setSourceURI(value.sourceURI);
+ return this;
+ }
+
+ public File.Builder sourceURI(String sourceURI) {
+ this.instance.sourceURI(sourceURI);
+ return this;
+ }
+
+ /**
+ * returns a built File instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public File build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static File.Builder builder() {
+ return new File.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public File.Builder toBuilder() {
+ File.Builder builder = new File.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java
index 8b451c79b77..64c474a1860 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java
@@ -117,5 +117,69 @@ public class FileSchemaTestClass {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private FileSchemaTestClass instance;
+
+ public Builder() {
+ this(new FileSchemaTestClass());
+ }
+
+ protected Builder(FileSchemaTestClass instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(FileSchemaTestClass value) {
+ this.instance.setFile(value.file);
+ this.instance.setFiles(value.files);
+ return this;
+ }
+
+ public FileSchemaTestClass.Builder file(File file) {
+ this.instance.file(file);
+ return this;
+ }
+
+ public FileSchemaTestClass.Builder files(List<@Valid File> files) {
+ this.instance.files(files);
+ return this;
+ }
+
+ /**
+ * returns a built FileSchemaTestClass instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public FileSchemaTestClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static FileSchemaTestClass.Builder builder() {
+ return new FileSchemaTestClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FileSchemaTestClass.Builder toBuilder() {
+ FileSchemaTestClass.Builder builder = new FileSchemaTestClass.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java
index 6d1fad2c21d..b37c5f0d4f0 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java
@@ -426,5 +426,141 @@ public class FormatTest {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private FormatTest instance;
+
+ public Builder() {
+ this(new FormatTest());
+ }
+
+ protected Builder(FormatTest instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(FormatTest value) {
+ this.instance.setInteger(value.integer);
+ this.instance.setInt32(value.int32);
+ this.instance.setInt64(value.int64);
+ this.instance.setNumber(value.number);
+ this.instance.setFloat(value._float);
+ this.instance.setDouble(value._double);
+ this.instance.setString(value.string);
+ this.instance.setByte(value._byte);
+ this.instance.setBinary(value.binary);
+ this.instance.setDate(value.date);
+ this.instance.setDateTime(value.dateTime);
+ this.instance.setUuid(value.uuid);
+ this.instance.setPassword(value.password);
+ this.instance.setBigDecimal(value.bigDecimal);
+ return this;
+ }
+
+ public FormatTest.Builder integer(Integer integer) {
+ this.instance.integer(integer);
+ return this;
+ }
+
+ public FormatTest.Builder int32(Integer int32) {
+ this.instance.int32(int32);
+ return this;
+ }
+
+ public FormatTest.Builder int64(Long int64) {
+ this.instance.int64(int64);
+ return this;
+ }
+
+ public FormatTest.Builder number(BigDecimal number) {
+ this.instance.number(number);
+ return this;
+ }
+
+ public FormatTest.Builder _float(Float _float) {
+ this.instance._float(_float);
+ return this;
+ }
+
+ public FormatTest.Builder _double(Double _double) {
+ this.instance._double(_double);
+ return this;
+ }
+
+ public FormatTest.Builder string(String string) {
+ this.instance.string(string);
+ return this;
+ }
+
+ public FormatTest.Builder _byte(byte[] _byte) {
+ this.instance._byte(_byte);
+ return this;
+ }
+
+ public FormatTest.Builder binary(org.springframework.core.io.Resource binary) {
+ this.instance.binary(binary);
+ return this;
+ }
+
+ public FormatTest.Builder date(LocalDate date) {
+ this.instance.date(date);
+ return this;
+ }
+
+ public FormatTest.Builder dateTime(OffsetDateTime dateTime) {
+ this.instance.dateTime(dateTime);
+ return this;
+ }
+
+ public FormatTest.Builder uuid(UUID uuid) {
+ this.instance.uuid(uuid);
+ return this;
+ }
+
+ public FormatTest.Builder password(String password) {
+ this.instance.password(password);
+ return this;
+ }
+
+ public FormatTest.Builder bigDecimal(BigDecimal bigDecimal) {
+ this.instance.bigDecimal(bigDecimal);
+ return this;
+ }
+
+ /**
+ * returns a built FormatTest instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public FormatTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static FormatTest.Builder builder() {
+ return new FormatTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public FormatTest.Builder toBuilder() {
+ FormatTest.Builder builder = new FormatTest.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
index 4da93bdc44d..4095eb3bd8d 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java
@@ -106,5 +106,69 @@ public class HasOnlyReadOnly {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private HasOnlyReadOnly instance;
+
+ public Builder() {
+ this(new HasOnlyReadOnly());
+ }
+
+ protected Builder(HasOnlyReadOnly instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(HasOnlyReadOnly value) {
+ this.instance.setBar(value.bar);
+ this.instance.setFoo(value.foo);
+ return this;
+ }
+
+ public HasOnlyReadOnly.Builder bar(String bar) {
+ this.instance.bar(bar);
+ return this;
+ }
+
+ public HasOnlyReadOnly.Builder foo(String foo) {
+ this.instance.foo(foo);
+ return this;
+ }
+
+ /**
+ * returns a built HasOnlyReadOnly instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public HasOnlyReadOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static HasOnlyReadOnly.Builder builder() {
+ return new HasOnlyReadOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public HasOnlyReadOnly.Builder toBuilder() {
+ HasOnlyReadOnly.Builder builder = new HasOnlyReadOnly.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java
index 58d65f476b7..e7cf6b885a0 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java
@@ -226,5 +226,81 @@ public class MapTest {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private MapTest instance;
+
+ public Builder() {
+ this(new MapTest());
+ }
+
+ protected Builder(MapTest instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(MapTest value) {
+ this.instance.setMapMapOfString(value.mapMapOfString);
+ this.instance.setMapOfEnumString(value.mapOfEnumString);
+ this.instance.setDirectMap(value.directMap);
+ this.instance.setIndirectMap(value.indirectMap);
+ return this;
+ }
+
+ public MapTest.Builder mapMapOfString(Map> mapMapOfString) {
+ this.instance.mapMapOfString(mapMapOfString);
+ return this;
+ }
+
+ public MapTest.Builder mapOfEnumString(Map mapOfEnumString) {
+ this.instance.mapOfEnumString(mapOfEnumString);
+ return this;
+ }
+
+ public MapTest.Builder directMap(Map directMap) {
+ this.instance.directMap(directMap);
+ return this;
+ }
+
+ public MapTest.Builder indirectMap(Map indirectMap) {
+ this.instance.indirectMap(indirectMap);
+ return this;
+ }
+
+ /**
+ * returns a built MapTest instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public MapTest build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static MapTest.Builder builder() {
+ return new MapTest.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public MapTest.Builder toBuilder() {
+ MapTest.Builder builder = new MapTest.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
index a3845d0107e..7b002a83a22 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
@@ -144,5 +144,75 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private MixedPropertiesAndAdditionalPropertiesClass instance;
+
+ public Builder() {
+ this(new MixedPropertiesAndAdditionalPropertiesClass());
+ }
+
+ protected Builder(MixedPropertiesAndAdditionalPropertiesClass instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(MixedPropertiesAndAdditionalPropertiesClass value) {
+ this.instance.setUuid(value.uuid);
+ this.instance.setDateTime(value.dateTime);
+ this.instance.setMap(value.map);
+ return this;
+ }
+
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder uuid(UUID uuid) {
+ this.instance.uuid(uuid);
+ return this;
+ }
+
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder dateTime(OffsetDateTime dateTime) {
+ this.instance.dateTime(dateTime);
+ return this;
+ }
+
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder map(Map map) {
+ this.instance.map(map);
+ return this;
+ }
+
+ /**
+ * returns a built MixedPropertiesAndAdditionalPropertiesClass instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public MixedPropertiesAndAdditionalPropertiesClass build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static MixedPropertiesAndAdditionalPropertiesClass.Builder builder() {
+ return new MixedPropertiesAndAdditionalPropertiesClass.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public MixedPropertiesAndAdditionalPropertiesClass.Builder toBuilder() {
+ MixedPropertiesAndAdditionalPropertiesClass.Builder builder = new MixedPropertiesAndAdditionalPropertiesClass.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java
index 8ab057fc33c..ef4a6e9400f 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java
@@ -107,5 +107,69 @@ public class Model200Response {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Model200Response instance;
+
+ public Builder() {
+ this(new Model200Response());
+ }
+
+ protected Builder(Model200Response instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Model200Response value) {
+ this.instance.setName(value.name);
+ this.instance.setPropertyClass(value.propertyClass);
+ return this;
+ }
+
+ public Model200Response.Builder name(Integer name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public Model200Response.Builder propertyClass(String propertyClass) {
+ this.instance.propertyClass(propertyClass);
+ return this;
+ }
+
+ /**
+ * returns a built Model200Response instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Model200Response build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Model200Response.Builder builder() {
+ return new Model200Response.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Model200Response.Builder toBuilder() {
+ Model200Response.Builder builder = new Model200Response.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java
index 9a9c8445cb8..2c7e686cd43 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java
@@ -130,5 +130,75 @@ public class ModelApiResponse {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ModelApiResponse instance;
+
+ public Builder() {
+ this(new ModelApiResponse());
+ }
+
+ protected Builder(ModelApiResponse instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ModelApiResponse value) {
+ this.instance.setCode(value.code);
+ this.instance.setType(value.type);
+ this.instance.setMessage(value.message);
+ return this;
+ }
+
+ public ModelApiResponse.Builder code(Integer code) {
+ this.instance.code(code);
+ return this;
+ }
+
+ public ModelApiResponse.Builder type(String type) {
+ this.instance.type(type);
+ return this;
+ }
+
+ public ModelApiResponse.Builder message(String message) {
+ this.instance.message(message);
+ return this;
+ }
+
+ /**
+ * returns a built ModelApiResponse instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ModelApiResponse build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ModelApiResponse.Builder builder() {
+ return new ModelApiResponse.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelApiResponse.Builder toBuilder() {
+ ModelApiResponse.Builder builder = new ModelApiResponse.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java
index 79768b5d8e3..c29cfdc3ceb 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java
@@ -82,5 +82,63 @@ public class ModelList {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ModelList instance;
+
+ public Builder() {
+ this(new ModelList());
+ }
+
+ protected Builder(ModelList instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ModelList value) {
+ this.instance.set123list(value._123list);
+ return this;
+ }
+
+ public ModelList.Builder _123list(String _123list) {
+ this.instance._123list(_123list);
+ return this;
+ }
+
+ /**
+ * returns a built ModelList instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ModelList build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ModelList.Builder builder() {
+ return new ModelList.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelList.Builder toBuilder() {
+ ModelList.Builder builder = new ModelList.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java
index 6d54c0a05f5..46298ecf638 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java
@@ -83,5 +83,63 @@ public class ModelReturn {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ModelReturn instance;
+
+ public Builder() {
+ this(new ModelReturn());
+ }
+
+ protected Builder(ModelReturn instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ModelReturn value) {
+ this.instance.setReturn(value._return);
+ return this;
+ }
+
+ public ModelReturn.Builder _return(Integer _return) {
+ this.instance._return(_return);
+ return this;
+ }
+
+ /**
+ * returns a built ModelReturn instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ModelReturn build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ModelReturn.Builder builder() {
+ return new ModelReturn.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ModelReturn.Builder toBuilder() {
+ ModelReturn.Builder builder = new ModelReturn.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java
index 50a41b54f36..333459a240c 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java
@@ -164,5 +164,81 @@ public class Name {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Name instance;
+
+ public Builder() {
+ this(new Name());
+ }
+
+ protected Builder(Name instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Name value) {
+ this.instance.setName(value.name);
+ this.instance.setSnakeCase(value.snakeCase);
+ this.instance.setProperty(value.property);
+ this.instance.set123number(value._123number);
+ return this;
+ }
+
+ public Name.Builder name(Integer name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public Name.Builder snakeCase(Integer snakeCase) {
+ this.instance.snakeCase(snakeCase);
+ return this;
+ }
+
+ public Name.Builder property(String property) {
+ this.instance.property(property);
+ return this;
+ }
+
+ public Name.Builder _123number(Integer _123number) {
+ this.instance._123number(_123number);
+ return this;
+ }
+
+ /**
+ * returns a built Name instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Name build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Name.Builder builder() {
+ return new Name.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Name.Builder toBuilder() {
+ Name.Builder builder = new Name.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java
index bc0a415abe0..f57825e3a7d 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NullableMapProperty.java
@@ -105,5 +105,68 @@ public class NullableMapProperty {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private NullableMapProperty instance;
+
+ public Builder() {
+ this(new NullableMapProperty());
+ }
+
+ protected Builder(NullableMapProperty instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(NullableMapProperty value) {
+ this.instance.setLanguageValues(value.languageValues);
+ return this;
+ }
+
+ public NullableMapProperty.Builder languageValues(Map languageValues) {
+ this.instance.languageValues(languageValues);
+ return this;
+ }
+
+ public NullableMapProperty.Builder languageValues(JsonNullable> languageValues) {
+ this.instance.languageValues = languageValues;
+ return this;
+ }
+
+ /**
+ * returns a built NullableMapProperty instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public NullableMapProperty build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static NullableMapProperty.Builder builder() {
+ return new NullableMapProperty.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public NullableMapProperty.Builder toBuilder() {
+ NullableMapProperty.Builder builder = new NullableMapProperty.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java
index 5d5857c8d87..e328dd28774 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java
@@ -81,5 +81,63 @@ public class NumberOnly {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private NumberOnly instance;
+
+ public Builder() {
+ this(new NumberOnly());
+ }
+
+ protected Builder(NumberOnly instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(NumberOnly value) {
+ this.instance.setJustNumber(value.justNumber);
+ return this;
+ }
+
+ public NumberOnly.Builder justNumber(BigDecimal justNumber) {
+ this.instance.justNumber(justNumber);
+ return this;
+ }
+
+ /**
+ * returns a built NumberOnly instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public NumberOnly build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static NumberOnly.Builder builder() {
+ return new NumberOnly.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public NumberOnly.Builder toBuilder() {
+ NumberOnly.Builder builder = new NumberOnly.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java
index ddd58e60bf9..87f20552877 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java
@@ -241,5 +241,93 @@ public class Order {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Order instance;
+
+ public Builder() {
+ this(new Order());
+ }
+
+ protected Builder(Order instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Order value) {
+ this.instance.setId(value.id);
+ this.instance.setPetId(value.petId);
+ this.instance.setQuantity(value.quantity);
+ this.instance.setShipDate(value.shipDate);
+ this.instance.setStatus(value.status);
+ this.instance.setComplete(value.complete);
+ return this;
+ }
+
+ public Order.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Order.Builder petId(Long petId) {
+ this.instance.petId(petId);
+ return this;
+ }
+
+ public Order.Builder quantity(Integer quantity) {
+ this.instance.quantity(quantity);
+ return this;
+ }
+
+ public Order.Builder shipDate(OffsetDateTime shipDate) {
+ this.instance.shipDate(shipDate);
+ return this;
+ }
+
+ public Order.Builder status(StatusEnum status) {
+ this.instance.status(status);
+ return this;
+ }
+
+ public Order.Builder complete(Boolean complete) {
+ this.instance.complete(complete);
+ return this;
+ }
+
+ /**
+ * returns a built Order instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Order build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Order.Builder builder() {
+ return new Order.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Order.Builder toBuilder() {
+ Order.Builder builder = new Order.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java
index 42fdbbca421..341a192d099 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java
@@ -129,5 +129,75 @@ public class OuterComposite {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private OuterComposite instance;
+
+ public Builder() {
+ this(new OuterComposite());
+ }
+
+ protected Builder(OuterComposite instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(OuterComposite value) {
+ this.instance.setMyNumber(value.myNumber);
+ this.instance.setMyString(value.myString);
+ this.instance.setMyBoolean(value.myBoolean);
+ return this;
+ }
+
+ public OuterComposite.Builder myNumber(BigDecimal myNumber) {
+ this.instance.myNumber(myNumber);
+ return this;
+ }
+
+ public OuterComposite.Builder myString(String myString) {
+ this.instance.myString(myString);
+ return this;
+ }
+
+ public OuterComposite.Builder myBoolean(Boolean myBoolean) {
+ this.instance.myBoolean(myBoolean);
+ return this;
+ }
+
+ /**
+ * returns a built OuterComposite instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public OuterComposite build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static OuterComposite.Builder builder() {
+ return new OuterComposite.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public OuterComposite.Builder toBuilder() {
+ OuterComposite.Builder builder = new OuterComposite.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java
index 4ebf6b46e8a..ae5f5afac13 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ParentWithNullable.java
@@ -164,5 +164,74 @@ public class ParentWithNullable {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ParentWithNullable instance;
+
+ public Builder() {
+ this(new ParentWithNullable());
+ }
+
+ protected Builder(ParentWithNullable instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ParentWithNullable value) {
+ this.instance.setType(value.type);
+ this.instance.setNullableProperty(value.nullableProperty);
+ return this;
+ }
+
+ public ParentWithNullable.Builder type(TypeEnum type) {
+ this.instance.type(type);
+ return this;
+ }
+
+ public ParentWithNullable.Builder nullableProperty(String nullableProperty) {
+ this.instance.nullableProperty(nullableProperty);
+ return this;
+ }
+
+ public ParentWithNullable.Builder nullableProperty(JsonNullable nullableProperty) {
+ this.instance.nullableProperty = nullableProperty;
+ return this;
+ }
+
+ /**
+ * returns a built ParentWithNullable instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ParentWithNullable build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ParentWithNullable.Builder builder() {
+ return new ParentWithNullable.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ParentWithNullable.Builder toBuilder() {
+ ParentWithNullable.Builder builder = new ParentWithNullable.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java
index 4e6fec4f209..f077901b3c0 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java
@@ -284,5 +284,95 @@ public class Pet {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Pet instance;
+
+ public Builder() {
+ this(new Pet());
+ }
+
+ protected Builder(Pet instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Pet value) {
+ this.instance.setId(value.id);
+ this.instance.setCategory(value.category);
+ this.instance.setName(value.name);
+ this.instance.setPhotoUrls(value.photoUrls);
+ this.instance.setTags(value.tags);
+ this.instance.setStatus(value.status);
+ return this;
+ }
+
+ public Pet.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Pet.Builder category(Category category) {
+ this.instance.category(category);
+ return this;
+ }
+
+ public Pet.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ public Pet.Builder photoUrls(Set photoUrls) {
+ this.instance.photoUrls(photoUrls);
+ return this;
+ }
+
+ public Pet.Builder tags(List<@Valid Tag> tags) {
+ this.instance.tags(tags);
+ return this;
+ }
+
+ @Deprecated
+ public Pet.Builder status(StatusEnum status) {
+ this.instance.status(status);
+ return this;
+ }
+ @Deprecated
+
+ /**
+ * returns a built Pet instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Pet build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Pet.Builder builder() {
+ return new Pet.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Pet.Builder toBuilder() {
+ Pet.Builder builder = new Pet.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java
index c4dee488a93..c681f43e9f7 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java
@@ -104,5 +104,69 @@ public class ReadOnlyFirst {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ReadOnlyFirst instance;
+
+ public Builder() {
+ this(new ReadOnlyFirst());
+ }
+
+ protected Builder(ReadOnlyFirst instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ReadOnlyFirst value) {
+ this.instance.setBar(value.bar);
+ this.instance.setBaz(value.baz);
+ return this;
+ }
+
+ public ReadOnlyFirst.Builder bar(String bar) {
+ this.instance.bar(bar);
+ return this;
+ }
+
+ public ReadOnlyFirst.Builder baz(String baz) {
+ this.instance.baz(baz);
+ return this;
+ }
+
+ /**
+ * returns a built ReadOnlyFirst instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ReadOnlyFirst build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ReadOnlyFirst.Builder builder() {
+ return new ReadOnlyFirst.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ReadOnlyFirst.Builder toBuilder() {
+ ReadOnlyFirst.Builder builder = new ReadOnlyFirst.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java
index dafef938f07..ae21f7e50e7 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ResponseObjectWithDifferentFieldNames.java
@@ -152,5 +152,81 @@ public class ResponseObjectWithDifferentFieldNames {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private ResponseObjectWithDifferentFieldNames instance;
+
+ public Builder() {
+ this(new ResponseObjectWithDifferentFieldNames());
+ }
+
+ protected Builder(ResponseObjectWithDifferentFieldNames instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(ResponseObjectWithDifferentFieldNames value) {
+ this.instance.setNormalPropertyName(value.normalPropertyName);
+ this.instance.setUPPERCASEPROPERTYSNAKE(value.UPPER_CASE_PROPERTY_SNAKE);
+ this.instance.setLowerCasePropertyDashes(value.lowerCasePropertyDashes);
+ this.instance.setPropertyNameWithSpaces(value.propertyNameWithSpaces);
+ return this;
+ }
+
+ public ResponseObjectWithDifferentFieldNames.Builder normalPropertyName(String normalPropertyName) {
+ this.instance.normalPropertyName(normalPropertyName);
+ return this;
+ }
+
+ public ResponseObjectWithDifferentFieldNames.Builder UPPER_CASE_PROPERTY_SNAKE(String UPPER_CASE_PROPERTY_SNAKE) {
+ this.instance.UPPER_CASE_PROPERTY_SNAKE(UPPER_CASE_PROPERTY_SNAKE);
+ return this;
+ }
+
+ public ResponseObjectWithDifferentFieldNames.Builder lowerCasePropertyDashes(String lowerCasePropertyDashes) {
+ this.instance.lowerCasePropertyDashes(lowerCasePropertyDashes);
+ return this;
+ }
+
+ public ResponseObjectWithDifferentFieldNames.Builder propertyNameWithSpaces(String propertyNameWithSpaces) {
+ this.instance.propertyNameWithSpaces(propertyNameWithSpaces);
+ return this;
+ }
+
+ /**
+ * returns a built ResponseObjectWithDifferentFieldNames instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public ResponseObjectWithDifferentFieldNames build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static ResponseObjectWithDifferentFieldNames.Builder builder() {
+ return new ResponseObjectWithDifferentFieldNames.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public ResponseObjectWithDifferentFieldNames.Builder toBuilder() {
+ ResponseObjectWithDifferentFieldNames.Builder builder = new ResponseObjectWithDifferentFieldNames.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java
index e4c8856cf7c..bdbcd884347 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java
@@ -82,5 +82,63 @@ public class SpecialModelName {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private SpecialModelName instance;
+
+ public Builder() {
+ this(new SpecialModelName());
+ }
+
+ protected Builder(SpecialModelName instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(SpecialModelName value) {
+ this.instance.set$SpecialPropertyName(value.$specialPropertyName);
+ return this;
+ }
+
+ public SpecialModelName.Builder $specialPropertyName(Long $specialPropertyName) {
+ this.instance.$specialPropertyName($specialPropertyName);
+ return this;
+ }
+
+ /**
+ * returns a built SpecialModelName instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public SpecialModelName build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static SpecialModelName.Builder builder() {
+ return new SpecialModelName.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public SpecialModelName.Builder toBuilder() {
+ SpecialModelName.Builder builder = new SpecialModelName.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java
index 1aa58e54b30..29d218fcfc2 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java
@@ -104,5 +104,69 @@ public class Tag {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private Tag instance;
+
+ public Builder() {
+ this(new Tag());
+ }
+
+ protected Builder(Tag instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(Tag value) {
+ this.instance.setId(value.id);
+ this.instance.setName(value.name);
+ return this;
+ }
+
+ public Tag.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public Tag.Builder name(String name) {
+ this.instance.name(name);
+ return this;
+ }
+
+ /**
+ * returns a built Tag instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public Tag build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static Tag.Builder builder() {
+ return new Tag.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public Tag.Builder toBuilder() {
+ Tag.Builder builder = new Tag.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java
index ee2790ac7c9..9062db776b8 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java
@@ -204,5 +204,87 @@ public class TypeHolderDefault {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private TypeHolderDefault instance;
+
+ public Builder() {
+ this(new TypeHolderDefault());
+ }
+
+ protected Builder(TypeHolderDefault instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(TypeHolderDefault value) {
+ this.instance.setStringItem(value.stringItem);
+ this.instance.setNumberItem(value.numberItem);
+ this.instance.setIntegerItem(value.integerItem);
+ this.instance.setBoolItem(value.boolItem);
+ this.instance.setArrayItem(value.arrayItem);
+ return this;
+ }
+
+ public TypeHolderDefault.Builder stringItem(String stringItem) {
+ this.instance.stringItem(stringItem);
+ return this;
+ }
+
+ public TypeHolderDefault.Builder numberItem(BigDecimal numberItem) {
+ this.instance.numberItem(numberItem);
+ return this;
+ }
+
+ public TypeHolderDefault.Builder integerItem(Integer integerItem) {
+ this.instance.integerItem(integerItem);
+ return this;
+ }
+
+ public TypeHolderDefault.Builder boolItem(Boolean boolItem) {
+ this.instance.boolItem(boolItem);
+ return this;
+ }
+
+ public TypeHolderDefault.Builder arrayItem(List arrayItem) {
+ this.instance.arrayItem(arrayItem);
+ return this;
+ }
+
+ /**
+ * returns a built TypeHolderDefault instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public TypeHolderDefault build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static TypeHolderDefault.Builder builder() {
+ return new TypeHolderDefault.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public TypeHolderDefault.Builder toBuilder() {
+ TypeHolderDefault.Builder builder = new TypeHolderDefault.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java
index 728785d71ad..edcd5d56253 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java
@@ -229,5 +229,93 @@ public class TypeHolderExample {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private TypeHolderExample instance;
+
+ public Builder() {
+ this(new TypeHolderExample());
+ }
+
+ protected Builder(TypeHolderExample instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(TypeHolderExample value) {
+ this.instance.setStringItem(value.stringItem);
+ this.instance.setNumberItem(value.numberItem);
+ this.instance.setFloatItem(value.floatItem);
+ this.instance.setIntegerItem(value.integerItem);
+ this.instance.setBoolItem(value.boolItem);
+ this.instance.setArrayItem(value.arrayItem);
+ return this;
+ }
+
+ public TypeHolderExample.Builder stringItem(String stringItem) {
+ this.instance.stringItem(stringItem);
+ return this;
+ }
+
+ public TypeHolderExample.Builder numberItem(BigDecimal numberItem) {
+ this.instance.numberItem(numberItem);
+ return this;
+ }
+
+ public TypeHolderExample.Builder floatItem(Float floatItem) {
+ this.instance.floatItem(floatItem);
+ return this;
+ }
+
+ public TypeHolderExample.Builder integerItem(Integer integerItem) {
+ this.instance.integerItem(integerItem);
+ return this;
+ }
+
+ public TypeHolderExample.Builder boolItem(Boolean boolItem) {
+ this.instance.boolItem(boolItem);
+ return this;
+ }
+
+ public TypeHolderExample.Builder arrayItem(List arrayItem) {
+ this.instance.arrayItem(arrayItem);
+ return this;
+ }
+
+ /**
+ * returns a built TypeHolderExample instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public TypeHolderExample build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static TypeHolderExample.Builder builder() {
+ return new TypeHolderExample.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public TypeHolderExample.Builder toBuilder() {
+ TypeHolderExample.Builder builder = new TypeHolderExample.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java
index 81ae1f82e67..4fc36367c73 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java
@@ -248,5 +248,105 @@ public class User {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private User instance;
+
+ public Builder() {
+ this(new User());
+ }
+
+ protected Builder(User instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(User value) {
+ this.instance.setId(value.id);
+ this.instance.setUsername(value.username);
+ this.instance.setFirstName(value.firstName);
+ this.instance.setLastName(value.lastName);
+ this.instance.setEmail(value.email);
+ this.instance.setPassword(value.password);
+ this.instance.setPhone(value.phone);
+ this.instance.setUserStatus(value.userStatus);
+ return this;
+ }
+
+ public User.Builder id(Long id) {
+ this.instance.id(id);
+ return this;
+ }
+
+ public User.Builder username(String username) {
+ this.instance.username(username);
+ return this;
+ }
+
+ public User.Builder firstName(String firstName) {
+ this.instance.firstName(firstName);
+ return this;
+ }
+
+ public User.Builder lastName(String lastName) {
+ this.instance.lastName(lastName);
+ return this;
+ }
+
+ public User.Builder email(String email) {
+ this.instance.email(email);
+ return this;
+ }
+
+ public User.Builder password(String password) {
+ this.instance.password(password);
+ return this;
+ }
+
+ public User.Builder phone(String phone) {
+ this.instance.phone(phone);
+ return this;
+ }
+
+ public User.Builder userStatus(Integer userStatus) {
+ this.instance.userStatus(userStatus);
+ return this;
+ }
+
+ /**
+ * returns a built User instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public User build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static User.Builder builder() {
+ return new User.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public User.Builder toBuilder() {
+ User.Builder builder = new User.Builder();
+ return builder.copyOf(this);
+ }
+
}
diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java
index 0ccdee97a00..027719ae764 100644
--- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java
+++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java
@@ -837,5 +837,231 @@ public class XmlItem {
}
return o.toString().replace("\n", "\n ");
}
+
+ public static class Builder {
+
+ private XmlItem instance;
+
+ public Builder() {
+ this(new XmlItem());
+ }
+
+ protected Builder(XmlItem instance) {
+ this.instance = instance;
+ }
+
+ protected Builder copyOf(XmlItem value) {
+ this.instance.setAttributeString(value.attributeString);
+ this.instance.setAttributeNumber(value.attributeNumber);
+ this.instance.setAttributeInteger(value.attributeInteger);
+ this.instance.setAttributeBoolean(value.attributeBoolean);
+ this.instance.setWrappedArray(value.wrappedArray);
+ this.instance.setNameString(value.nameString);
+ this.instance.setNameNumber(value.nameNumber);
+ this.instance.setNameInteger(value.nameInteger);
+ this.instance.setNameBoolean(value.nameBoolean);
+ this.instance.setNameArray(value.nameArray);
+ this.instance.setNameWrappedArray(value.nameWrappedArray);
+ this.instance.setPrefixString(value.prefixString);
+ this.instance.setPrefixNumber(value.prefixNumber);
+ this.instance.setPrefixInteger(value.prefixInteger);
+ this.instance.setPrefixBoolean(value.prefixBoolean);
+ this.instance.setPrefixArray(value.prefixArray);
+ this.instance.setPrefixWrappedArray(value.prefixWrappedArray);
+ this.instance.setNamespaceString(value.namespaceString);
+ this.instance.setNamespaceNumber(value.namespaceNumber);
+ this.instance.setNamespaceInteger(value.namespaceInteger);
+ this.instance.setNamespaceBoolean(value.namespaceBoolean);
+ this.instance.setNamespaceArray(value.namespaceArray);
+ this.instance.setNamespaceWrappedArray(value.namespaceWrappedArray);
+ this.instance.setPrefixNsString(value.prefixNsString);
+ this.instance.setPrefixNsNumber(value.prefixNsNumber);
+ this.instance.setPrefixNsInteger(value.prefixNsInteger);
+ this.instance.setPrefixNsBoolean(value.prefixNsBoolean);
+ this.instance.setPrefixNsArray(value.prefixNsArray);
+ this.instance.setPrefixNsWrappedArray(value.prefixNsWrappedArray);
+ return this;
+ }
+
+ public XmlItem.Builder attributeString(String attributeString) {
+ this.instance.attributeString(attributeString);
+ return this;
+ }
+
+ public XmlItem.Builder attributeNumber(BigDecimal attributeNumber) {
+ this.instance.attributeNumber(attributeNumber);
+ return this;
+ }
+
+ public XmlItem.Builder attributeInteger(Integer attributeInteger) {
+ this.instance.attributeInteger(attributeInteger);
+ return this;
+ }
+
+ public XmlItem.Builder attributeBoolean(Boolean attributeBoolean) {
+ this.instance.attributeBoolean(attributeBoolean);
+ return this;
+ }
+
+ public XmlItem.Builder wrappedArray(List wrappedArray) {
+ this.instance.wrappedArray(wrappedArray);
+ return this;
+ }
+
+ public XmlItem.Builder nameString(String nameString) {
+ this.instance.nameString(nameString);
+ return this;
+ }
+
+ public XmlItem.Builder nameNumber(BigDecimal nameNumber) {
+ this.instance.nameNumber(nameNumber);
+ return this;
+ }
+
+ public XmlItem.Builder nameInteger(Integer nameInteger) {
+ this.instance.nameInteger(nameInteger);
+ return this;
+ }
+
+ public XmlItem.Builder nameBoolean(Boolean nameBoolean) {
+ this.instance.nameBoolean(nameBoolean);
+ return this;
+ }
+
+ public XmlItem.Builder nameArray(List nameArray) {
+ this.instance.nameArray(nameArray);
+ return this;
+ }
+
+ public XmlItem.Builder nameWrappedArray(List nameWrappedArray) {
+ this.instance.nameWrappedArray(nameWrappedArray);
+ return this;
+ }
+
+ public XmlItem.Builder prefixString(String prefixString) {
+ this.instance.prefixString(prefixString);
+ return this;
+ }
+
+ public XmlItem.Builder prefixNumber(BigDecimal prefixNumber) {
+ this.instance.prefixNumber(prefixNumber);
+ return this;
+ }
+
+ public XmlItem.Builder prefixInteger(Integer prefixInteger) {
+ this.instance.prefixInteger(prefixInteger);
+ return this;
+ }
+
+ public XmlItem.Builder prefixBoolean(Boolean prefixBoolean) {
+ this.instance.prefixBoolean(prefixBoolean);
+ return this;
+ }
+
+ public XmlItem.Builder prefixArray(List prefixArray) {
+ this.instance.prefixArray(prefixArray);
+ return this;
+ }
+
+ public XmlItem.Builder prefixWrappedArray(List prefixWrappedArray) {
+ this.instance.prefixWrappedArray(prefixWrappedArray);
+ return this;
+ }
+
+ public XmlItem.Builder namespaceString(String namespaceString) {
+ this.instance.namespaceString(namespaceString);
+ return this;
+ }
+
+ public XmlItem.Builder namespaceNumber(BigDecimal namespaceNumber) {
+ this.instance.namespaceNumber(namespaceNumber);
+ return this;
+ }
+
+ public XmlItem.Builder namespaceInteger(Integer namespaceInteger) {
+ this.instance.namespaceInteger(namespaceInteger);
+ return this;
+ }
+
+ public XmlItem.Builder namespaceBoolean(Boolean namespaceBoolean) {
+ this.instance.namespaceBoolean(namespaceBoolean);
+ return this;
+ }
+
+ public XmlItem.Builder namespaceArray(List namespaceArray) {
+ this.instance.namespaceArray(namespaceArray);
+ return this;
+ }
+
+ public XmlItem.Builder namespaceWrappedArray(List namespaceWrappedArray) {
+ this.instance.namespaceWrappedArray(namespaceWrappedArray);
+ return this;
+ }
+
+ public XmlItem.Builder prefixNsString(String prefixNsString) {
+ this.instance.prefixNsString(prefixNsString);
+ return this;
+ }
+
+ public XmlItem.Builder prefixNsNumber(BigDecimal prefixNsNumber) {
+ this.instance.prefixNsNumber(prefixNsNumber);
+ return this;
+ }
+
+ public XmlItem.Builder prefixNsInteger(Integer prefixNsInteger) {
+ this.instance.prefixNsInteger(prefixNsInteger);
+ return this;
+ }
+
+ public XmlItem.Builder prefixNsBoolean(Boolean prefixNsBoolean) {
+ this.instance.prefixNsBoolean(prefixNsBoolean);
+ return this;
+ }
+
+ public XmlItem.Builder prefixNsArray(List prefixNsArray) {
+ this.instance.prefixNsArray(prefixNsArray);
+ return this;
+ }
+
+ public XmlItem.Builder prefixNsWrappedArray(List prefixNsWrappedArray) {
+ this.instance.prefixNsWrappedArray(prefixNsWrappedArray);
+ return this;
+ }
+
+ /**
+ * returns a built XmlItem instance.
+ *
+ * The builder is not reusable (NullPointerException)
+ */
+ public XmlItem build() {
+ try {
+ return this.instance;
+ } finally {
+ // ensure that this.instance is not reused
+ this.instance = null;
+ }
+ }
+
+ @Override
+ public String toString() {
+ return getClass() + "=(" + instance + ")";
+ }
+ }
+
+ /**
+ * Create a builder with no initialized field (except for the default values).
+ */
+ public static XmlItem.Builder builder() {
+ return new XmlItem.Builder();
+ }
+
+ /**
+ * Create a builder with a shallow copy of this instance.
+ */
+ public XmlItem.Builder toBuilder() {
+ XmlItem.Builder builder = new XmlItem.Builder();
+ return builder.copyOf(this);
+ }
+
}