@NotThreadSafe public static final class ImmutableIdModel.Builder extends Object
ImmutableIdModel.
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 |
|---|---|
ImmutableIdModel |
build()
Builds a new
ImmutableIdModel. |
ImmutableIdModel.Builder |
codecName(String codecName)
Initializes the value for the
codecName attribute. |
ImmutableIdModel.Builder |
conversion(ch.rasc.bsoncodec.annotation.Id.IdConversion conversion)
Initializes the value for the
conversion attribute. |
ImmutableIdModel.Builder |
from(IdModel instance)
Fill a builder with attribute values from the provided
IdModel instance. |
ImmutableIdModel.Builder |
generatorName(String generatorName)
Initializes the value for the
generatorName attribute. |
@CanIgnoreReturnValue public final ImmutableIdModel.Builder from(IdModel instance)
IdModel 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 ImmutableIdModel.Builder generatorName(@Nullable String generatorName)
generatorName attribute.generatorName - The value for generatorName (can be null)this builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableIdModel.Builder conversion(@Nullable ch.rasc.bsoncodec.annotation.Id.IdConversion conversion)
conversion attribute.conversion - The value for conversion (can be null)this builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableIdModel.Builder codecName(@Nullable String codecName)
codecName attribute.codecName - The value for codecName (can be null)this builder for use in a chained invocationpublic ImmutableIdModel build()
ImmutableIdModel.IllegalStateException - if any required attributes are missingCopyright © 2015–2018. All rights reserved.