Class ImmutableTrees.Parameter

java.lang.Object
org.immutables.generator.processor.ImmutableTrees.Parameter
All Implemented Interfaces:
Trees.Named, Trees.Parameter, Trees.Typed
Enclosing class:
ImmutableTrees

@Immutable public static final class ImmutableTrees.Parameter extends Object implements Trees.Parameter
Immutable implementation of Trees.Parameter.

Use the builder to create immutable instances: ImmutableTrees.Parameter.builder().

  • Field Details

  • Constructor Details

  • Method Details

    • name

      public Trees.Identifier name()
      Specified by:
      name in interface Trees.Named
      Returns:
      The value of the name attribute
    • type

      public Trees.TypeReference type()
      Specified by:
      type in interface Trees.Typed
      Returns:
      The value of the type attribute
    • withName

      public final ImmutableTrees.Parameter withName(Trees.Identifier value)
      Copy the current immutable object by setting a value for the name attribute. A shallow reference equality check is 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 ImmutableTrees.Parameter withType(Trees.TypeReference 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
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of Parameter 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, ImmutableTrees.Parameter another)
    • hashCode

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

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

      public static ImmutableTrees.Parameter copyOf(Trees.Parameter instance)
      Creates an immutable copy of a Trees.Parameter 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 Parameter instance
    • builder

      public static ImmutableTrees.Parameter.Builder builder()
      Creates a builder for Parameter.
       ImmutableTrees.Parameter.builder()
          .name(org.immutables.generator.processor.Trees.Identifier) // required name
          .type(org.immutables.generator.processor.Trees.TypeReference) // required type
          .build();
       
      Returns:
      A new Parameter builder