Class ImmutableTypeArray

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

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

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

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

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