Class ImmutableCtxDto

java.lang.Object
dk.mada.jaxrs.generator.mpclient.dto.tmpl.ImmutableCtxDto
All Implemented Interfaces:
CtxDto

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

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

  • Method Details

    • appName

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

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

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

      public Optional<String> infoEmail()
      Returns the optional application contact email.
      Specified by:
      infoEmail in interface CtxDto
      Returns:
      the optional application contact email
    • getImports

      public SortedSet<String> getImports()
      Returns the imports needed in the template.
      Specified by:
      getImports in interface CtxDto
      Returns:
      the imports needed in the template
    • description

      public Optional<String> description()
      Returns the optional description of the class.
      Specified by:
      description in interface CtxDto
      Returns:
      the optional description of the class
    • packageName

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

      public String classname()
      Returns the classname for the class.
      Specified by:
      classname in interface CtxDto
      Returns:
      the classname for the class
    • classVarName

      public String classVarName()
      Returns the class name used in equals method.
      Specified by:
      classVarName in interface CtxDto
      Returns:
      the class name used in equals method
    • vars

      public List<CtxProperty> vars()
      Returns the properties of the class.
      Specified by:
      vars in interface CtxDto
      Returns:
      the properties of the class
    • isRecord

      public boolean isRecord()
      Returns true if this DTO should be rendered as a record.
      Specified by:
      isRecord in interface CtxDto
      Returns:
      true if this DTO should be rendered as a record
    • allowableValues

      public @Nullable CtxEnum allowableValues()
      Returns the enumeration constants/values, or null.
      Specified by:
      allowableValues in interface CtxDto
      Returns:
      the enumeration constants/values, or null
    • dataType

      public @Nullable String dataType()
      Returns the data type of an enumeration, or null.
      Specified by:
      dataType in interface CtxDto
      Returns:
      the data type of an enumeration, or null
    • datatypeWithEnum

      public @Nullable String datatypeWithEnum()
      Returns unknown, kept from upstream template.
      Specified by:
      datatypeWithEnum in interface CtxDto
      Returns:
      unknown, kept from upstream template
    • isNullable

      public boolean isNullable()
      Returns true if the is an enumeration that can be deserialized as null.
      Specified by:
      isNullable in interface CtxDto
      Returns:
      true if the is an enumeration that can be deserialized as null
    • parent

      public Optional<String> parent()
      Returns the optional name of a parent class.
      Specified by:
      parent in interface CtxDto
      Returns:
      the optional name of a parent class
    • vendorExtensions

      @Nullable public Map<String,String> vendorExtensions()
      Returns optional vendor extensions.
      Specified by:
      vendorExtensions in interface CtxDto
      Returns:
      optional vendor extensions
    • jackson

      public boolean jackson()
      Returns true if a jackson serializer is used, otherwise false.
      Specified by:
      jackson in interface CtxDto
      Returns:
      true if a jackson serializer is used, otherwise false
    • generatedAnnotationClass

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

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

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

      public Optional<CtxDtoDiscriminator> discriminator()
      Returns an optional discriminator for sub-class selection.
      Specified by:
      discriminator in interface CtxDto
      Returns:
      an optional discriminator for sub-class selection
    • madaDto

      public CtxDtoExt madaDto()
      Returns additional custom template data for the dto.
      Specified by:
      madaDto in interface CtxDto
      Returns:
      additional custom template data for the dto
    • withAppName

      public final ImmutableCtxDto 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 ImmutableCtxDto 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 ImmutableCtxDto 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 ImmutableCtxDto 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 ImmutableCtxDto 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 ImmutableCtxDto 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
    • withImports

      public final ImmutableCtxDto 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
    • withDescription

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

      public final ImmutableCtxDto withDescription(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the description 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 description
      Returns:
      A modified copy or this if not changed
    • withPackageName

      public final ImmutableCtxDto 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 ImmutableCtxDto 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
    • withClassVarName

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

      public final ImmutableCtxDto withVars(CtxProperty... elements)
      Copy the current immutable object with elements that replace the content of vars.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withVars

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

      public final ImmutableCtxDto withIsRecord(boolean value)
      Copy the current immutable object by setting a value for the isRecord attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isRecord
      Returns:
      A modified copy or the this object
    • withAllowableValues

      public final ImmutableCtxDto withAllowableValues(@Nullable CtxEnum value)
      Copy the current immutable object by setting a value for the allowableValues attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for allowableValues (can be null)
      Returns:
      A modified copy or the this object
    • withDataType

      public final ImmutableCtxDto withDataType(@Nullable String value)
      Copy the current immutable object by setting a value for the dataType attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for dataType (can be null)
      Returns:
      A modified copy or the this object
    • withDatatypeWithEnum

      public final ImmutableCtxDto withDatatypeWithEnum(@Nullable String value)
      Copy the current immutable object by setting a value for the datatypeWithEnum attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for datatypeWithEnum (can be null)
      Returns:
      A modified copy or the this object
    • withIsNullable

      public final ImmutableCtxDto withIsNullable(boolean value)
      Copy the current immutable object by setting a value for the isNullable attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for isNullable
      Returns:
      A modified copy or the this object
    • withParent

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

      public final ImmutableCtxDto withParent(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the parent 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 parent
      Returns:
      A modified copy or this if not changed
    • withVendorExtensions

      public final ImmutableCtxDto withVendorExtensions(@Nullable Map<String,? extends String> entries)
      Copy the current immutable object by replacing the vendorExtensions 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 vendorExtensions map
      Returns:
      A modified copy or this if not changed
    • withJackson

      public final ImmutableCtxDto withJackson(boolean value)
      Copy the current immutable object by setting a value for the jackson attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for jackson
      Returns:
      A modified copy or the this object
    • withGeneratedAnnotationClass

      public final ImmutableCtxDto 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 ImmutableCtxDto 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 ImmutableCtxDto 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 ImmutableCtxDto 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
    • withDiscriminator

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

      public final ImmutableCtxDto withDiscriminator(Optional<? extends CtxDtoDiscriminator> optional)
      Copy the current immutable object by setting an optional value for the discriminator attribute. A shallow reference equality check on the inner value is used to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for discriminator
      Returns:
      A modified copy or this if not changed
    • withMadaDto

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableCtxDto 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, imports, description, packageName, classname, classVarName, vars, isRecord, allowableValues, dataType, datatypeWithEnum, isNullable, parent, vendorExtensions, jackson, generatedAnnotationClass, generatorClass, generatedDate, discriminator, madaDto.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableCtxDto copyOf(CtxDto instance)
      Creates an immutable copy of a CtxDto 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 CtxDto instance
    • builder

      public static ImmutableCtxDto.Builder builder()
      Creates a builder for ImmutableCtxDto.
       ImmutableCtxDto.builder()
          .appName(String) // required appName
          .version(String) // required version
          .appDescription(Optional<String>) // optional appDescription
          .infoEmail(Optional<String>) // optional infoEmail
          .imports(SortedSet<String>) // required imports
          .description(Optional<String>) // optional description
          .packageName(String) // required packageName
          .classname(String) // required classname
          .classVarName(String) // required classVarName
          .addVars|addAllVars(dk.mada.jaxrs.generator.mpclient.dto.tmpl.CtxProperty) // vars elements
          .isRecord(boolean) // required isRecord
          .allowableValues(dk.mada.jaxrs.generator.mpclient.dto.tmpl.CtxEnum | null) // nullable allowableValues
          .dataType(String | null) // nullable dataType
          .datatypeWithEnum(String | null) // nullable datatypeWithEnum
          .isNullable(boolean) // required isNullable
          .parent(Optional<String>) // optional parent
          .vendorExtensions(Map<String, String> | null) // nullable vendorExtensions
          .jackson(boolean) // required jackson
          .generatedAnnotationClass(String) // required generatedAnnotationClass
          .generatorClass(String) // required generatorClass
          .generatedDate(Optional<String>) // optional generatedDate
          .discriminator(Optional<dk.mada.jaxrs.generator.mpclient.dto.tmpl.CtxDtoDiscriminator>) // optional discriminator
          .madaDto(dk.mada.jaxrs.generator.mpclient.dto.tmpl.CtxDtoExt) // required madaDto
          .build();
       
      Returns:
      A new ImmutableCtxDto builder