Class ImmutableEncodedElement.TypeParam

java.lang.Object
org.immutables.value.processor.encode.EncodedElement.TypeParam
org.immutables.value.processor.encode.ImmutableEncodedElement.TypeParam
Enclosing class:
ImmutableEncodedElement

@Immutable static final class ImmutableEncodedElement.TypeParam extends EncodedElement.TypeParam
Immutable implementation of EncodedElement.TypeParam.

Use the builder to create immutable instances: new EncodedElement.TypeParam.Builder().

  • Field Details

    • name

      private final String name
    • bounds

      private final com.google.common.collect.ImmutableList<Type.Defined> bounds
  • Constructor Details

    • TypeParam

      private TypeParam(String name, com.google.common.collect.ImmutableList<Type.Defined> bounds)
  • Method Details

    • name

      String name()
      Specified by:
      name in class EncodedElement.TypeParam
      Returns:
      The value of the name attribute
    • bounds

      com.google.common.collect.ImmutableList<Type.Defined> bounds()
      Specified by:
      bounds in class EncodedElement.TypeParam
      Returns:
      The value of the bounds attribute
    • withName

      public final ImmutableEncodedElement.TypeParam withName(String value)
      Copy the current immutable object by setting a value for the name attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for name
      Returns:
      A modified copy of the this object
    • withBounds

      public final ImmutableEncodedElement.TypeParam withBounds(Type.Defined... elements)
      Copy the current immutable object with elements that replace the content of bounds.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withBounds

      public final ImmutableEncodedElement.TypeParam withBounds(Iterable<? extends Type.Defined> elements)
      Copy the current immutable object with elements that replace the content of bounds. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of bounds elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of TypeParam that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • equalTo

      private boolean equalTo(int synthetic, ImmutableEncodedElement.TypeParam another)
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: name, bounds.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • copyOf

      public static EncodedElement.TypeParam copyOf(EncodedElement.TypeParam instance)
      Creates an immutable copy of a EncodedElement.TypeParam 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 TypeParam instance