Class ImmutableCtxApi

java.lang.Object
dk.mada.jaxrs.generator.mpclient.api.tmpl.ImmutableCtxApi
All Implemented Interfaces:
CtxApi

@Generated(from="CtxApi", generator="Immutables") @Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableCtxApi extends Object implements CtxApi
Immutable implementation of CtxApi.

Use the builder to create immutable instances: ImmutableCtxApi.builder().

  • Method Details

    • appName

      public String appName()
      Returns the application name.
      Specified by:
      appName in interface CtxApi
      Returns:
      the application name
    • version

      public String version()
      Returns the application version.
      Specified by:
      version in interface CtxApi
      Returns:
      the application version
    • appDescription

      public Optional<String> appDescription()
      Returns the optional application description.
      Specified by:
      appDescription in interface CtxApi
      Returns:
      the optional application description
    • infoEmail

      public Optional<String> infoEmail()
      Returns the optional information email.
      Specified by:
      infoEmail in interface CtxApi
      Returns:
      the optional information email
    • externalDocs

      public List<CtxApi.CtxOperationExternalDoc> externalDocs()
      Returns a list of external documentation references.
      Specified by:
      externalDocs in interface CtxApi
      Returns:
      a list of external documentation references
    • returnContainer

      public @Nullable Map<String,String> returnContainer()
      Returns the return type information for containers. This is wrong..
      Specified by:
      returnContainer in interface CtxApi
      Returns:
      the return type information for containers. This is wrong.
    • getImports

      public SortedSet<String> getImports()
      Returns the imports needed for this API class.
      Specified by:
      getImports in interface CtxApi
      Returns:
      the imports needed for this API class
    • operations

      public List<CtxApi.CtxOperationRef> operations()
      Returns the operation contexts in this API class.
      Specified by:
      operations in interface CtxApi
      Returns:
      the operation contexts in this API class
    • packageName

      public String packageName()
      Returns the package name.
      Specified by:
      packageName in interface CtxApi
      Returns:
      the package name
    • classname

      public String classname()
      Returns the class name.
      Specified by:
      classname in interface CtxApi
      Returns:
      the class name
    • generatedAnnotationClass

      public String generatedAnnotationClass()
      Returns the name of the Generated annotation class.
      Specified by:
      generatedAnnotationClass in interface CtxApi
      Returns:
      the name of the Generated annotation class
    • generatorClass

      public String generatorClass()
      Returns the name of the generator.
      Specified by:
      generatorClass in interface CtxApi
      Returns:
      the name of the generator
    • generatedDate

      public Optional<String> generatedDate()
      Returns the optional generation date.
      Specified by:
      generatedDate in interface CtxApi
      Returns:
      the optional generation date
    • commonPath

      public String commonPath()
      Returns the common REST path for all operations in this API class.
      Specified by:
      commonPath in interface CtxApi
      Returns:
      the common REST path for all operations in this API class
    • madaApi

      public CtxApiExt madaApi()
      Returns additional custom template data for the api.
      Specified by:
      madaApi in interface CtxApi
      Returns:
      additional custom template data for the api
    • withAppName

      public final ImmutableCtxApi withAppName(String value)
      Copy the current immutable object by setting a value for the appName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for appName
      Returns:
      A modified copy or the this object
    • withVersion

      public final ImmutableCtxApi withVersion(String value)
      Copy the current immutable object by setting a value for the version attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for version
      Returns:
      A modified copy or the this object
    • withAppDescription

      public final ImmutableCtxApi withAppDescription(String value)
      Copy the current immutable object by setting a present value for the optional appDescription attribute.
      Parameters:
      value - The value for appDescription
      Returns:
      A modified copy or this if not changed
    • withAppDescription

      public final ImmutableCtxApi withAppDescription(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the appDescription attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for appDescription
      Returns:
      A modified copy or this if not changed
    • withInfoEmail

      public final ImmutableCtxApi withInfoEmail(String value)
      Copy the current immutable object by setting a present value for the optional infoEmail attribute.
      Parameters:
      value - The value for infoEmail
      Returns:
      A modified copy or this if not changed
    • withInfoEmail

      public final ImmutableCtxApi withInfoEmail(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the infoEmail attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for infoEmail
      Returns:
      A modified copy or this if not changed
    • withExternalDocs

      public final ImmutableCtxApi withExternalDocs(CtxApi.CtxOperationExternalDoc... elements)
      Copy the current immutable object with elements that replace the content of externalDocs.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withExternalDocs

      public final ImmutableCtxApi withExternalDocs(Iterable<? extends CtxApi.CtxOperationExternalDoc> elements)
      Copy the current immutable object with elements that replace the content of externalDocs. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of externalDocs elements to set
      Returns:
      A modified copy or this if not changed
    • withReturnContainer

      public final ImmutableCtxApi withReturnContainer(Map<String,? extends String> entries)
      Copy the current immutable object by replacing the returnContainer map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to replace the returnContainer map
      Returns:
      A modified copy or this if not changed
    • withImports

      public final ImmutableCtxApi withImports(SortedSet<String> value)
      Copy the current immutable object by setting a value for the imports attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for imports
      Returns:
      A modified copy or the this object
    • withOperations

      public final ImmutableCtxApi withOperations(CtxApi.CtxOperationRef... elements)
      Copy the current immutable object with elements that replace the content of operations.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withOperations

      public final ImmutableCtxApi withOperations(Iterable<? extends CtxApi.CtxOperationRef> elements)
      Copy the current immutable object with elements that replace the content of operations. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of operations elements to set
      Returns:
      A modified copy or this if not changed
    • withPackageName

      public final ImmutableCtxApi withPackageName(String value)
      Copy the current immutable object by setting a value for the packageName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for packageName
      Returns:
      A modified copy or the this object
    • withClassname

      public final ImmutableCtxApi withClassname(String value)
      Copy the current immutable object by setting a value for the classname attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for classname
      Returns:
      A modified copy or the this object
    • withGeneratedAnnotationClass

      public final ImmutableCtxApi withGeneratedAnnotationClass(String value)
      Copy the current immutable object by setting a value for the generatedAnnotationClass attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for generatedAnnotationClass
      Returns:
      A modified copy or the this object
    • withGeneratorClass

      public final ImmutableCtxApi withGeneratorClass(String value)
      Copy the current immutable object by setting a value for the generatorClass attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for generatorClass
      Returns:
      A modified copy or the this object
    • withGeneratedDate

      public final ImmutableCtxApi withGeneratedDate(String value)
      Copy the current immutable object by setting a present value for the optional generatedDate attribute.
      Parameters:
      value - The value for generatedDate
      Returns:
      A modified copy or this if not changed
    • withGeneratedDate

      public final ImmutableCtxApi withGeneratedDate(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the generatedDate attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for generatedDate
      Returns:
      A modified copy or this if not changed
    • withCommonPath

      public final ImmutableCtxApi withCommonPath(String value)
      Copy the current immutable object by setting a value for the commonPath attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for commonPath
      Returns:
      A modified copy or the this object
    • withMadaApi

      public final ImmutableCtxApi withMadaApi(CtxApiExt value)
      Copy the current immutable object by setting a value for the madaApi attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for madaApi
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableCtxApi that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: appName, version, appDescription, infoEmail, externalDocs, returnContainer, imports, operations, packageName, classname, generatedAnnotationClass, generatorClass, generatedDate, commonPath, madaApi.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value CtxApi with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableCtxApi copyOf(CtxApi instance)
      Creates an immutable copy of a CtxApi value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable CtxApi instance
    • builder

      public static ImmutableCtxApi.Builder builder()
      Creates a builder for ImmutableCtxApi.
       ImmutableCtxApi.builder()
          .appName(String) // required appName
          .version(String) // required version
          .appDescription(Optional<String>) // optional appDescription
          .infoEmail(Optional<String>) // optional infoEmail
          .addExternalDocs|addAllExternalDocs(dk.mada.jaxrs.generator.mpclient.api.tmpl.CtxApi.CtxOperationExternalDoc) // externalDocs elements
          .returnContainer(Map<String, String> | null) // nullable returnContainer
          .imports(SortedSet<String>) // required imports
          .addOperations|addAllOperations(dk.mada.jaxrs.generator.mpclient.api.tmpl.CtxApi.CtxOperationRef) // operations elements
          .packageName(String) // required packageName
          .classname(String) // required classname
          .generatedAnnotationClass(String) // required generatedAnnotationClass
          .generatorClass(String) // required generatorClass
          .generatedDate(Optional<String>) // optional generatedDate
          .commonPath(String) // required commonPath
          .madaApi(dk.mada.jaxrs.generator.mpclient.api.tmpl.CtxApiExt) // required madaApi
          .build();
       
      Returns:
      A new ImmutableCtxApi builder