Class ImmutableTrees.BoundAccessExpression

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

@Immutable public static final class ImmutableTrees.BoundAccessExpression extends Trees.BoundAccessExpression
Immutable implementation of Trees.BoundAccessExpression.

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

  • Field Details

    • path

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

      private final com.google.common.collect.ImmutableList<Object> accessor
  • Constructor Details

    • BoundAccessExpression

      private BoundAccessExpression(com.google.common.collect.ImmutableList<Trees.Identifier> path, com.google.common.collect.ImmutableList<Object> accessor)
  • Method Details

    • path

      public com.google.common.collect.ImmutableList<Trees.Identifier> path()
      Returns:
      The value of the path attribute
    • accessor

      public com.google.common.collect.ImmutableList<Object> accessor()
      Specified by:
      accessor in class Trees.BoundAccessExpression
      Returns:
      The value of the accessor attribute
    • withPath

      public final ImmutableTrees.BoundAccessExpression 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.BoundAccessExpression 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
    • withAccessor

      public final ImmutableTrees.BoundAccessExpression withAccessor(Object... elements)
      Copy the current immutable object with elements that replace the content of accessor.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAccessor

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

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

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

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