Class ImmutableTypeEnum

java.lang.Object
dk.mada.jaxrs.model.types.ImmutableTypeEnum
All Implemented Interfaces:
Type, TypeEnum

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

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

  • Method Details

    • typeName

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

      public Type innerType()
      Returns the inner type of the enumeration.
      Specified by:
      innerType in interface TypeEnum
      Returns:
      the inner type of the enumeration
    • values

      public List<String> values()
      Returns the enumeration values.
      Specified by:
      values in interface TypeEnum
      Returns:
      the enumeration values
    • withTypeName

      public final ImmutableTypeEnum 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
    • withInnerType

      public final ImmutableTypeEnum 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
    • withValues

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

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

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

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

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

      public static ImmutableTypeEnum.Builder builder()
      Creates a builder for ImmutableTypeEnum.
       ImmutableTypeEnum.builder()
          .typeName(dk.mada.jaxrs.model.types.TypeName) // required typeName
          .innerType(dk.mada.jaxrs.model.types.Type) // required innerType
          .addValues|addAllValues(String) // values elements
          .build();
       
      Returns:
      A new ImmutableTypeEnum builder