Class ImmutableEncodedElement.Param

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

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

Use the static factory method to create immutable instances: ImmutableEncodedElement.Param.of().

  • Field Details

    • name

      private final String name
    • type

      private final Type type
    • annotations

      private final com.google.common.collect.ImmutableList<String> annotations
  • Constructor Details

  • Method Details

    • name

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

      Type type()
      Specified by:
      type in class EncodedElement.Param
      Returns:
      The value of the type attribute
    • annotations

      com.google.common.collect.ImmutableList<String> annotations()
      Specified by:
      annotations in class EncodedElement.Param
      Returns:
      The value of the annotations attribute
    • withName

      public final ImmutableEncodedElement.Param 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
    • withType

      public final ImmutableEncodedElement.Param withType(Type value)
      Copy the current immutable object by setting a value for the type attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type
      Returns:
      A modified copy of the this object
    • withAnnotations

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

      public final ImmutableEncodedElement.Param withAnnotations(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of annotations. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of annotations 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 Param 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.Param another)
    • hashCode

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

      public static EncodedElement.Param of(String name, Type type, List<String> annotations)
      Construct a new immutable Param instance.
      Parameters:
      name - The value for the name attribute
      type - The value for the type attribute
      annotations - The value for the annotations attribute
      Returns:
      An immutable Param instance
    • of

      public static EncodedElement.Param of(String name, Type type, Iterable<String> annotations)
      Construct a new immutable Param instance.
      Parameters:
      name - The value for the name attribute
      type - The value for the type attribute
      annotations - The value for the annotations attribute
      Returns:
      An immutable Param instance
    • copyOf

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