Class ImmutableDto

java.lang.Object
dk.mada.jaxrs.model.ImmutableDto
All Implemented Interfaces:
Dto, Type

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

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

  • Method Details

    • typeName

      public TypeName typeName()
      Returns the type name.
      Specified by:
      typeName in interface Type
      Returns:
      the type name
    • name

      public String name()
      Returns the DTO name.
      Specified by:
      name in interface Dto
      Returns:
      the DTO name
    • mpSchemaName

      public String mpSchemaName()
      Returns the MP Schema name.
      Specified by:
      mpSchemaName in interface Dto
      Returns:
      the MP Schema name
    • reference

      public Reference reference()
      Returns the type of the DTO object.
      Specified by:
      reference in interface Dto
      Returns:
      the type of the DTO object
    • description

      public Optional<String> description()
      Returns the optional description of the DTO.
      Specified by:
      description in interface Dto
      Returns:
      the optional description of the DTO
    • openapiId

      public TypeName openapiId()
      Returns the name the DTO was identified by in the schema.
      Specified by:
      openapiId in interface Dto
      Returns:
      the name the DTO was identified by in the schema
    • properties

      public List<Property> properties()
      Returns the properties on the DTO.
      Specified by:
      properties in interface Dto
      Returns:
      the properties on the DTO
    • enumValues

      public List<String> enumValues()
      Returns the optional enumeration values on the DTO.
      Specified by:
      enumValues in interface Dto
      Returns:
      the optional enumeration values on the DTO
    • implementsInterfaces

      public List<TypeInterface> implementsInterfaces()
      Returns the list of interfaces implemented by this DTO.
      Specified by:
      implementsInterfaces in interface Dto
      Returns:
      the list of interfaces implemented by this DTO
    • subtypeSelector

      public Optional<SubtypeSelector> subtypeSelector()
      Returns an optional sub-type mapping.
      Specified by:
      subtypeSelector in interface Dto
      Returns:
      an optional sub-type mapping
    • extendsParents

      public Set<Dto> extendsParents()
      Returns the parents that this DTO extends.
      Specified by:
      extendsParents in interface Dto
      Returns:
      the parents that this DTO extends
    • isMultipartForm

      public boolean isMultipartForm()
      Returns true if this instance is used as a multipart form body.
      Specified by:
      isMultipartForm in interface Dto
      Returns:
      true if this instance is used as a multipart form body
    • withTypeName

      public final ImmutableDto withTypeName(TypeName value)
      Copy the current immutable object by setting a value for the typeName attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for typeName
      Returns:
      A modified copy or the this object
    • withName

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

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

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

      public final ImmutableDto 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 ImmutableDto 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
    • withOpenapiId

      public final ImmutableDto withOpenapiId(TypeName value)
      Copy the current immutable object by setting a value for the openapiId attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for openapiId
      Returns:
      A modified copy or the this object
    • withProperties

      public final ImmutableDto withProperties(Property... elements)
      Copy the current immutable object with elements that replace the content of properties.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withProperties

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

      public final ImmutableDto withEnumValues(String... elements)
      Copy the current immutable object with elements that replace the content of enumValues.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withEnumValues

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

      public final ImmutableDto withImplementsInterfaces(TypeInterface... elements)
      Copy the current immutable object with elements that replace the content of implementsInterfaces.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withImplementsInterfaces

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

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

      public final ImmutableDto withSubtypeSelector(Optional<? extends SubtypeSelector> optional)
      Copy the current immutable object by setting an optional value for the subtypeSelector 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 subtypeSelector
      Returns:
      A modified copy or this if not changed
    • withExtendsParents

      public final ImmutableDto withExtendsParents(Dto... elements)
      Copy the current immutable object with elements that replace the content of extendsParents.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withExtendsParents

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

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableDto 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: typeName, name, mpSchemaName, reference, description, openapiId, properties, enumValues, implementsInterfaces, subtypeSelector, extendsParents, isMultipartForm.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableDto.Builder builder()
      Creates a builder for ImmutableDto.
       ImmutableDto.builder()
          .typeName(dk.mada.jaxrs.model.types.TypeName) // required typeName
          .name(String) // required name
          .mpSchemaName(String) // required mpSchemaName
          .reference(dk.mada.jaxrs.model.types.Reference) // required reference
          .description(Optional<String>) // optional description
          .openapiId(dk.mada.jaxrs.model.types.TypeName) // required openapiId
          .addProperties|addAllProperties(dk.mada.jaxrs.model.Property) // properties elements
          .addEnumValues|addAllEnumValues(String) // enumValues elements
          .addImplementsInterfaces|addAllImplementsInterfaces(dk.mada.jaxrs.model.types.TypeInterface) // implementsInterfaces elements
          .subtypeSelector(Optional<dk.mada.jaxrs.model.SubtypeSelector>) // optional subtypeSelector
          .addExtendsParents|addAllExtendsParents(dk.mada.jaxrs.model.Dto) // extendsParents elements
          .isMultipartForm(boolean) // required isMultipartForm
          .build();
       
      Returns:
      A new ImmutableDto builder