Class ImmutableTrees.LetStatement
- java.lang.Object
-
- org.immutables.generator.processor.ImmutableTrees.LetStatement
-
- All Implemented Interfaces:
Trees.Block,Trees.InvokableStatement,Trees.LetStatement,Trees.Synthetic,Trees.TemplatePart
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.LetStatement extends java.lang.Object implements Trees.LetStatement
Immutable implementation ofTrees.LetStatement.Use the builder to create immutable instances:
ImmutableTrees.LetStatement.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.LetStatement.BuilderBuilds instances of typeLetStatement.
-
Field Summary
Fields Modifier and Type Field Description private Trees.InvokableDeclarationdeclarationprivate com.google.common.collect.ImmutableList<Trees.TemplatePart>parts
-
Constructor Summary
Constructors Modifier Constructor Description privateLetStatement(com.google.common.collect.ImmutableList<Trees.TemplatePart> parts, Trees.InvokableDeclaration declaration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.LetStatement.Builderbuilder()Creates a builder forLetStatement.static ImmutableTrees.LetStatementcopyOf(Trees.LetStatement instance)Creates an immutable copy of aTrees.LetStatementvalue.Trees.InvokableDeclarationdeclaration()booleanequals(java.lang.Object another)This instance is equal to all instances ofLetStatementthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.LetStatement another)inthashCode()Computes a hash code from attributes:parts,declaration.com.google.common.collect.ImmutableList<Trees.TemplatePart>parts()java.lang.StringtoString()Prints the immutable valueLetStatementwith attribute values.ImmutableTrees.LetStatementwithDeclaration(Trees.InvokableDeclaration value)Copy the current immutable object by setting a value for thedeclarationattribute.ImmutableTrees.LetStatementwithParts(java.lang.Iterable<? extends Trees.TemplatePart> elements)Copy the current immutable object with elements that replace the content ofparts.ImmutableTrees.LetStatementwithParts(Trees.TemplatePart... elements)Copy the current immutable object with elements that replace the content ofparts.
-
-
-
Field Detail
-
parts
private final com.google.common.collect.ImmutableList<Trees.TemplatePart> parts
-
declaration
private final Trees.InvokableDeclaration declaration
-
-
Constructor Detail
-
LetStatement
private LetStatement(com.google.common.collect.ImmutableList<Trees.TemplatePart> parts, Trees.InvokableDeclaration declaration)
-
-
Method Detail
-
parts
public com.google.common.collect.ImmutableList<Trees.TemplatePart> parts()
- Specified by:
partsin interfaceTrees.Block- Returns:
- The value of the
partsattribute
-
declaration
public Trees.InvokableDeclaration declaration()
- Specified by:
declarationin interfaceTrees.InvokableStatement- Returns:
- The value of the
declarationattribute
-
withParts
public final ImmutableTrees.LetStatement withParts(Trees.TemplatePart... elements)
Copy the current immutable object with elements that replace the content ofparts.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withParts
public final ImmutableTrees.LetStatement withParts(java.lang.Iterable<? extends Trees.TemplatePart> elements)
Copy the current immutable object with elements that replace the content ofparts. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of parts elements to set- Returns:
- A modified copy of
thisobject
-
withDeclaration
public final ImmutableTrees.LetStatement withDeclaration(Trees.InvokableDeclaration value)
Copy the current immutable object by setting a value for thedeclarationattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for declaration- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable java.lang.Object another)This instance is equal to all instances ofLetStatementthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.LetStatement another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:parts,declaration.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueLetStatementwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.LetStatement copyOf(Trees.LetStatement instance)
Creates an immutable copy of aTrees.LetStatementvalue. 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 LetStatement instance
-
builder
public static ImmutableTrees.LetStatement.Builder builder()
Creates a builder forLetStatement.ImmutableTrees.LetStatement.builder() .addParts|addAllParts(org.immutables.generator.processor.Trees.TemplatePart) //partselements .declaration(org.immutables.generator.processor.Trees.InvokableDeclaration) // requireddeclaration.build();- Returns:
- A new LetStatement builder
-
-