forked from loafle/openapi-generator-original
* add builder pattern to java client and spring generator * regenerate samples * update doc --------- Co-authored-by: jpfinne <jeanpaul@finne.be>
This commit is contained in:
parent
2f734515a1
commit
51ef8683fb
@ -6,3 +6,4 @@ templateDir: modules/openapi-generator/src/main/resources/Java
|
||||
additionalProperties:
|
||||
artifactId: petstore-native
|
||||
hideGenerationTimestamp: "true"
|
||||
generateBuilders: true
|
||||
|
@ -9,3 +9,4 @@ additionalProperties:
|
||||
java8: true
|
||||
containerDefaultToNull: true
|
||||
generateConstructorWithAllArgs: true
|
||||
generateBuilders: true
|
||||
|
@ -12,3 +12,4 @@ additionalProperties:
|
||||
withXml: true
|
||||
hideGenerationTimestamp: "true"
|
||||
generateConstructorWithAllArgs: true
|
||||
generateBuilders: true
|
||||
|
@ -8,3 +8,4 @@ additionalProperties:
|
||||
hideGenerationTimestamp: "true"
|
||||
additionalModelTypeAnnotations: "@lombok.Data;@lombok.Builder;@lombok.NoArgsConstructor;@lombok.AllArgsConstructor"
|
||||
generateConstructorWithAllArgs: true
|
||||
generateBuilders: true
|
||||
|
@ -8,3 +8,4 @@ additionalProperties:
|
||||
artifactId: springboot-oneof
|
||||
snapshotVersion: "true"
|
||||
hideGenerationTimestamp: "true"
|
||||
generateBuilders: true
|
||||
|
@ -8,3 +8,4 @@ additionalProperties:
|
||||
useOptional: true
|
||||
artifactId: spring-boot-useoptional
|
||||
hideGenerationTimestamp: "true"
|
||||
generateBuilders: true
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -55,6 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**source**</dt><dd>Publish the original input OpenAPI specification.</dd><dt>**springfox**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.</dd><dt>**springdoc**</dt><dd>Generate an OpenAPI 3 specification using SpringDoc.</dd></dl>|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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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.|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|<dl><dt>**swagger2**</dt><dd>Use io.swagger.core.v3:swagger-annotations for annotating operations and schemas</dd><dt>**true**</dt><dd>Equivalent to "swagger2"</dd><dt>**false**</dt><dd>Do not generate swagger annotations</dd><dt>**swagger1**</dt><dd>Use io.swagger:swagger-annotations for annotating operations and schemas</dd></dl>|false|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -48,6 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**source**</dt><dd>Publish the original input OpenAPI specification.</dd><dt>**springfox**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.</dd><dt>**springdoc**</dt><dd>Generate an OpenAPI 3 specification using SpringDoc.</dd></dl>|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.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>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.</dd></dl>|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|
|
||||
|
@ -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<String, String> 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)) {
|
||||
|
@ -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)) {
|
||||
|
@ -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<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> objs) {
|
||||
objs = super.postProcessAllModels(objs);
|
||||
|
||||
Map<String, CodegenModel> 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) {
|
||||
|
82
modules/openapi-generator/src/main/resources/Java/javaBuilder.mustache
vendored
Normal file
82
modules/openapi-generator/src/main/resources/Java/javaBuilder.mustache
vendored
Normal file
@ -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}};
|
||||
}
|
@ -593,4 +593,8 @@ static {
|
||||
JSON.registerDiscriminator({{classname}}.class, "{{propertyBaseName}}", mappings);
|
||||
}
|
||||
{{/discriminator}}
|
||||
{{#generateBuilders}}
|
||||
|
||||
{{>javaBuilder}}
|
||||
{{/generateBuilders}}
|
||||
}
|
||||
|
@ -629,5 +629,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
|
||||
}
|
||||
};
|
||||
{{/parcelableModel}}
|
||||
{{#generateBuilders}}
|
||||
|
||||
{{>javaBuilder}}
|
||||
{{/generateBuilders}}
|
||||
|
||||
}
|
||||
|
96
modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache
vendored
Normal file
96
modules/openapi-generator/src/main/resources/JavaSpring/javaBuilder.mustache
vendored
Normal file
@ -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<String, {{{.}}}> 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);
|
||||
}
|
@ -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}}
|
||||
}
|
||||
|
@ -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"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -3456,4 +3456,22 @@ public class JavaClientCodegenTest {
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBuilderJavaClient() throws IOException {
|
||||
Map<String, File> 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())");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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<String, File> 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<String, Integer> additionalProperties) {",
|
||||
"SimpleObject.Builder nullableObject(String nullableObject) {",
|
||||
"SimpleObject.Builder nb(BigDecimal nb) {")
|
||||
.fileDoesNotContains("SimpleObject.Builder nullableObject(JsonNullable<String> nullableObject) {");
|
||||
}
|
||||
|
||||
@Test
|
||||
void testBuilderJavaSpring_useOptional() throws IOException {
|
||||
Map<String, File> 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<String, Integer> additionalProperties) {",
|
||||
"SimpleObject.Builder nullableObject(String nullableObject) {",
|
||||
"SimpleObject.Builder nullableObject(JsonNullable<String> nullableObject) {",
|
||||
"SimpleObject.Builder nb(BigDecimal nb) {");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void optionalListShouldBeEmpty() throws IOException {
|
||||
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
|
||||
|
@ -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'
|
2
pom.xml
2
pom.xml
@ -1263,4 +1263,4 @@
|
||||
<wagon-svn.version>1.12</wagon-svn.version>
|
||||
<wagon-webdav.version>1.0-beta-2</wagon-webdav.version>
|
||||
</properties>
|
||||
</project>
|
||||
</project>
|
||||
|
@ -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<String, String> mapProperty) {
|
||||
this.instance.mapProperty = mapProperty;
|
||||
return this;
|
||||
}
|
||||
public AdditionalPropertiesClass.Builder mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
|
||||
this.instance.mapOfMapProperty = mapOfMapProperty;
|
||||
return this;
|
||||
}
|
||||
public AdditionalPropertiesClass.Builder anytype1(Object anytype1) {
|
||||
this.instance.anytype1 = JsonNullable.<Object>of(anytype1);
|
||||
return this;
|
||||
}
|
||||
public AdditionalPropertiesClass.Builder anytype1(JsonNullable<Object> 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<String, Object> mapWithUndeclaredPropertiesAnytype3) {
|
||||
this.instance.mapWithUndeclaredPropertiesAnytype3 = mapWithUndeclaredPropertiesAnytype3;
|
||||
return this;
|
||||
}
|
||||
public AdditionalPropertiesClass.Builder emptyMap(Object emptyMap) {
|
||||
this.instance.emptyMap = emptyMap;
|
||||
return this;
|
||||
}
|
||||
public AdditionalPropertiesClass.Builder mapWithUndeclaredPropertiesString(Map<String, String> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<List<BigDecimal>> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<BigDecimal> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<String> arrayOfString) {
|
||||
this.instance.arrayOfString = arrayOfString;
|
||||
return this;
|
||||
}
|
||||
public ArrayTest.Builder arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
|
||||
this.instance.arrayArrayOfInteger = arrayArrayOfInteger;
|
||||
return this;
|
||||
}
|
||||
public ArrayTest.Builder arrayArrayOfModel(List<List<ReadOnlyFirst>> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -349,5 +349,78 @@ public class Drawing extends HashMap<String, Fruit> {
|
||||
|
||||
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.<NullableShape>of(nullableShape);
|
||||
return this;
|
||||
}
|
||||
public Drawing.Builder nullableShape(JsonNullable<NullableShape> nullableShape) {
|
||||
this.instance.nullableShape = nullableShape;
|
||||
return this;
|
||||
}
|
||||
public Drawing.Builder shapes(List<Shape> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<ArrayEnumEnum> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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.<OuterEnum>of(outerEnum);
|
||||
return this;
|
||||
}
|
||||
public EnumTest.Builder outerEnum(JsonNullable<OuterEnum> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<String, BigDecimal> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<ModelFile> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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.<String>of(nullableMessage);
|
||||
return this;
|
||||
}
|
||||
public HealthCheckResult.Builder nullableMessage(JsonNullable<String> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<String, Map<String, String>> mapMapOfString) {
|
||||
this.instance.mapMapOfString = mapMapOfString;
|
||||
return this;
|
||||
}
|
||||
public MapTest.Builder mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
|
||||
this.instance.mapOfEnumString = mapOfEnumString;
|
||||
return this;
|
||||
}
|
||||
public MapTest.Builder directMap(Map<String, Boolean> directMap) {
|
||||
this.instance.directMap = directMap;
|
||||
return this;
|
||||
}
|
||||
public MapTest.Builder indirectMap(Map<String, Boolean> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<String, Animal> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -783,5 +783,154 @@ public class NullableClass extends HashMap<String, Object> {
|
||||
|
||||
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.<Integer>of(integerProp);
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder integerProp(JsonNullable<Integer> integerProp) {
|
||||
this.instance.integerProp = integerProp;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder numberProp(BigDecimal numberProp) {
|
||||
this.instance.numberProp = JsonNullable.<BigDecimal>of(numberProp);
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder numberProp(JsonNullable<BigDecimal> numberProp) {
|
||||
this.instance.numberProp = numberProp;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder booleanProp(Boolean booleanProp) {
|
||||
this.instance.booleanProp = JsonNullable.<Boolean>of(booleanProp);
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder booleanProp(JsonNullable<Boolean> booleanProp) {
|
||||
this.instance.booleanProp = booleanProp;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder stringProp(String stringProp) {
|
||||
this.instance.stringProp = JsonNullable.<String>of(stringProp);
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder stringProp(JsonNullable<String> stringProp) {
|
||||
this.instance.stringProp = stringProp;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder dateProp(LocalDate dateProp) {
|
||||
this.instance.dateProp = JsonNullable.<LocalDate>of(dateProp);
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder dateProp(JsonNullable<LocalDate> dateProp) {
|
||||
this.instance.dateProp = dateProp;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder datetimeProp(OffsetDateTime datetimeProp) {
|
||||
this.instance.datetimeProp = JsonNullable.<OffsetDateTime>of(datetimeProp);
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder datetimeProp(JsonNullable<OffsetDateTime> datetimeProp) {
|
||||
this.instance.datetimeProp = datetimeProp;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder arrayNullableProp(List<Object> arrayNullableProp) {
|
||||
this.instance.arrayNullableProp = JsonNullable.<List<Object>>of(arrayNullableProp);
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder arrayNullableProp(JsonNullable<List<Object>> arrayNullableProp) {
|
||||
this.instance.arrayNullableProp = arrayNullableProp;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder arrayAndItemsNullableProp(List<Object> arrayAndItemsNullableProp) {
|
||||
this.instance.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(arrayAndItemsNullableProp);
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder arrayAndItemsNullableProp(JsonNullable<List<Object>> arrayAndItemsNullableProp) {
|
||||
this.instance.arrayAndItemsNullableProp = arrayAndItemsNullableProp;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder arrayItemsNullable(List<Object> arrayItemsNullable) {
|
||||
this.instance.arrayItemsNullable = arrayItemsNullable;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder objectNullableProp(Map<String, Object> objectNullableProp) {
|
||||
this.instance.objectNullableProp = JsonNullable.<Map<String, Object>>of(objectNullableProp);
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder objectNullableProp(JsonNullable<Map<String, Object>> objectNullableProp) {
|
||||
this.instance.objectNullableProp = objectNullableProp;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder objectAndItemsNullableProp(Map<String, Object> objectAndItemsNullableProp) {
|
||||
this.instance.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(objectAndItemsNullableProp);
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder objectAndItemsNullableProp(JsonNullable<Map<String, Object>> objectAndItemsNullableProp) {
|
||||
this.instance.objectAndItemsNullableProp = objectAndItemsNullableProp;
|
||||
return this;
|
||||
}
|
||||
public NullableClass.Builder objectItemsNullable(Map<String, Object> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<String> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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<String> photoUrls) {
|
||||
this.instance.photoUrls = photoUrls;
|
||||
return this;
|
||||
}
|
||||
public Pet.Builder tags(List<Tag> 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -199,5 +199,59 @@ public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap<Strin
|
||||
|
||||
return joiner.toString();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
|
||||
private TestInlineFreeformAdditionalPropertiesRequest instance;
|
||||
|
||||
public Builder() {
|
||||
this(new TestInlineFreeformAdditionalPropertiesRequest());
|
||||
}
|
||||
|
||||
protected Builder(TestInlineFreeformAdditionalPropertiesRequest instance) {
|
||||
this.instance = instance;
|
||||
}
|
||||
|
||||
public TestInlineFreeformAdditionalPropertiesRequest.Builder someProperty(String someProperty) {
|
||||
this.instance.someProperty = someProperty;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* returns a built TestInlineFreeformAdditionalPropertiesRequest instance.
|
||||
*
|
||||
* The builder is not reusable.
|
||||
*/
|
||||
public TestInlineFreeformAdditionalPropertiesRequest 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 TestInlineFreeformAdditionalPropertiesRequest.Builder builder() {
|
||||
return new TestInlineFreeformAdditionalPropertiesRequest.Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a builder with a shallow copy of this instance.
|
||||
*/
|
||||
public TestInlineFreeformAdditionalPropertiesRequest.Builder toBuilder() {
|
||||
return new TestInlineFreeformAdditionalPropertiesRequest.Builder()
|
||||
.someProperty(getSomeProperty());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user