Class ImmutableTrees.ValueDeclaration.Builder
- java.lang.Object
-
- org.immutables.generator.processor.ImmutableTrees.ValueDeclaration.Builder
-
- Enclosing class:
- ImmutableTrees.ValueDeclaration
@NotThreadSafe public static final class ImmutableTrees.ValueDeclaration.Builder extends java.lang.ObjectBuilds instances of typeValueDeclaration. 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 com.google.common.base.Optional<Trees.TypeReference>containedTypeprivate static longINIT_BIT_NAMEprivate longinitBitsprivate Trees.Identifiernameprivate com.google.common.base.Optional<Trees.TypeReference>type
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableTrees.ValueDeclarationbuild()Builds a newValueDeclaration.ImmutableTrees.ValueDeclaration.BuildercontainedType(com.google.common.base.Optional<? extends Trees.TypeReference> containedType)Initializes the optional valuecontainedTypeto containedType.ImmutableTrees.ValueDeclaration.BuildercontainedType(Trees.TypeReference containedType)Initializes the optional valuecontainedTypeto containedType.private java.lang.StringformatRequiredAttributesMessage()private voidfrom(short _unused, java.lang.Object object)ImmutableTrees.ValueDeclaration.Builderfrom(Trees.Named instance)Fill a builder with attribute values from the providedorg.immutables.generator.processor.Trees.Namedinstance.ImmutableTrees.ValueDeclaration.Builderfrom(Trees.ValueDeclaration instance)Fill a builder with attribute values from the providedorg.immutables.generator.processor.Trees.ValueDeclarationinstance.ImmutableTrees.ValueDeclaration.Buildername(Trees.Identifier name)Initializes the value for thenameattribute.ImmutableTrees.ValueDeclaration.Buildertype(com.google.common.base.Optional<? extends Trees.TypeReference> type)Initializes the optional valuetypeto type.ImmutableTrees.ValueDeclaration.Buildertype(Trees.TypeReference type)Initializes the optional valuetypeto type.
-
-
-
Field Detail
-
INIT_BIT_NAME
private static final long INIT_BIT_NAME
- See Also:
- Constant Field Values
-
initBits
private long initBits
-
name
@Nullable private Trees.Identifier name
-
type
private com.google.common.base.Optional<Trees.TypeReference> type
-
containedType
private com.google.common.base.Optional<Trees.TypeReference> containedType
-
-
Method Detail
-
from
public final ImmutableTrees.ValueDeclaration.Builder from(Trees.Named instance)
Fill a builder with attribute values from the providedorg.immutables.generator.processor.Trees.Namedinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
public final ImmutableTrees.ValueDeclaration.Builder from(Trees.ValueDeclaration instance)
Fill a builder with attribute values from the providedorg.immutables.generator.processor.Trees.ValueDeclarationinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
from
private void from(short _unused, java.lang.Object object)
-
name
public final ImmutableTrees.ValueDeclaration.Builder name(Trees.Identifier name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
type
public final ImmutableTrees.ValueDeclaration.Builder type(Trees.TypeReference type)
Initializes the optional valuetypeto type.- Parameters:
type- The value for type- Returns:
thisbuilder for chained invocation
-
type
public final ImmutableTrees.ValueDeclaration.Builder type(com.google.common.base.Optional<? extends Trees.TypeReference> type)
Initializes the optional valuetypeto type.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
containedType
public final ImmutableTrees.ValueDeclaration.Builder containedType(Trees.TypeReference containedType)
Initializes the optional valuecontainedTypeto containedType.- Parameters:
containedType- The value for containedType- Returns:
thisbuilder for chained invocation
-
containedType
public final ImmutableTrees.ValueDeclaration.Builder containedType(com.google.common.base.Optional<? extends Trees.TypeReference> containedType)
Initializes the optional valuecontainedTypeto containedType.- Parameters:
containedType- The value for containedType- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableTrees.ValueDeclaration build()
Builds a newValueDeclaration.- Returns:
- An immutable instance of ValueDeclaration
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
private java.lang.String formatRequiredAttributesMessage()
-
-