Class ImmutableTypeSet

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

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

Use the builder to create immutable instances: ImmutableTypeSet.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 ImmutableTypeSet 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 ImmutableTypeSet 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 ImmutableTypeSet 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 TypeSet with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

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

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