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 java.lang.Object implements Trees.SimpleAccessExpression
Immutable implementation ofTrees.SimpleAccessExpression.Use the builder to create immutable instances:
ImmutableTrees.SimpleAccessExpression.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.SimpleAccessExpression.BuilderBuilds instances of typeSimpleAccessExpression.
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList<Trees.Identifier>path
-
Constructor Summary
Constructors Modifier Constructor Description privateSimpleAccessExpression(com.google.common.collect.ImmutableList<Trees.Identifier> path)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.SimpleAccessExpression.Builderbuilder()Creates a builder forSimpleAccessExpression.static ImmutableTrees.SimpleAccessExpressioncopyOf(Trees.SimpleAccessExpression instance)Creates an immutable copy of aTrees.SimpleAccessExpressionvalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofSimpleAccessExpressionthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.SimpleAccessExpression another)inthashCode()Computes a hash code from attributes:path.com.google.common.collect.ImmutableList<Trees.Identifier>path()java.lang.StringtoString()Prints the immutable valueSimpleAccessExpressionwith attribute values.ImmutableTrees.SimpleAccessExpressionwithPath(java.lang.Iterable<? extends Trees.Identifier> elements)Copy the current immutable object with elements that replace the content ofpath.ImmutableTrees.SimpleAccessExpressionwithPath(Trees.Identifier... elements)Copy the current immutable object with elements that replace the content ofpath.
-
-
-
Field Detail
-
path
private final com.google.common.collect.ImmutableList<Trees.Identifier> path
-
-
Constructor Detail
-
SimpleAccessExpression
private SimpleAccessExpression(com.google.common.collect.ImmutableList<Trees.Identifier> path)
-
-
Method Detail
-
path
public com.google.common.collect.ImmutableList<Trees.Identifier> path()
- Specified by:
pathin interfaceTrees.AccessExpression- Returns:
- The value of the
pathattribute
-
withPath
public final ImmutableTrees.SimpleAccessExpression withPath(Trees.Identifier... elements)
Copy the current immutable object with elements that replace the content ofpath.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withPath
public final ImmutableTrees.SimpleAccessExpression withPath(java.lang.Iterable<? extends Trees.Identifier> elements)
Copy the current immutable object with elements that replace the content ofpath. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of path elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofSimpleAccessExpressionthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.SimpleAccessExpression another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:path.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueSimpleAccessExpressionwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.SimpleAccessExpression copyOf(Trees.SimpleAccessExpression instance)
Creates an immutable copy of aTrees.SimpleAccessExpressionvalue. 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
public static ImmutableTrees.SimpleAccessExpression.Builder builder()
Creates a builder forSimpleAccessExpression.ImmutableTrees.SimpleAccessExpression.builder() .addPath|addAllPath(org.immutables.generator.processor.Trees.Identifier) //pathelements .build();- Returns:
- A new SimpleAccessExpression builder
-
-