@NotThreadSafe public static final class ImmutableSample.Builder extends Object
ImmutableSample.
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 |
|---|---|
ImmutableSample |
build()
Builds a new
ImmutableSample. |
ImmutableSample.Builder |
components(Map<? extends BackupClusterUid,? extends Optional<Long>> entries)
Sets or replaces all mappings from the specified map as entries for the
components map. |
ImmutableSample.Builder |
from(Sample instance)
Fill a builder with attribute values from the provided
Sample instance. |
ImmutableSample.Builder |
putAllComponents(Map<? extends BackupClusterUid,? extends Optional<Long>> entries)
Put all mappings from the specified map as entries to
components map. |
ImmutableSample.Builder |
putComponents(BackupClusterUid key,
Optional<Long> value)
Put one entry to the
components map. |
ImmutableSample.Builder |
putComponents(Map.Entry<? extends BackupClusterUid,? extends Optional<Long>> entry)
Put one entry to the
components map. |
ImmutableSample.Builder |
timestamp(Instant timestamp)
Initializes the value for the
timestamp attribute. |
ImmutableSample.Builder |
value(long value)
Initializes the optional value
value to value. |
ImmutableSample.Builder |
value(Optional<Long> value)
Initializes the optional value
value to value. |
public final ImmutableSample.Builder from(Sample instance)
Sample instance.
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.instance - The instance from which to copy valuesthis builder for use in a chained invocationpublic final ImmutableSample.Builder timestamp(Instant timestamp)
timestamp attribute.timestamp - The value for timestampthis builder for use in a chained invocationpublic final ImmutableSample.Builder value(long value)
value to value.value - The value for valuethis builder for chained invocationpublic final ImmutableSample.Builder value(Optional<Long> value)
value to value.value - The value for valuethis builder for use in a chained invocationpublic final ImmutableSample.Builder putComponents(BackupClusterUid key, Optional<Long> value)
components map.key - The key in the components mapvalue - The associated value in the components mapthis builder for use in a chained invocationpublic final ImmutableSample.Builder putComponents(Map.Entry<? extends BackupClusterUid,? extends Optional<Long>> entry)
components map. Nulls are not permittedentry - The key and value entrythis builder for use in a chained invocationpublic final ImmutableSample.Builder components(Map<? extends BackupClusterUid,? extends Optional<Long>> entries)
components map. Nulls are not permittedentries - The entries that will be added to the components mapthis builder for use in a chained invocationpublic final ImmutableSample.Builder putAllComponents(Map<? extends BackupClusterUid,? extends Optional<Long>> entries)
components map. Nulls are not permittedentries - The entries that will be added to the components mapthis builder for use in a chained invocationpublic ImmutableSample build()
ImmutableSample.IllegalStateException - if any required attributes are missingCopyright © 2023 iland Internet Solutions, Corp. All rights reserved.