Class ImmutableTrees.IterationGenerator
java.lang.Object
org.immutables.generator.processor.ImmutableTrees.IterationGenerator
- All Implemented Interfaces:
Trees.GeneratorDeclaration,Trees.GeneratorValueDeclaration,Trees.IterationGenerator
- Enclosing class:
ImmutableTrees
@Immutable
public static final class ImmutableTrees.IterationGenerator
extends Object
implements Trees.IterationGenerator
Immutable implementation of
Trees.IterationGenerator.
Use the builder to create immutable instances:
ImmutableTrees.IterationGenerator.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.base.Optional<Trees.Expression> private final Trees.ValueDeclarationprivate final Trees.Expression -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateIterationGenerator(Trees.ValueDeclaration declaration, Trees.Expression from, com.google.common.base.Optional<Trees.Expression> condition) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forIterationGenerator.com.google.common.base.Optional<Trees.Expression> copyOf(Trees.IterationGenerator instance) Creates an immutable copy of aTrees.IterationGeneratorvalue.booleanThis instance is equal to all instances ofIterationGeneratorthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.IterationGenerator another) from()inthashCode()Computes a hash code from attributes:declaration,from,condition.toString()Prints the immutable valueIterationGeneratorwith attribute values.withCondition(com.google.common.base.Optional<? extends Trees.Expression> optional) Copy the current immutable object by setting an optional value for theconditionattribute.withCondition(Trees.Expression value) Copy the current immutable object by setting a present value for the optionalconditionattribute.Copy the current immutable object by setting a value for thedeclarationattribute.withFrom(Trees.Expression value) Copy the current immutable object by setting a value for thefromattribute.
-
Field Details
-
declaration
-
from
-
condition
-
-
Constructor Details
-
IterationGenerator
private IterationGenerator(Trees.ValueDeclaration declaration, Trees.Expression from, com.google.common.base.Optional<Trees.Expression> condition)
-
-
Method Details
-
declaration
- Specified by:
declarationin interfaceTrees.GeneratorValueDeclaration- Returns:
- The value of the
declarationattribute
-
from
- Specified by:
fromin interfaceTrees.GeneratorValueDeclaration- Returns:
- The value of the
fromattribute
-
condition
- Specified by:
conditionin interfaceTrees.IterationGenerator- Returns:
- The value of the
conditionattribute
-
withDeclaration
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
-
withFrom
Copy the current immutable object by setting a value for thefromattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for from- Returns:
- A modified copy of the
thisobject
-
withCondition
Copy the current immutable object by setting a present value for the optionalconditionattribute.- Parameters:
value- The value for condition- Returns:
- A modified copy of
thisobject
-
withCondition
public final ImmutableTrees.IterationGenerator withCondition(com.google.common.base.Optional<? extends Trees.Expression> optional) Copy the current immutable object by setting an optional value for theconditionattribute. A shallow reference equality check on the optional value is used to prevent copying of the same value by returningthis.- Parameters:
optional- A value for condition- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofIterationGeneratorthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:declaration,from,condition. -
toString
Prints the immutable valueIterationGeneratorwith attribute values. -
copyOf
Creates an immutable copy of aTrees.IterationGeneratorvalue. 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 IterationGenerator instance
-
builder
Creates a builder forIterationGenerator.ImmutableTrees.IterationGenerator.builder() .declaration(org.immutables.generator.processor.Trees.ValueDeclaration) // requireddeclaration.from(org.immutables.generator.processor.Trees.Expression) // requiredfrom.condition(org.immutables.generator.processor.Trees.Expression) // optionalcondition.build();- Returns:
- A new IterationGenerator builder
-