Interface KotlinMicronautServerOptionsBuilder

All Superinterfaces:
GeneratorOptionsBuilder

public interface KotlinMicronautServerOptionsBuilder extends GeneratorOptionsBuilder
Configures options which are specific to the server code.
  • Method Details

    • withControllerPackage

      KotlinMicronautServerOptionsBuilder withControllerPackage(String controllerPackage)
      Sets the package name of generated controller classes.
      Parameters:
      controllerPackage - the package name
      Returns:
      this builder
    • withGenerateImplementationFiles

      KotlinMicronautServerOptionsBuilder withGenerateImplementationFiles(boolean generateImplementationFiles)
      Whether to generate controller implementations that need to be filled in.
      Parameters:
      generateImplementationFiles - the implementation files flag
      Returns:
      this builder
    • withGenerateOperationsToReturnNotImplemented

      KotlinMicronautServerOptionsBuilder withGenerateOperationsToReturnNotImplemented(boolean generateOperationsToReturnNotImplemented)
      If set to true, controller operations will return not implemented status.
      Parameters:
      generateOperationsToReturnNotImplemented - the not implemented flag
      Returns:
      this builder
    • withGenerateControllerFromExamples

      KotlinMicronautServerOptionsBuilder withGenerateControllerFromExamples(boolean generateControllerFromExamples)
      If set to true, controllers will be generated using examples.
      Parameters:
      generateControllerFromExamples - the examples flag
      Returns:
      this builder
    • withAuthentication

      KotlinMicronautServerOptionsBuilder withAuthentication(boolean useAuth)
      If set to true, generated code will add support for authentication.
      Parameters:
      useAuth - the authentication flag
      Returns:
      this builder
    • withUserParameterMode

      KotlinMicronautServerOptionsBuilder withUserParameterMode(String userParameterMode)
      Add or not principal / authentication parameter to controller methods. Available modes: NONE PRINCIPAL AUTHENTICATION CUSTOM
      Parameters:
      userParameterMode - user parameter mode
      Returns:
      this builder
    • withUserParameterClass

      KotlinMicronautServerOptionsBuilder withUserParameterClass(String userParameterClass)
      Specifies the class to be used for the user parameter in generated controllers. Usable only in conjuction with UserParameterMode.CUSTOM user parameter mode.
      Parameters:
      userParameterClass - the fully qualified name of the class to use for the user parameter
      Returns:
      this builder
    • withFluxForArrays

      KotlinMicronautServerOptionsBuilder withFluxForArrays(boolean fluxForArrays)
      If set to true, generated code will be with Flux<?> instead Mono<List<?>>.
      Parameters:
      fluxForArrays - generate code with Flux<?> instead Mono<List<?>> or not
      Returns:
      this builder
    • withPlural

      KotlinMicronautServerOptionsBuilder withPlural(boolean plural)
      If set to true, the generated code will pluralize parameters and properties for arrays.
      Parameters:
      plural - generate pluralized parameters and properties for arrays
      Returns:
      this builder
    • withGeneratedAnnotation

      KotlinMicronautServerOptionsBuilder withGeneratedAnnotation(boolean generatedAnnotation)
      If set to true, generated code will be with jakarta.annotation.Generated annotation.
      Parameters:
      generatedAnnotation - generate code with jakarta.annotation.Generated annotation or not
      Returns:
      this builder
    • withAot

      If set to true, generated compatible code with micronaut-aot.
      Parameters:
      aot - generate compatible code with micronaut-aot or not
      Returns:
      this builder
    • withKsp

      If set to true, generated code will be fully compatible with KSP, but not 100% with KAPT.
      Parameters:
      ksp - do we need to generate code compatible only with KSP
      Returns:
      this builder
    • withCoroutines

      KotlinMicronautServerOptionsBuilder withCoroutines(boolean coroutines)
      If set to true, generated code will be with suspend methods.
      Parameters:
      coroutines - do we need to generate suspend methods
      Returns:
      this builder
    • withGenerateStreamingFileUpload

      KotlinMicronautServerOptionsBuilder withGenerateStreamingFileUpload(boolean generateStreamingFileUpload)
      Whether to generate StreamingFileUpload type for file request body.
      Parameters:
      generateStreamingFileUpload - whether to generate StreamingFileUpload type for file request body
      Returns:
      this builder
    • withJvmOverloads

      KotlinMicronautServerOptionsBuilder withJvmOverloads(boolean jvmOverloads)
      Add or not @JvmOverloads annotation for classes with properties with default values. Default: false
      Parameters:
      jvmOverloads - if true, then @JvmOverload annotation will be added to classes with properties with default values
      Returns:
      this builder
    • withJvmRecord

      KotlinMicronautServerOptionsBuilder withJvmRecord(boolean jvmRecord)
      Add or not @JvmRecord annotation to data classes. Default: false
      Parameters:
      jvmRecord - if true, then @JvmRecord annotation will be added to data classes
      Returns:
      this builder
    • withJavaCompatibility

      KotlinMicronautServerOptionsBuilder withJavaCompatibility(boolean javaCompatibility)
      Add or not @JvmField, @JvmStatic and @JvmRepeatable annotations to improve java compatibility. Default: true
      Parameters:
      javaCompatibility - if true, then @JvmField, @JvmStatic and @JvmRepeatable annotations wil be added where it needed to improve java compatibility
      Returns:
      this builder
    • withModelMutable

      KotlinMicronautServerOptionsBuilder withModelMutable(boolean modelMutable)
      If set to true, generated model will be with `var` keywords, otherwise - `val`.
      Parameters:
      modelMutable - generate code with mutable / immutable models
      Returns:
      this builder
    • withNonPublicApi

      KotlinMicronautServerOptionsBuilder withNonPublicApi(boolean nonPublicApi)
      If true, generated code will be with `internal` modifier.
      Parameters:
      nonPublicApi - If true, generated code will be with `internal` modifier.
      Returns:
      this builder