Class ImmutableTrees.IfStatement.Builder
- java.lang.Object
-
- org.immutables.generator.processor.ImmutableTrees.IfStatement.Builder
-
- Enclosing class:
- ImmutableTrees.IfStatement
@NotThreadSafe public static final class ImmutableTrees.IfStatement.Builder extends java.lang.ObjectBuilds instances of typeIfStatement. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Field Summary
Fields Modifier and Type Field Description private static longINIT_BIT_THENprivate longinitBitsprivate com.google.common.base.Optional<Trees.Block>otherwiseprivate com.google.common.collect.ImmutableList.Builder<Trees.ConditionalBlock>otherwiseIfprivate Trees.ConditionalBlockthen
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()
-
Method Summary
-
-
-
Field Detail
-
INIT_BIT_THEN
private static final long INIT_BIT_THEN
- See Also:
- Constant Field Values
-
initBits
private long initBits
-
then
@Nullable private Trees.ConditionalBlock then
-
otherwiseIf
private com.google.common.collect.ImmutableList.Builder<Trees.ConditionalBlock> otherwiseIf
-
otherwise
private com.google.common.base.Optional<Trees.Block> otherwise
-
-
Method Detail
-
from
public final ImmutableTrees.IfStatement.Builder from(Trees.IfStatement instance)
Fill a builder with attribute values from the providedIfStatementinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
then
public final ImmutableTrees.IfStatement.Builder then(Trees.ConditionalBlock then)
Initializes the value for thethenattribute.- Parameters:
then- The value for then- Returns:
thisbuilder for use in a chained invocation
-
addOtherwiseIf
public final ImmutableTrees.IfStatement.Builder addOtherwiseIf(Trees.ConditionalBlock element)
Adds one element tootherwiseIflist.- Parameters:
element- A otherwiseIf element- Returns:
thisbuilder for use in a chained invocation
-
addOtherwiseIf
public final ImmutableTrees.IfStatement.Builder addOtherwiseIf(Trees.ConditionalBlock... elements)
Adds elements tootherwiseIflist.- Parameters:
elements- An array of otherwiseIf elements- Returns:
thisbuilder for use in a chained invocation
-
otherwiseIf
public final ImmutableTrees.IfStatement.Builder otherwiseIf(java.lang.Iterable<? extends Trees.ConditionalBlock> elements)
Sets or replaces all elements forotherwiseIflist.- Parameters:
elements- An iterable of otherwiseIf elements- Returns:
thisbuilder for use in a chained invocation
-
addAllOtherwiseIf
public final ImmutableTrees.IfStatement.Builder addAllOtherwiseIf(java.lang.Iterable<? extends Trees.ConditionalBlock> elements)
Adds elements tootherwiseIflist.- Parameters:
elements- An iterable of otherwiseIf elements- Returns:
thisbuilder for use in a chained invocation
-
otherwise
public final ImmutableTrees.IfStatement.Builder otherwise(Trees.Block otherwise)
Initializes the optional valueotherwiseto otherwise.- Parameters:
otherwise- The value for otherwise- Returns:
thisbuilder for chained invocation
-
otherwise
public final ImmutableTrees.IfStatement.Builder otherwise(com.google.common.base.Optional<? extends Trees.Block> otherwise)
Initializes the optional valueotherwiseto otherwise.- Parameters:
otherwise- The value for otherwise- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableTrees.IfStatement build()
Builds a newIfStatement.- Returns:
- An immutable instance of IfStatement
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
private java.lang.String formatRequiredAttributesMessage()
-
-