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 implementation of
Trees.ForStatement.
Use the builder to create immutable instances:
ImmutableTrees.ForStatement.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeForStatement.private final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> private final com.google.common.collect.ImmutableList<Trees.TemplatePart> private static final byteprivate static final byteprivate static final byteprivate final booleanprivate final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateForStatement(com.google.common.collect.ImmutableList<Trees.TemplatePart> parts, boolean useForAccess, boolean useDelimit, com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration) private -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forForStatement.static ImmutableTrees.ForStatementcopyOf(Trees.ForStatement instance) Creates an immutable copy of aTrees.ForStatementvalue.com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> booleanThis 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()toString()Prints the immutable valueForStatementwith attribute values.booleanbooleanwithDeclaration(Iterable<? extends Trees.GeneratorDeclaration> elements) Copy the current immutable object with elements that replace the content ofdeclaration.withDeclaration(Trees.GeneratorDeclaration... elements) Copy the current immutable object with elements that replace the content ofdeclaration.withParts(Iterable<? extends Trees.TemplatePart> elements) Copy the current immutable object with elements that replace the content ofparts.withParts(Trees.TemplatePart... elements) Copy the current immutable object with elements that replace the content ofparts.withUseDelimit(boolean value) Copy the current immutable object by setting a value for theuseDelimitattribute.withUseForAccess(boolean value) Copy the current immutable object by setting a value for theuseForAccessattribute.
-
Field Details
-
parts
-
useForAccess
private final boolean useForAccess -
useDelimit
private final boolean useDelimit -
declaration
-
STAGE_INITIALIZING
private static final byte STAGE_INITIALIZING- See Also:
-
STAGE_UNINITIALIZED
private static final byte STAGE_UNINITIALIZED- See Also:
-
STAGE_INITIALIZED
private static final byte STAGE_INITIALIZED- See Also:
-
initShim
-
-
Constructor Details
-
ForStatement
-
ForStatement
private ForStatement(com.google.common.collect.ImmutableList<Trees.TemplatePart> parts, boolean useForAccess, boolean useDelimit, com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration)
-
-
Method Details
-
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
- Specified by:
declarationin classTrees.ForStatement- Returns:
- The value of the
declarationattribute
-
withParts
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
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
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
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
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(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
This instance is equal to all instances ofForStatementthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:parts,useForAccess,useDelimit,declaration. -
toString
Prints the immutable valueForStatementwith attribute values. -
copyOf
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
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
-