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 implementation of
Trees.For.
Use the builder to create immutable instances:
ImmutableTrees.For.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateFor(com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> declaration) -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableTrees.For.Builderbuilder()Creates a builder forFor.static ImmutableTrees.ForCreates an immutable copy of aTrees.Forvalue.com.google.common.collect.ImmutableList<Trees.GeneratorDeclaration> booleanThis 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.toString()Prints the immutable valueForwith attribute values.final ImmutableTrees.ForwithDeclaration(Iterable<? extends Trees.GeneratorDeclaration> elements) Copy the current immutable object with elements that replace the content ofdeclaration.final ImmutableTrees.ForwithDeclaration(Trees.GeneratorDeclaration... elements) Copy the current immutable object with elements that replace the content ofdeclaration.
-
Field Details
-
declaration
-
-
Constructor Details
-
For
-
-
Method Details
-
declaration
- Specified by:
declarationin interfaceTrees.For- Returns:
- The value of the
declarationattribute
-
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.For 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 ofForthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:declaration. -
toString
Prints the immutable valueForwith attribute values. -
copyOf
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
Creates a builder forFor.ImmutableTrees.For.builder() .addDeclaration|addAllDeclaration(org.immutables.generator.processor.Trees.GeneratorDeclaration) //declarationelements .build();- Returns:
- A new For builder
-