Package org.immutables.value.processor
Class ImmutableTypeAdapterTypes.Builder
- java.lang.Object
-
- org.immutables.value.processor.ImmutableTypeAdapterTypes.Builder
-
- Enclosing class:
- ImmutableTypeAdapterTypes
@NotThreadSafe public static final class ImmutableTypeAdapterTypes.Builder extends java.lang.ObjectBuilds instances of typeImmutableTypeAdapterTypes. 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 Proto.AbstractDeclaringdefinedByprivate static longINIT_BIT_DEFINED_BYprivate static longINIT_BIT_MIRRORprivate static longINIT_BIT_PACKAGE_GENERATEDprivate longinitBitsprivate GsonMirrors.TypeAdaptersmirrorprivate java.lang.StringpackageGeneratedprivate com.google.common.collect.ImmutableList.Builder<ValueType>types
-
Constructor Summary
Constructors Modifier Constructor Description privateBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableTypeAdapterTypes.BuilderaddAllTypes(java.lang.Iterable<? extends ValueType> elements)Adds elements totypeslist.ImmutableTypeAdapterTypes.BuilderaddTypes(ValueType element)Adds one element totypeslist.ImmutableTypeAdapterTypes.BuilderaddTypes(ValueType... elements)Adds elements totypeslist.ImmutableTypeAdapterTypesbuild()Builds a newImmutableTypeAdapterTypes.ImmutableTypeAdapterTypes.BuilderdefinedBy(Proto.AbstractDeclaring definedBy)Initializes the value for thedefinedByattribute.private java.lang.StringformatRequiredAttributesMessage()ImmutableTypeAdapterTypes.Builderfrom(Gsons.TypeAdapterTypes instance)Fill a builder with attribute values from the providedTypeAdapterTypesinstance.ImmutableTypeAdapterTypes.Buildermirror(GsonMirrors.TypeAdapters mirror)Initializes the value for themirrorattribute.ImmutableTypeAdapterTypes.BuilderpackageGenerated(java.lang.String packageGenerated)Initializes the value for thepackageGeneratedattribute.ImmutableTypeAdapterTypes.Buildertypes(java.lang.Iterable<? extends ValueType> elements)Sets or replaces all elements fortypeslist.
-
-
-
Field Detail
-
INIT_BIT_DEFINED_BY
private static final long INIT_BIT_DEFINED_BY
- See Also:
- Constant Field Values
-
INIT_BIT_PACKAGE_GENERATED
private static final long INIT_BIT_PACKAGE_GENERATED
- See Also:
- Constant Field Values
-
INIT_BIT_MIRROR
private static final long INIT_BIT_MIRROR
- See Also:
- Constant Field Values
-
initBits
private long initBits
-
definedBy
@Nullable private Proto.AbstractDeclaring definedBy
-
packageGenerated
@Nullable private java.lang.String packageGenerated
-
types
private com.google.common.collect.ImmutableList.Builder<ValueType> types
-
mirror
@Nullable private GsonMirrors.TypeAdapters mirror
-
-
Method Detail
-
from
public final ImmutableTypeAdapterTypes.Builder from(Gsons.TypeAdapterTypes instance)
Fill a builder with attribute values from the providedTypeAdapterTypesinstance. 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
-
definedBy
public final ImmutableTypeAdapterTypes.Builder definedBy(Proto.AbstractDeclaring definedBy)
Initializes the value for thedefinedByattribute.- Parameters:
definedBy- The value for definedBy- Returns:
thisbuilder for use in a chained invocation
-
packageGenerated
public final ImmutableTypeAdapterTypes.Builder packageGenerated(java.lang.String packageGenerated)
Initializes the value for thepackageGeneratedattribute.- Parameters:
packageGenerated- The value for packageGenerated- Returns:
thisbuilder for use in a chained invocation
-
addTypes
public final ImmutableTypeAdapterTypes.Builder addTypes(ValueType element)
Adds one element totypeslist.- Parameters:
element- A types element- Returns:
thisbuilder for use in a chained invocation
-
addTypes
public final ImmutableTypeAdapterTypes.Builder addTypes(ValueType... elements)
Adds elements totypeslist.- Parameters:
elements- An array of types elements- Returns:
thisbuilder for use in a chained invocation
-
types
public final ImmutableTypeAdapterTypes.Builder types(java.lang.Iterable<? extends ValueType> elements)
Sets or replaces all elements fortypeslist.- Parameters:
elements- An iterable of types elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTypes
public final ImmutableTypeAdapterTypes.Builder addAllTypes(java.lang.Iterable<? extends ValueType> elements)
Adds elements totypeslist.- Parameters:
elements- An iterable of types elements- Returns:
thisbuilder for use in a chained invocation
-
mirror
public final ImmutableTypeAdapterTypes.Builder mirror(GsonMirrors.TypeAdapters mirror)
Initializes the value for themirrorattribute.- Parameters:
mirror- The value for mirror- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableTypeAdapterTypes build()
Builds a newImmutableTypeAdapterTypes.- Returns:
- An immutable instance of TypeAdapterTypes
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
private java.lang.String formatRequiredAttributesMessage()
-
-