Class ImmutableTrees.IfStatement.Builder
java.lang.Object
org.immutables.generator.processor.ImmutableTrees.IfStatement.Builder
- Enclosing class:
ImmutableTrees.IfStatement
Builds instances of type
IfStatement.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate longprivate com.google.common.base.Optional<Trees.Block> private com.google.common.collect.ImmutableList.Builder<Trees.ConditionalBlock> private Trees.ConditionalBlock -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllOtherwiseIf(Iterable<? extends Trees.ConditionalBlock> elements) Adds elements tootherwiseIflist.addOtherwiseIf(Trees.ConditionalBlock element) Adds one element tootherwiseIflist.addOtherwiseIf(Trees.ConditionalBlock... elements) Adds elements tootherwiseIflist.build()Builds a newIfStatement.private Stringfrom(Trees.IfStatement instance) Fill a builder with attribute values from the providedIfStatementinstance.otherwise(com.google.common.base.Optional<? extends Trees.Block> otherwise) Initializes the optional valueotherwiseto otherwise.otherwise(Trees.Block otherwise) Initializes the optional valueotherwiseto otherwise.otherwiseIf(Iterable<? extends Trees.ConditionalBlock> elements) Sets or replaces all elements forotherwiseIflist.then(Trees.ConditionalBlock then) Initializes the value for thethenattribute.
-
Field Details
-
INIT_BIT_THEN
private static final long INIT_BIT_THEN- See Also:
-
initBits
private long initBits -
then
-
otherwiseIf
-
otherwise
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
from
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
Initializes the value for thethenattribute.- Parameters:
then- The value for then- Returns:
thisbuilder for use in a chained invocation
-
addOtherwiseIf
Adds one element tootherwiseIflist.- Parameters:
element- A otherwiseIf element- Returns:
thisbuilder for use in a chained invocation
-
addOtherwiseIf
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(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(Iterable<? extends Trees.ConditionalBlock> elements) Adds elements tootherwiseIflist.- Parameters:
elements- An iterable of otherwiseIf elements- Returns:
thisbuilder for use in a chained invocation
-
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
Builds a newIfStatement.- Returns:
- An immutable instance of IfStatement
- Throws:
IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
-