Class ImmutableTrees.ConditionalBlock
java.lang.Object
org.immutables.generator.processor.ImmutableTrees.ConditionalBlock
- All Implemented Interfaces:
Trees.Block,Trees.Conditional,Trees.ConditionalBlock,Trees.Synthetic,Trees.TemplatePart
- Enclosing class:
ImmutableTrees
@Immutable
public static final class ImmutableTrees.ConditionalBlock
extends Object
implements Trees.ConditionalBlock
Immutable implementation of
Trees.ConditionalBlock.
Use the builder to create immutable instances:
ImmutableTrees.ConditionalBlock.builder().
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Trees.Expressionprivate final com.google.common.collect.ImmutableList<Trees.TemplatePart> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConditionalBlock(Trees.Expression condition, com.google.common.collect.ImmutableList<Trees.TemplatePart> parts) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forConditionalBlock.copyOf(Trees.ConditionalBlock instance) Creates an immutable copy of aTrees.ConditionalBlockvalue.booleanThis instance is equal to all instances ofConditionalBlockthat have equal attribute values.private booleanequalTo(int synthetic, ImmutableTrees.ConditionalBlock another) inthashCode()Computes a hash code from attributes:condition,parts.com.google.common.collect.ImmutableList<Trees.TemplatePart> parts()toString()Prints the immutable valueConditionalBlockwith attribute values.withCondition(Trees.Expression value) Copy the current immutable object by setting a value for theconditionattribute.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.
-
Field Details
-
condition
-
parts
-
-
Constructor Details
-
ConditionalBlock
private ConditionalBlock(Trees.Expression condition, com.google.common.collect.ImmutableList<Trees.TemplatePart> parts)
-
-
Method Details
-
condition
- Specified by:
conditionin interfaceTrees.Conditional- Returns:
- The value of the
conditionattribute
-
parts
- Specified by:
partsin interfaceTrees.Block- Returns:
- The value of the
partsattribute
-
withCondition
Copy the current immutable object by setting a value for theconditionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for condition- Returns:
- A modified copy of the
thisobject
-
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
public final ImmutableTrees.ConditionalBlock withParts(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
-
equals
This instance is equal to all instances ofConditionalBlockthat have equal attribute values. -
equalTo
-
hashCode
public int hashCode()Computes a hash code from attributes:condition,parts. -
toString
Prints the immutable valueConditionalBlockwith attribute values. -
copyOf
Creates an immutable copy of aTrees.ConditionalBlockvalue. 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 ConditionalBlock instance
-
builder
Creates a builder forConditionalBlock.ImmutableTrees.ConditionalBlock.builder() .condition(org.immutables.generator.processor.Trees.Expression) // requiredcondition.addParts|addAllParts(org.immutables.generator.processor.Trees.TemplatePart) //partselements .build();- Returns:
- A new ConditionalBlock builder
-