Class ImmutableTypeReference

java.lang.Object
dk.mada.jaxrs.model.types.ImmutableTypeReference
All Implemented Interfaces:
Reference, Type, TypeReference

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

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

  • Method Details

    • validation

      public Validation validation()
      Validation information that applies to this particular reference of the type.
      Specified by:
      validation in interface Reference
      Returns:
      the validation information.
    • refType

      public Type refType()
      Returns the referenced type.
      Specified by:
      refType in interface Reference
      Returns:
      the referenced type
    • withValidation

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

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

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

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

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

      public static ImmutableTypeReference.Builder builder()
      Creates a builder for ImmutableTypeReference.
       ImmutableTypeReference.builder()
          .validation(dk.mada.jaxrs.model.Validation) // required validation
          .refType(dk.mada.jaxrs.model.types.Type) // required refType
          .build();
       
      Returns:
      A new ImmutableTypeReference builder