Class ImmutableTrees.ForStatement
- java.lang.Object
-
- org.immutables.generator.processor.Trees.ForStatement
-
- org.immutables.generator.processor.ImmutableTrees.ForStatement
-
- All Implemented Interfaces:
Trees.Block,Trees.Synthetic,Trees.TemplatePart
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.ForStatement extends Trees.ForStatement
Immutable implementation ofTrees.ForStatement.Use the builder to create immutable instances:
ImmutableTrees.ForStatement.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.ForStatement.BuilderBuilds instances of typeForStatement.private classImmutableTrees.ForStatement.InitShim
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration>declarationprivate ImmutableTrees.ForStatement.InitShiminitShimprivate com.google.common.collect.ImmutableList<Trees.TemplatePart>partsprivate static byteSTAGE_INITIALIZEDprivate static byteSTAGE_INITIALIZINGprivate static byteSTAGE_UNINITIALIZEDprivate booleanuseDelimitprivate booleanuseForAccess
-
Constructor Summary
Constructors Modifier Constructor Description privateForStatement(com.google.common.collect.ImmutableList<Trees.TemplatePart> parts, boolean useForAccess, boolean useDelimit, com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration)privateForStatement(ImmutableTrees.ForStatement.Builder builder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.ForStatement.Builderbuilder()Creates a builder forForStatement.static ImmutableTrees.ForStatementcopyOf(Trees.ForStatement instance)Creates an immutable copy of aTrees.ForStatementvalue.com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration>declaration()booleanequals(java.lang.Object another)This instance is equal to all instances ofForStatementthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.ForStatement another)inthashCode()Computes a hash code from attributes:parts,useForAccess,useDelimit,declaration.com.google.common.collect.ImmutableList<Trees.TemplatePart>parts()java.lang.StringtoString()Prints the immutable valueForStatementwith attribute values.booleanuseDelimit()booleanuseForAccess()ImmutableTrees.ForStatementwithDeclaration(java.lang.Iterable<? extends Trees.GeneratorDeclaration> elements)Copy the current immutable object with elements that replace the content ofdeclaration.ImmutableTrees.ForStatementwithDeclaration(Trees.GeneratorDeclaration... elements)Copy the current immutable object with elements that replace the content ofdeclaration.ImmutableTrees.ForStatementwithParts(java.lang.Iterable<? extends Trees.TemplatePart> elements)Copy the current immutable object with elements that replace the content ofparts.ImmutableTrees.ForStatementwithParts(Trees.TemplatePart... elements)Copy the current immutable object with elements that replace the content ofparts.ImmutableTrees.ForStatementwithUseDelimit(boolean value)Copy the current immutable object by setting a value for theuseDelimitattribute.ImmutableTrees.ForStatementwithUseForAccess(boolean value)Copy the current immutable object by setting a value for theuseForAccessattribute.
-
-
-
Field Detail
-
parts
private final com.google.common.collect.ImmutableList<Trees.TemplatePart> parts
-
useForAccess
private final boolean useForAccess
-
useDelimit
private final boolean useDelimit
-
declaration
private final com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration
-
STAGE_INITIALIZING
private static final byte STAGE_INITIALIZING
- See Also:
- Constant Field Values
-
STAGE_UNINITIALIZED
private static final byte STAGE_UNINITIALIZED
- See Also:
- Constant Field Values
-
STAGE_INITIALIZED
private static final byte STAGE_INITIALIZED
- See Also:
- Constant Field Values
-
initShim
private transient volatile ImmutableTrees.ForStatement.InitShim initShim
-
-
Constructor Detail
-
ForStatement
private ForStatement(ImmutableTrees.ForStatement.Builder builder)
-
ForStatement
private ForStatement(com.google.common.collect.ImmutableList<Trees.TemplatePart> parts, boolean useForAccess, boolean useDelimit, com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration)
-
-
Method Detail
-
parts
public com.google.common.collect.ImmutableList<Trees.TemplatePart> parts()
- Returns:
- The value of the
partsattribute
-
useForAccess
public boolean useForAccess()
- Overrides:
useForAccessin classTrees.ForStatement- Returns:
- The value of the
useForAccessattribute
-
useDelimit
public boolean useDelimit()
- Overrides:
useDelimitin classTrees.ForStatement- Returns:
- The value of the
useDelimitattribute
-
declaration
public com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration()
- Specified by:
declarationin classTrees.ForStatement- Returns:
- The value of the
declarationattribute
-
withParts
public final ImmutableTrees.ForStatement 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.ForStatement 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
-
withUseForAccess
public final ImmutableTrees.ForStatement withUseForAccess(boolean value)
Copy the current immutable object by setting a value for theuseForAccessattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for useForAccess- Returns:
- A modified copy of the
thisobject
-
withUseDelimit
public final ImmutableTrees.ForStatement withUseDelimit(boolean value)
Copy the current immutable object by setting a value for theuseDelimitattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for useDelimit- Returns:
- A modified copy of the
thisobject
-
withDeclaration
public final ImmutableTrees.ForStatement withDeclaration(Trees.GeneratorDeclaration... elements)
Copy the current immutable object with elements that replace the content ofdeclaration.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withDeclaration
public final ImmutableTrees.ForStatement withDeclaration(java.lang.Iterable<? extends Trees.GeneratorDeclaration> elements)
Copy the current immutable object with elements that replace the content ofdeclaration. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of declaration 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 ofForStatementthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.ForStatement another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:parts,useForAccess,useDelimit,declaration.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueForStatementwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.ForStatement copyOf(Trees.ForStatement instance)
Creates an immutable copy of aTrees.ForStatementvalue. 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 ForStatement instance
-
builder
public static ImmutableTrees.ForStatement.Builder builder()
Creates a builder forForStatement.ImmutableTrees.ForStatement.builder() .addParts|addAllParts(org.immutables.generator.processor.Trees.TemplatePart) //partselements .useForAccess(boolean) // optionaluseForAccess.useDelimit(boolean) // optionaluseDelimit.addDeclaration|addAllDeclaration(org.immutables.generator.processor.Trees.GeneratorDeclaration) //declarationelements .build();- Returns:
- A new ForStatement builder
-
-