Class ImmutableTypeInterface

java.lang.Object
dk.mada.jaxrs.model.types.ImmutableTypeInterface
All Implemented Interfaces:
Type, TypeInterface

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

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

  • Method Details

    • typeName

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

      public String packageName()
      Returns the name of the package the interface is generated in.
      Specified by:
      packageName in interface TypeInterface
      Returns:
      the name of the package the interface is generated in
    • implementations

      public List<TypeName> implementations()
      Returns the type names implementing this interface.
      Specified by:
      implementations in interface TypeInterface
      Returns:
      the type names implementing this interface
    • withTypeName

      public final ImmutableTypeInterface 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
    • withPackageName

      public final ImmutableTypeInterface withPackageName(String value)
      Copy the current immutable object by setting a value for the packageName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for packageName
      Returns:
      A modified copy or the this object
    • withImplementations

      public final ImmutableTypeInterface withImplementations(TypeName... elements)
      Copy the current immutable object with elements that replace the content of implementations.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withImplementations

      public final ImmutableTypeInterface withImplementations(Iterable<? extends TypeName> elements)
      Copy the current immutable object with elements that replace the content of implementations. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of implementations 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 ImmutableTypeInterface 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, packageName, implementations.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableTypeInterface.Builder builder()
      Creates a builder for ImmutableTypeInterface.
       ImmutableTypeInterface.builder()
          .typeName(dk.mada.jaxrs.model.types.TypeName) // required typeName
          .packageName(String) // required packageName
          .addImplementations|addAllImplementations(dk.mada.jaxrs.model.types.TypeName) // implementations elements
          .build();
       
      Returns:
      A new ImmutableTypeInterface builder