Class ImmutableTrees.InvokableDeclaration

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

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

Use the builder to create immutable instances: ImmutableTrees.InvokableDeclaration.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
    • parameters

      public com.google.common.collect.ImmutableList<Trees.Parameter> parameters()
      Specified by:
      parameters in interface Trees.InvokableDeclaration
      Returns:
      The value of the parameters attribute
    • withName

      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
    • withParameters

      public final ImmutableTrees.InvokableDeclaration withParameters(Trees.Parameter... elements)
      Copy the current immutable object with elements that replace the content of parameters.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withParameters

      public final ImmutableTrees.InvokableDeclaration withParameters(Iterable<? extends Trees.Parameter> elements)
      Copy the current immutable object with elements that replace the content of parameters. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of parameters 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 InvokableDeclaration 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.InvokableDeclaration another)
    • hashCode

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

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

      Creates an immutable copy of a Trees.InvokableDeclaration 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 InvokableDeclaration instance
    • builder

      Creates a builder for InvokableDeclaration.
       ImmutableTrees.InvokableDeclaration.builder()
          .name(org.immutables.generator.processor.Trees.Identifier) // required name
          .addParameters|addAllParameters(org.immutables.generator.processor.Trees.Parameter) // parameters elements
          .build();
       
      Returns:
      A new InvokableDeclaration builder