Record Class Options
java.lang.Object
java.lang.Record
io.github.torand.openapi2java.generators.Options
- Record Components:
outputDir- the root directory of output.rootPackage- the root package of classes and enums.rootUrlPath- the root URL path for resources.resourceNameSuffix- the resource name suffix.resourceNameOverride- the resource name override.resourceConfigKeyOverride- the resource config-key override.resourceClientHeadersFactoryOverride- the resource client headers factory override.resourceProvidersOverride- the resource providers override.pojoNameSuffix- the Pojo name suffix.pojosAsRecords- the flag to use Java records for Pojos.includeTags- the tags to generate source code for. Includes all tags if not specified.generateResourceInterfaces- the flag to generate resource interfaces (one for each tag included).generateOpenApiDefClass- the flag to generate an OpenAPI definition class file with implementation oriented annotations.addJsonPropertyAnnotations- the flag to generate Jackson JSON property annotations.addJakartaBeanValidationAnnotations- the flag to generate Jakarta Bean Validation annotations.addMpOpenApiAnnotations- the flag to generate Microprofile OpenAPI annotations.addMpRestClientAnnotations- the flag to generate Microprofile Rest Client annotations (on resource interfaces).useKotlinSyntax- the flag to generate Kotlin source code.useResteasyResponse- the flag to use the more typesafeRestResponsefrom RESTEasy instead of the normal untypedResponsefrom Jakarta WS core.useOidcClientAnnotation- the flag to generate Quarkus OIDC client annotation (on resource interfaces).indentWithTab- the flag to output indents with the tab character.indentSize- the number of spaces for each indent level, when not using the tab character.verbose- the flag to enable verbose logging.
public record Options(String outputDir, String rootPackage, String rootUrlPath, String resourceNameSuffix, String resourceNameOverride, String resourceConfigKeyOverride, String resourceClientHeadersFactoryOverride, List<String> resourceProvidersOverride, String pojoNameSuffix, boolean pojosAsRecords, List<String> includeTags, boolean generateResourceInterfaces, boolean generateOpenApiDefClass, boolean addJsonPropertyAnnotations, boolean addJakartaBeanValidationAnnotations, boolean addMpOpenApiAnnotations, boolean addMpRestClientAnnotations, boolean useKotlinSyntax, boolean useResteasyResponse, boolean useOidcClientAnnotation, boolean indentWithTab, int indentSize, boolean verbose)
extends Record
Contains configuration of the source code generators.
-
Constructor Summary
ConstructorsConstructorDescriptionOptions(String outputDir, String rootPackage, String rootUrlPath, String resourceNameSuffix, String resourceNameOverride, String resourceConfigKeyOverride, String resourceClientHeadersFactoryOverride, List<String> resourceProvidersOverride, String pojoNameSuffix, boolean pojosAsRecords, List<String> includeTags, boolean generateResourceInterfaces, boolean generateOpenApiDefClass, boolean addJsonPropertyAnnotations, boolean addJakartaBeanValidationAnnotations, boolean addMpOpenApiAnnotations, boolean addMpRestClientAnnotations, boolean useKotlinSyntax, boolean useResteasyResponse, boolean useOidcClientAnnotation, boolean indentWithTab, int indentSize, boolean verbose) Creates an instance of aOptionsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theaddJakartaBeanValidationAnnotationsrecord component.booleanReturns the value of theaddJsonPropertyAnnotationsrecord component.booleanReturns the value of theaddMpOpenApiAnnotationsrecord component.booleanReturns the value of theaddMpRestClientAnnotationsrecord component.static Optionsdefaults()Returns the default settings.final booleanIndicates whether some other object is "equal to" this one.booleanReturns the value of thegenerateOpenApiDefClassrecord component.booleanReturns the value of thegenerateResourceInterfacesrecord component.Gets the language specific code file extension.getModelOutputDir(String customSubdir) Returns a newOptionsobject with specified model output directory.getModelPackage(String customSubpackage) Returns a newOptionsobject with specified model package.final inthashCode()Returns a hash code value for this object.Returns the value of theincludeTagsrecord component.intReturns the value of theindentSizerecord component.booleanReturns the value of theindentWithTabrecord component.Returns the value of theoutputDirrecord component.Returns the value of thepojoNameSuffixrecord component.booleanReturns the value of thepojosAsRecordsrecord component.Returns the value of theresourceClientHeadersFactoryOverriderecord component.Returns the value of theresourceConfigKeyOverriderecord component.Returns the value of theresourceNameOverriderecord component.Returns the value of theresourceNameSuffixrecord component.Returns the value of theresourceProvidersOverriderecord component.Returns the value of therootPackagerecord component.Returns the value of therootUrlPathrecord component.final StringtoString()Returns a string representation of this record class.booleanReturns the value of theuseKotlinSyntaxrecord component.booleanReturns the value of theuseOidcClientAnnotationrecord component.booleanReturns the value of theuseResteasyResponserecord component.booleanverbose()Returns the value of theverboserecord component.withIncludeTags(List<String> includeTags) Returns a newOptionsobject with specified included tags.withOutputDir(String outputDir) Returns a newOptionsobject with specified output directory.withResourceClientHeadersFactoryOverride(String resourceClientHeadersFactoryOverride) Returns a newOptionsobject with specified resource client headers factory override.withResourceConfigKeyOverride(String resourceConfigKeyOverride) Returns a newOptionsobject with specified resource config-key override.withResourceNameOverride(String resourceNameOverride) Returns a newOptionsobject with specified resource name override.withResourceNameSuffix(String resourceNameSuffix) Returns a newOptionsobject with specified resource name suffix.withResourceProvidersOverride(List<String> resourceProvidersOverride) Returns a newOptionsobject with specified resource providers override.withRootPackage(String rootPackage) Returns a newOptionsobject with specified root package.withUseKotlinSyntax(boolean useKotlinSyntax) Returns a newOptionsobject with specified use Kotlin flag.withUseOidcClientAnnotation(boolean useOidcClientAnnotation) Returns a newOptionsobject with specified use OIDC Client annotation flag.withUseResteasyResponse(boolean useResteasyResponse) Returns a newOptionsobject with specified use RESTEasy flag.withVerbose(boolean verbose) Returns a newOptionsobject with specified verbose flag.
-
Constructor Details
-
Options
public Options(String outputDir, String rootPackage, String rootUrlPath, String resourceNameSuffix, String resourceNameOverride, String resourceConfigKeyOverride, String resourceClientHeadersFactoryOverride, List<String> resourceProvidersOverride, String pojoNameSuffix, boolean pojosAsRecords, List<String> includeTags, boolean generateResourceInterfaces, boolean generateOpenApiDefClass, boolean addJsonPropertyAnnotations, boolean addJakartaBeanValidationAnnotations, boolean addMpOpenApiAnnotations, boolean addMpRestClientAnnotations, boolean useKotlinSyntax, boolean useResteasyResponse, boolean useOidcClientAnnotation, boolean indentWithTab, int indentSize, boolean verbose) Creates an instance of aOptionsrecord class.- Parameters:
outputDir- the value for theoutputDirrecord componentrootPackage- the value for therootPackagerecord componentrootUrlPath- the value for therootUrlPathrecord componentresourceNameSuffix- the value for theresourceNameSuffixrecord componentresourceNameOverride- the value for theresourceNameOverriderecord componentresourceConfigKeyOverride- the value for theresourceConfigKeyOverriderecord componentresourceClientHeadersFactoryOverride- the value for theresourceClientHeadersFactoryOverriderecord componentresourceProvidersOverride- the value for theresourceProvidersOverriderecord componentpojoNameSuffix- the value for thepojoNameSuffixrecord componentpojosAsRecords- the value for thepojosAsRecordsrecord componentincludeTags- the value for theincludeTagsrecord componentgenerateResourceInterfaces- the value for thegenerateResourceInterfacesrecord componentgenerateOpenApiDefClass- the value for thegenerateOpenApiDefClassrecord componentaddJsonPropertyAnnotations- the value for theaddJsonPropertyAnnotationsrecord componentaddJakartaBeanValidationAnnotations- the value for theaddJakartaBeanValidationAnnotationsrecord componentaddMpOpenApiAnnotations- the value for theaddMpOpenApiAnnotationsrecord componentaddMpRestClientAnnotations- the value for theaddMpRestClientAnnotationsrecord componentuseKotlinSyntax- the value for theuseKotlinSyntaxrecord componentuseResteasyResponse- the value for theuseResteasyResponserecord componentuseOidcClientAnnotation- the value for theuseOidcClientAnnotationrecord componentindentWithTab- the value for theindentWithTabrecord componentindentSize- the value for theindentSizerecord componentverbose- the value for theverboserecord component
-
-
Method Details
-
defaults
Returns the default settings.- Returns:
- the default settings.
-
withOutputDir
Returns a newOptionsobject with specified output directory.- Parameters:
outputDir- the output directory.- Returns:
- the new and updated
Optionsobject.
-
withRootPackage
Returns a newOptionsobject with specified root package.- Parameters:
rootPackage- the root package.- Returns:
- the new and updated
Optionsobject.
-
withResourceNameSuffix
Returns a newOptionsobject with specified resource name suffix.- Parameters:
resourceNameSuffix- the resource name suffix.- Returns:
- the new and updated
Optionsobject.
-
withResourceNameOverride
Returns a newOptionsobject with specified resource name override.- Parameters:
resourceNameOverride- the resource name override.- Returns:
- the new and updated
Optionsobject.
-
withResourceConfigKeyOverride
Returns a newOptionsobject with specified resource config-key override.- Parameters:
resourceConfigKeyOverride- the resource config-key override.- Returns:
- the new and updated
Optionsobject.
-
withResourceClientHeadersFactoryOverride
public Options withResourceClientHeadersFactoryOverride(String resourceClientHeadersFactoryOverride) Returns a newOptionsobject with specified resource client headers factory override.- Parameters:
resourceClientHeadersFactoryOverride- the resource client headers factory override.- Returns:
- the new and updated
Optionsobject.
-
withResourceProvidersOverride
Returns a newOptionsobject with specified resource providers override.- Parameters:
resourceProvidersOverride- the resource providers override.- Returns:
- the new and updated
Optionsobject.
-
withIncludeTags
Returns a newOptionsobject with specified included tags.- Parameters:
includeTags- the included tags.- Returns:
- the new and updated
Optionsobject.
-
withUseKotlinSyntax
Returns a newOptionsobject with specified use Kotlin flag.- Parameters:
useKotlinSyntax- the use Kotlin flag.- Returns:
- the new and updated
Optionsobject.
-
withUseResteasyResponse
Returns a newOptionsobject with specified use RESTEasy flag.- Parameters:
useResteasyResponse- the use RESTEasy flag.- Returns:
- the new and updated
Optionsobject.
-
withUseOidcClientAnnotation
Returns a newOptionsobject with specified use OIDC Client annotation flag.- Parameters:
useOidcClientAnnotation- the use OIDC Client annotation flag.- Returns:
- the new and updated
Optionsobject.
-
withVerbose
Returns a newOptionsobject with specified verbose flag.- Parameters:
verbose- the verbose flag.- Returns:
- the new and updated
Optionsobject.
-
getModelOutputDir
Returns a newOptionsobject with specified model output directory.- Parameters:
customSubdir- the model output directory.- Returns:
- the new and updated
Optionsobject.
-
getModelPackage
Returns a newOptionsobject with specified model package.- Parameters:
customSubpackage- the model subpackage.- Returns:
- the new and updated
Optionsobject.
-
getFileExtension
Gets the language specific code file extension.- Returns:
- the language specific code file extension.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
outputDir
Returns the value of theoutputDirrecord component.- Returns:
- the value of the
outputDirrecord component
-
rootPackage
Returns the value of therootPackagerecord component.- Returns:
- the value of the
rootPackagerecord component
-
rootUrlPath
Returns the value of therootUrlPathrecord component.- Returns:
- the value of the
rootUrlPathrecord component
-
resourceNameSuffix
Returns the value of theresourceNameSuffixrecord component.- Returns:
- the value of the
resourceNameSuffixrecord component
-
resourceNameOverride
Returns the value of theresourceNameOverriderecord component.- Returns:
- the value of the
resourceNameOverriderecord component
-
resourceConfigKeyOverride
Returns the value of theresourceConfigKeyOverriderecord component.- Returns:
- the value of the
resourceConfigKeyOverriderecord component
-
resourceClientHeadersFactoryOverride
Returns the value of theresourceClientHeadersFactoryOverriderecord component.- Returns:
- the value of the
resourceClientHeadersFactoryOverriderecord component
-
resourceProvidersOverride
Returns the value of theresourceProvidersOverriderecord component.- Returns:
- the value of the
resourceProvidersOverriderecord component
-
pojoNameSuffix
Returns the value of thepojoNameSuffixrecord component.- Returns:
- the value of the
pojoNameSuffixrecord component
-
pojosAsRecords
public boolean pojosAsRecords()Returns the value of thepojosAsRecordsrecord component.- Returns:
- the value of the
pojosAsRecordsrecord component
-
includeTags
Returns the value of theincludeTagsrecord component.- Returns:
- the value of the
includeTagsrecord component
-
generateResourceInterfaces
public boolean generateResourceInterfaces()Returns the value of thegenerateResourceInterfacesrecord component.- Returns:
- the value of the
generateResourceInterfacesrecord component
-
generateOpenApiDefClass
public boolean generateOpenApiDefClass()Returns the value of thegenerateOpenApiDefClassrecord component.- Returns:
- the value of the
generateOpenApiDefClassrecord component
-
addJsonPropertyAnnotations
public boolean addJsonPropertyAnnotations()Returns the value of theaddJsonPropertyAnnotationsrecord component.- Returns:
- the value of the
addJsonPropertyAnnotationsrecord component
-
addJakartaBeanValidationAnnotations
public boolean addJakartaBeanValidationAnnotations()Returns the value of theaddJakartaBeanValidationAnnotationsrecord component.- Returns:
- the value of the
addJakartaBeanValidationAnnotationsrecord component
-
addMpOpenApiAnnotations
public boolean addMpOpenApiAnnotations()Returns the value of theaddMpOpenApiAnnotationsrecord component.- Returns:
- the value of the
addMpOpenApiAnnotationsrecord component
-
addMpRestClientAnnotations
public boolean addMpRestClientAnnotations()Returns the value of theaddMpRestClientAnnotationsrecord component.- Returns:
- the value of the
addMpRestClientAnnotationsrecord component
-
useKotlinSyntax
public boolean useKotlinSyntax()Returns the value of theuseKotlinSyntaxrecord component.- Returns:
- the value of the
useKotlinSyntaxrecord component
-
useResteasyResponse
public boolean useResteasyResponse()Returns the value of theuseResteasyResponserecord component.- Returns:
- the value of the
useResteasyResponserecord component
-
useOidcClientAnnotation
public boolean useOidcClientAnnotation()Returns the value of theuseOidcClientAnnotationrecord component.- Returns:
- the value of the
useOidcClientAnnotationrecord component
-
indentWithTab
public boolean indentWithTab()Returns the value of theindentWithTabrecord component.- Returns:
- the value of the
indentWithTabrecord component
-
indentSize
public int indentSize()Returns the value of theindentSizerecord component.- Returns:
- the value of the
indentSizerecord component
-
verbose
public boolean verbose()Returns the value of theverboserecord component.- Returns:
- the value of the
verboserecord component
-