Class ImmutableStructurizer.Statement.Builder
- java.lang.Object
-
- org.immutables.value.processor.encode.ImmutableStructurizer.Statement.Builder
-
- Direct Known Subclasses:
Structurizer.Statement.Builder
- Enclosing class:
- ImmutableStructurizer.Statement
@NotThreadSafe public static class ImmutableStructurizer.Statement.Builder extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList.Builder<Code.Term>annotationsprivate com.google.common.collect.ImmutableList.Builder<Code.Term>blockprivate com.google.common.collect.ImmutableList.Builder<Structurizer.Statement>definitionsprivate com.google.common.collect.ImmutableList.Builder<Code.Term>expressionprivate com.google.common.base.Optional<java.lang.String>nameprivate static longOPT_BIT_NAMEprivate longoptBitsprivate com.google.common.collect.ImmutableList.Builder<Code.Term>parametersprivate com.google.common.collect.ImmutableList.Builder<Code.Term>signature
-
Method Summary
-
-
-
Field Detail
-
OPT_BIT_NAME
private static final long OPT_BIT_NAME
- See Also:
- Constant Field Values
-
optBits
private long optBits
-
annotations
private final com.google.common.collect.ImmutableList.Builder<Code.Term> annotations
-
signature
private final com.google.common.collect.ImmutableList.Builder<Code.Term> signature
-
parameters
private final com.google.common.collect.ImmutableList.Builder<Code.Term> parameters
-
expression
private final com.google.common.collect.ImmutableList.Builder<Code.Term> expression
-
block
private final com.google.common.collect.ImmutableList.Builder<Code.Term> block
-
definitions
private final com.google.common.collect.ImmutableList.Builder<Structurizer.Statement> definitions
-
name
@Nullable private com.google.common.base.Optional<java.lang.String> name
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forStatementinstances.new Structurizer.Statement.Builder() .addAnnotations|addAllAnnotations(org.immutables.value.processor.encode.Code.Term) //annotationselements .addSignature|addAllSignature(org.immutables.value.processor.encode.Code.Term) //signatureelements .addParameters|addAllParameters(org.immutables.value.processor.encode.Code.Term) //parameterselements .addExpression|addAllExpression(org.immutables.value.processor.encode.Code.Term) //expressionelements .addBlock|addAllBlock(org.immutables.value.processor.encode.Code.Term) //blockelements .addDefinitions|addAllDefinitions(org.immutables.value.processor.encode.Structurizer.Statement) //definitionselements .name(com.google.common.base.Optional<String>) // optionalname.build();
-
-
Method Detail
-
addAnnotations
public final Structurizer.Statement.Builder addAnnotations(Code.Term element)
Adds one element toannotationslist.- Parameters:
element- A annotations element- Returns:
thisbuilder for use in a chained invocation
-
addAnnotations
public final Structurizer.Statement.Builder addAnnotations(Code.Term... elements)
Adds elements toannotationslist.- Parameters:
elements- An array of annotations elements- Returns:
thisbuilder for use in a chained invocation
-
addAllAnnotations
public final Structurizer.Statement.Builder addAllAnnotations(java.lang.Iterable<? extends Code.Term> elements)
Adds elements toannotationslist.- Parameters:
elements- An iterable of annotations elements- Returns:
thisbuilder for use in a chained invocation
-
addSignature
public final Structurizer.Statement.Builder addSignature(Code.Term element)
Adds one element tosignaturelist.- Parameters:
element- A signature element- Returns:
thisbuilder for use in a chained invocation
-
addSignature
public final Structurizer.Statement.Builder addSignature(Code.Term... elements)
Adds elements tosignaturelist.- Parameters:
elements- An array of signature elements- Returns:
thisbuilder for use in a chained invocation
-
addAllSignature
public final Structurizer.Statement.Builder addAllSignature(java.lang.Iterable<? extends Code.Term> elements)
Adds elements tosignaturelist.- Parameters:
elements- An iterable of signature elements- Returns:
thisbuilder for use in a chained invocation
-
addParameters
public final Structurizer.Statement.Builder addParameters(Code.Term element)
Adds one element toparameterslist.- Parameters:
element- A parameters element- Returns:
thisbuilder for use in a chained invocation
-
addParameters
public final Structurizer.Statement.Builder addParameters(Code.Term... elements)
Adds elements toparameterslist.- Parameters:
elements- An array of parameters elements- Returns:
thisbuilder for use in a chained invocation
-
addAllParameters
public final Structurizer.Statement.Builder addAllParameters(java.lang.Iterable<? extends Code.Term> elements)
Adds elements toparameterslist.- Parameters:
elements- An iterable of parameters elements- Returns:
thisbuilder for use in a chained invocation
-
addExpression
public final Structurizer.Statement.Builder addExpression(Code.Term element)
Adds one element toexpressionlist.- Parameters:
element- A expression element- Returns:
thisbuilder for use in a chained invocation
-
addExpression
public final Structurizer.Statement.Builder addExpression(Code.Term... elements)
Adds elements toexpressionlist.- Parameters:
elements- An array of expression elements- Returns:
thisbuilder for use in a chained invocation
-
addAllExpression
public final Structurizer.Statement.Builder addAllExpression(java.lang.Iterable<? extends Code.Term> elements)
Adds elements toexpressionlist.- Parameters:
elements- An iterable of expression elements- Returns:
thisbuilder for use in a chained invocation
-
addBlock
public final Structurizer.Statement.Builder addBlock(Code.Term element)
Adds one element toblocklist.- Parameters:
element- A block element- Returns:
thisbuilder for use in a chained invocation
-
addBlock
public final Structurizer.Statement.Builder addBlock(Code.Term... elements)
Adds elements toblocklist.- Parameters:
elements- An array of block elements- Returns:
thisbuilder for use in a chained invocation
-
addAllBlock
public final Structurizer.Statement.Builder addAllBlock(java.lang.Iterable<? extends Code.Term> elements)
Adds elements toblocklist.- Parameters:
elements- An iterable of block elements- Returns:
thisbuilder for use in a chained invocation
-
addDefinitions
public final Structurizer.Statement.Builder addDefinitions(Structurizer.Statement element)
Adds one element todefinitionslist.- Parameters:
element- A definitions element- Returns:
thisbuilder for use in a chained invocation
-
addDefinitions
public final Structurizer.Statement.Builder addDefinitions(Structurizer.Statement... elements)
Adds elements todefinitionslist.- Parameters:
elements- An array of definitions elements- Returns:
thisbuilder for use in a chained invocation
-
addAllDefinitions
public final Structurizer.Statement.Builder addAllDefinitions(java.lang.Iterable<? extends Structurizer.Statement> elements)
Adds elements todefinitionslist.- Parameters:
elements- An iterable of definitions elements- Returns:
thisbuilder for use in a chained invocation
-
name
public final Structurizer.Statement.Builder name(com.google.common.base.Optional<java.lang.String> name)
Initializes the value for thenameattribute.If not set, this attribute will have a default value as returned by the initializer of
name.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
build
public Structurizer.Statement build()
Builds a newStatement.- Returns:
- An immutable instance of Statement
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
nameIsSet
private boolean nameIsSet()
-
checkNotIsSet
private static void checkNotIsSet(boolean isSet, java.lang.String name)
-
-