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 typesafe RestResponse from RESTEasy instead of the normal untyped Response from 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 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 a Options record class.
      Parameters:
      outputDir - the value for the outputDir record component
      rootPackage - the value for the rootPackage record component
      rootUrlPath - the value for the rootUrlPath record component
      resourceNameSuffix - the value for the resourceNameSuffix record component
      resourceNameOverride - the value for the resourceNameOverride record component
      resourceConfigKeyOverride - the value for the resourceConfigKeyOverride record component
      resourceClientHeadersFactoryOverride - the value for the resourceClientHeadersFactoryOverride record component
      resourceProvidersOverride - the value for the resourceProvidersOverride record component
      pojoNameSuffix - the value for the pojoNameSuffix record component
      pojosAsRecords - the value for the pojosAsRecords record component
      includeTags - the value for the includeTags record component
      generateResourceInterfaces - the value for the generateResourceInterfaces record component
      generateOpenApiDefClass - the value for the generateOpenApiDefClass record component
      addJsonPropertyAnnotations - the value for the addJsonPropertyAnnotations record component
      addJakartaBeanValidationAnnotations - the value for the addJakartaBeanValidationAnnotations record component
      addMpOpenApiAnnotations - the value for the addMpOpenApiAnnotations record component
      addMpRestClientAnnotations - the value for the addMpRestClientAnnotations record component
      useKotlinSyntax - the value for the useKotlinSyntax record component
      useResteasyResponse - the value for the useResteasyResponse record component
      useOidcClientAnnotation - the value for the useOidcClientAnnotation record component
      indentWithTab - the value for the indentWithTab record component
      indentSize - the value for the indentSize record component
      verbose - the value for the verbose record component
  • Method Details

    • defaults

      public static Options defaults()
      Returns the default settings.
      Returns:
      the default settings.
    • withOutputDir

      public Options withOutputDir(String outputDir)
      Returns a new Options object with specified output directory.
      Parameters:
      outputDir - the output directory.
      Returns:
      the new and updated Options object.
    • withRootPackage

      public Options withRootPackage(String rootPackage)
      Returns a new Options object with specified root package.
      Parameters:
      rootPackage - the root package.
      Returns:
      the new and updated Options object.
    • withResourceNameSuffix

      public Options withResourceNameSuffix(String resourceNameSuffix)
      Returns a new Options object with specified resource name suffix.
      Parameters:
      resourceNameSuffix - the resource name suffix.
      Returns:
      the new and updated Options object.
    • withResourceNameOverride

      public Options withResourceNameOverride(String resourceNameOverride)
      Returns a new Options object with specified resource name override.
      Parameters:
      resourceNameOverride - the resource name override.
      Returns:
      the new and updated Options object.
    • withResourceConfigKeyOverride

      public Options withResourceConfigKeyOverride(String resourceConfigKeyOverride)
      Returns a new Options object with specified resource config-key override.
      Parameters:
      resourceConfigKeyOverride - the resource config-key override.
      Returns:
      the new and updated Options object.
    • withResourceClientHeadersFactoryOverride

      public Options withResourceClientHeadersFactoryOverride(String resourceClientHeadersFactoryOverride)
      Returns a new Options object with specified resource client headers factory override.
      Parameters:
      resourceClientHeadersFactoryOverride - the resource client headers factory override.
      Returns:
      the new and updated Options object.
    • withResourceProvidersOverride

      public Options withResourceProvidersOverride(List<String> resourceProvidersOverride)
      Returns a new Options object with specified resource providers override.
      Parameters:
      resourceProvidersOverride - the resource providers override.
      Returns:
      the new and updated Options object.
    • withIncludeTags

      public Options withIncludeTags(List<String> includeTags)
      Returns a new Options object with specified included tags.
      Parameters:
      includeTags - the included tags.
      Returns:
      the new and updated Options object.
    • withUseKotlinSyntax

      public Options withUseKotlinSyntax(boolean useKotlinSyntax)
      Returns a new Options object with specified use Kotlin flag.
      Parameters:
      useKotlinSyntax - the use Kotlin flag.
      Returns:
      the new and updated Options object.
    • withUseResteasyResponse

      public Options withUseResteasyResponse(boolean useResteasyResponse)
      Returns a new Options object with specified use RESTEasy flag.
      Parameters:
      useResteasyResponse - the use RESTEasy flag.
      Returns:
      the new and updated Options object.
    • withUseOidcClientAnnotation

      public Options withUseOidcClientAnnotation(boolean useOidcClientAnnotation)
      Returns a new Options object with specified use OIDC Client annotation flag.
      Parameters:
      useOidcClientAnnotation - the use OIDC Client annotation flag.
      Returns:
      the new and updated Options object.
    • withVerbose

      public Options withVerbose(boolean verbose)
      Returns a new Options object with specified verbose flag.
      Parameters:
      verbose - the verbose flag.
      Returns:
      the new and updated Options object.
    • getModelOutputDir

      public String getModelOutputDir(String customSubdir)
      Returns a new Options object with specified model output directory.
      Parameters:
      customSubdir - the model output directory.
      Returns:
      the new and updated Options object.
    • getModelPackage

      public String getModelPackage(String customSubpackage)
      Returns a new Options object with specified model package.
      Parameters:
      customSubpackage - the model subpackage.
      Returns:
      the new and updated Options object.
    • getFileExtension

      public String getFileExtension()
      Gets the language specific code file extension.
      Returns:
      the language specific code file extension.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • outputDir

      public String outputDir()
      Returns the value of the outputDir record component.
      Returns:
      the value of the outputDir record component
    • rootPackage

      public String rootPackage()
      Returns the value of the rootPackage record component.
      Returns:
      the value of the rootPackage record component
    • rootUrlPath

      public String rootUrlPath()
      Returns the value of the rootUrlPath record component.
      Returns:
      the value of the rootUrlPath record component
    • resourceNameSuffix

      public String resourceNameSuffix()
      Returns the value of the resourceNameSuffix record component.
      Returns:
      the value of the resourceNameSuffix record component
    • resourceNameOverride

      public String resourceNameOverride()
      Returns the value of the resourceNameOverride record component.
      Returns:
      the value of the resourceNameOverride record component
    • resourceConfigKeyOverride

      public String resourceConfigKeyOverride()
      Returns the value of the resourceConfigKeyOverride record component.
      Returns:
      the value of the resourceConfigKeyOverride record component
    • resourceClientHeadersFactoryOverride

      public String resourceClientHeadersFactoryOverride()
      Returns the value of the resourceClientHeadersFactoryOverride record component.
      Returns:
      the value of the resourceClientHeadersFactoryOverride record component
    • resourceProvidersOverride

      public List<String> resourceProvidersOverride()
      Returns the value of the resourceProvidersOverride record component.
      Returns:
      the value of the resourceProvidersOverride record component
    • pojoNameSuffix

      public String pojoNameSuffix()
      Returns the value of the pojoNameSuffix record component.
      Returns:
      the value of the pojoNameSuffix record component
    • pojosAsRecords

      public boolean pojosAsRecords()
      Returns the value of the pojosAsRecords record component.
      Returns:
      the value of the pojosAsRecords record component
    • includeTags

      public List<String> includeTags()
      Returns the value of the includeTags record component.
      Returns:
      the value of the includeTags record component
    • generateResourceInterfaces

      public boolean generateResourceInterfaces()
      Returns the value of the generateResourceInterfaces record component.
      Returns:
      the value of the generateResourceInterfaces record component
    • generateOpenApiDefClass

      public boolean generateOpenApiDefClass()
      Returns the value of the generateOpenApiDefClass record component.
      Returns:
      the value of the generateOpenApiDefClass record component
    • addJsonPropertyAnnotations

      public boolean addJsonPropertyAnnotations()
      Returns the value of the addJsonPropertyAnnotations record component.
      Returns:
      the value of the addJsonPropertyAnnotations record component
    • addJakartaBeanValidationAnnotations

      public boolean addJakartaBeanValidationAnnotations()
      Returns the value of the addJakartaBeanValidationAnnotations record component.
      Returns:
      the value of the addJakartaBeanValidationAnnotations record component
    • addMpOpenApiAnnotations

      public boolean addMpOpenApiAnnotations()
      Returns the value of the addMpOpenApiAnnotations record component.
      Returns:
      the value of the addMpOpenApiAnnotations record component
    • addMpRestClientAnnotations

      public boolean addMpRestClientAnnotations()
      Returns the value of the addMpRestClientAnnotations record component.
      Returns:
      the value of the addMpRestClientAnnotations record component
    • useKotlinSyntax

      public boolean useKotlinSyntax()
      Returns the value of the useKotlinSyntax record component.
      Returns:
      the value of the useKotlinSyntax record component
    • useResteasyResponse

      public boolean useResteasyResponse()
      Returns the value of the useResteasyResponse record component.
      Returns:
      the value of the useResteasyResponse record component
    • useOidcClientAnnotation

      public boolean useOidcClientAnnotation()
      Returns the value of the useOidcClientAnnotation record component.
      Returns:
      the value of the useOidcClientAnnotation record component
    • indentWithTab

      public boolean indentWithTab()
      Returns the value of the indentWithTab record component.
      Returns:
      the value of the indentWithTab record component
    • indentSize

      public int indentSize()
      Returns the value of the indentSize record component.
      Returns:
      the value of the indentSize record component
    • verbose

      public boolean verbose()
      Returns the value of the verbose record component.
      Returns:
      the value of the verbose record component