Package org.immutables.value.processor
Class ImmutableTypeAdapterTypes.Builder
java.lang.Object
org.immutables.value.processor.ImmutableTypeAdapterTypes.Builder
- Enclosing class:
ImmutableTypeAdapterTypes
Builds instances of type
ImmutableTypeAdapterTypes.
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 Proto.AbstractDeclaringprivate static final longprivate static final longprivate static final longprivate longprivate GsonMirrors.TypeAdaptersprivate Stringprivate com.google.common.collect.ImmutableList.Builder<ValueType> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAllTypes(Iterable<? extends ValueType> elements) Adds elements totypeslist.Adds one element totypeslist.Adds elements totypeslist.build()Builds a newImmutableTypeAdapterTypes.definedBy(Proto.AbstractDeclaring definedBy) Initializes the value for thedefinedByattribute.private Stringfrom(Gsons.TypeAdapterTypes instance) Fill a builder with attribute values from the providedTypeAdapterTypesinstance.mirror(GsonMirrors.TypeAdapters mirror) Initializes the value for themirrorattribute.packageGenerated(String packageGenerated) Initializes the value for thepackageGeneratedattribute.Sets or replaces all elements fortypeslist.
-
Field Details
-
INIT_BIT_DEFINED_BY
private static final long INIT_BIT_DEFINED_BY- See Also:
-
INIT_BIT_PACKAGE_GENERATED
private static final long INIT_BIT_PACKAGE_GENERATED- See Also:
-
INIT_BIT_MIRROR
private static final long INIT_BIT_MIRROR- See Also:
-
initBits
private long initBits -
definedBy
-
packageGenerated
-
types
-
mirror
-
-
Constructor Details
-
Builder
private Builder()
-
-
Method Details
-
from
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
Initializes the value for thedefinedByattribute.- Parameters:
definedBy- The value for definedBy- Returns:
thisbuilder for use in a chained invocation
-
packageGenerated
Initializes the value for thepackageGeneratedattribute.- Parameters:
packageGenerated- The value for packageGenerated- Returns:
thisbuilder for use in a chained invocation
-
addTypes
Adds one element totypeslist.- Parameters:
element- A types element- Returns:
thisbuilder for use in a chained invocation
-
addTypes
Adds elements totypeslist.- Parameters:
elements- An array of types elements- Returns:
thisbuilder for use in a chained invocation
-
types
Sets or replaces all elements fortypeslist.- Parameters:
elements- An iterable of types elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTypes
Adds elements totypeslist.- Parameters:
elements- An iterable of types elements- Returns:
thisbuilder for use in a chained invocation
-
mirror
Initializes the value for themirrorattribute.- Parameters:
mirror- The value for mirror- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableTypeAdapterTypes.- Returns:
- An immutable instance of TypeAdapterTypes
- Throws:
IllegalStateException- if any required attributes are missing
-
formatRequiredAttributesMessage
-