Class ImmutableTrees.SimpleAccessExpression

java.lang.Object
org.immutables.generator.processor.ImmutableTrees.SimpleAccessExpression
All Implemented Interfaces:
Trees.AccessExpression, Trees.Expression, Trees.SimpleAccessExpression
Enclosing class:
ImmutableTrees

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

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

  • Field Details

    • path

      private final com.google.common.collect.ImmutableList<Trees.Identifier> path
  • Constructor Details

    • SimpleAccessExpression

      private SimpleAccessExpression(com.google.common.collect.ImmutableList<Trees.Identifier> path)
  • Method Details

    • path

      public com.google.common.collect.ImmutableList<Trees.Identifier> path()
      Specified by:
      path in interface Trees.AccessExpression
      Returns:
      The value of the path attribute
    • withPath

      public final ImmutableTrees.SimpleAccessExpression withPath(Trees.Identifier... elements)
      Copy the current immutable object with elements that replace the content of path.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withPath

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

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

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

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

      Creates a builder for SimpleAccessExpression.
       ImmutableTrees.SimpleAccessExpression.builder()
          .addPath|addAllPath(org.immutables.generator.processor.Trees.Identifier) // path elements
          .build();
       
      Returns:
      A new SimpleAccessExpression builder