Class ImmutableTypeMap

java.lang.Object
dk.mada.jaxrs.model.types.ImmutableTypeMap
All Implemented Interfaces:
Type, TypeContainer, TypeMap

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

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

  • Method Details

    • innerType

      public Type innerType()
      Returns the type of data in the container.
      Specified by:
      innerType in interface TypeContainer
      Returns:
      the type of data in the container
    • typeNames

      public TypeNames typeNames()
      Returns the type names instance.
      Specified by:
      typeNames in interface TypeContainer
      Returns:
      the type names instance
    • withInnerType

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

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

      public boolean equals(Object another)
      This instance is equal to all instances of ImmutableTypeMap 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: innerType, typeNames.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableTypeMap.Builder builder()
      Creates a builder for ImmutableTypeMap.
       ImmutableTypeMap.builder()
          .innerType(dk.mada.jaxrs.model.types.Type) // required innerType
          .typeNames(dk.mada.jaxrs.model.types.TypeNames) // required typeNames
          .build();
       
      Returns:
      A new ImmutableTypeMap builder