@NotThreadSafe public static final class ImmutableFieldModel.Builder extends Object
ImmutableFieldModel.
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.
| Modifier and Type | Method and Description |
|---|---|
ImmutableFieldModel |
build()
Builds a new
ImmutableFieldModel. |
ImmutableFieldModel.Builder |
codeGen(CodeGen codeGen)
Initializes the value for the
codeGen attribute. |
ImmutableFieldModel.Builder |
customCodecName(String customCodecName)
Initializes the value for the
customCodecName attribute. |
ImmutableFieldModel.Builder |
disableDecodeNullCheck(boolean disableDecodeNullCheck)
Initializes the value for the
disableDecodeNullCheck attribute. |
ImmutableFieldModel.Builder |
disableEncodeNullCheck(boolean disableEncodeNullCheck)
Initializes the value for the
disableEncodeNullCheck attribute. |
ImmutableFieldModel.Builder |
disableSetNullStatement(boolean disableSetNullStatement)
Initializes the value for the
disableSetNullStatement attribute. |
ImmutableFieldModel.Builder |
fixedArray(int fixedArray)
Initializes the value for the
fixedArray attribute. |
ImmutableFieldModel.Builder |
from(FieldModel instance)
Fill a builder with attribute values from the provided
FieldModel instance. |
ImmutableFieldModel.Builder |
idModel(IdModel idModel)
Initializes the value for the
idModel attribute. |
ImmutableFieldModel.Builder |
methodNameGet(String methodNameGet)
Initializes the value for the
methodNameGet attribute. |
ImmutableFieldModel.Builder |
methodNameSet(String methodNameSet)
Initializes the value for the
methodNameSet attribute. |
ImmutableFieldModel.Builder |
name(String name)
Initializes the value for the
name attribute. |
ImmutableFieldModel.Builder |
order(int order)
Initializes the value for the
order attribute. |
ImmutableFieldModel.Builder |
storeEmptyCollection(boolean storeEmptyCollection)
Initializes the value for the
storeEmptyCollection attribute. |
ImmutableFieldModel.Builder |
storeNullValue(boolean storeNullValue)
Initializes the value for the
storeNullValue attribute. |
ImmutableFieldModel.Builder |
varEl(VariableElement varEl)
Initializes the value for the
varEl attribute. |
@CanIgnoreReturnValue public final ImmutableFieldModel.Builder from(FieldModel instance)
FieldModel instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder varEl(VariableElement varEl)
varEl attribute.varEl - The value for varElthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder name(String name)
name attribute.
If not set, this attribute will have a default value as returned by the initializer of name.
name - The value for namethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder order(int order)
order attribute.order - The value for orderthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder customCodecName(@Nullable String customCodecName)
customCodecName attribute.customCodecName - The value for customCodecName (can be null)this builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder codeGen(CodeGen codeGen)
codeGen attribute.codeGen - The value for codeGenthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder storeNullValue(boolean storeNullValue)
storeNullValue attribute.
If not set, this attribute will have a default value as returned by the initializer of storeNullValue.
storeNullValue - The value for storeNullValuethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder storeEmptyCollection(boolean storeEmptyCollection)
storeEmptyCollection attribute.
If not set, this attribute will have a default value as returned by the initializer of storeEmptyCollection.
storeEmptyCollection - The value for storeEmptyCollectionthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder disableEncodeNullCheck(boolean disableEncodeNullCheck)
disableEncodeNullCheck attribute.
If not set, this attribute will have a default value as returned by the initializer of disableEncodeNullCheck.
disableEncodeNullCheck - The value for disableEncodeNullCheckthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder disableDecodeNullCheck(boolean disableDecodeNullCheck)
disableDecodeNullCheck attribute.
If not set, this attribute will have a default value as returned by the initializer of disableDecodeNullCheck.
disableDecodeNullCheck - The value for disableDecodeNullCheckthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder disableSetNullStatement(boolean disableSetNullStatement)
disableSetNullStatement attribute.
If not set, this attribute will have a default value as returned by the initializer of disableSetNullStatement.
disableSetNullStatement - The value for disableSetNullStatementthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder fixedArray(int fixedArray)
fixedArray attribute.
If not set, this attribute will have a default value as returned by the initializer of fixedArray.
fixedArray - The value for fixedArraythis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder idModel(@Nullable IdModel idModel)
idModel attribute.idModel - The value for idModel (can be null)this builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder methodNameSet(String methodNameSet)
methodNameSet attribute.methodNameSet - The value for methodNameSetthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableFieldModel.Builder methodNameGet(String methodNameGet)
methodNameGet attribute.methodNameGet - The value for methodNameGetthis builder for use in a chained invocationpublic ImmutableFieldModel build()
ImmutableFieldModel.IllegalStateException - if any required attributes are missingCopyright © 2015–2018. All rights reserved.