Class ImmutableTrees.For
- java.lang.Object
-
- org.immutables.generator.processor.ImmutableTrees.For
-
- All Implemented Interfaces:
Trees.Directive,Trees.DirectiveStart,Trees.For,Trees.TemplatePart
- Enclosing class:
- ImmutableTrees
@Immutable public static final class ImmutableTrees.For extends java.lang.Object implements Trees.For
Immutable implementation ofTrees.For.Use the builder to create immutable instances:
ImmutableTrees.For.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTrees.For.BuilderBuilds instances of typeFor.
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration>declaration
-
Constructor Summary
Constructors Modifier Constructor Description privateFor(com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTrees.For.Builderbuilder()Creates a builder forFor.static ImmutableTrees.ForcopyOf(Trees.For instance)Creates an immutable copy of aTrees.Forvalue.com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration>declaration()booleanequals(java.lang.Object another)This instance is equal to all instances ofForthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.For another)inthashCode()Computes a hash code from attributes:declaration.java.lang.StringtoString()Prints the immutable valueForwith attribute values.ImmutableTrees.ForwithDeclaration(java.lang.Iterable<? extends Trees.GeneratorDeclaration> elements)Copy the current immutable object with elements that replace the content ofdeclaration.ImmutableTrees.ForwithDeclaration(Trees.GeneratorDeclaration... elements)Copy the current immutable object with elements that replace the content ofdeclaration.
-
-
-
Field Detail
-
declaration
private final com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration
-
-
Constructor Detail
-
For
private For(com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration)
-
-
Method Detail
-
declaration
public com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration()
- Specified by:
declarationin interfaceTrees.For- Returns:
- The value of the
declarationattribute
-
withDeclaration
public final ImmutableTrees.For 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.For 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 ofForthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
equalTo
private boolean equalTo(int synthetic, ImmutableTrees.For another)
-
hashCode
public int hashCode()
Computes a hash code from attributes:declaration.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()
Prints the immutable valueForwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
public static ImmutableTrees.For copyOf(Trees.For instance)
Creates an immutable copy of aTrees.Forvalue. 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 For instance
-
builder
public static ImmutableTrees.For.Builder builder()
Creates a builder forFor.ImmutableTrees.For.builder() .addDeclaration|addAllDeclaration(org.immutables.generator.processor.Trees.GeneratorDeclaration) //declarationelements .build();- Returns:
- A new For builder
-
-