public static final class GeneratedImmutableTypedMap.Builder<K> extends Object
GeneratedImmutableTypedMap.
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 |
|---|---|
GeneratedImmutableTypedMap<K> |
build()
Builds a new
GeneratedImmutableTypedMap. |
GeneratedImmutableTypedMap.Builder<K> |
from(ImmutableTypedMap<K> instance)
Fill a builder with attribute values from the provided
ImmutableTypedMap instance. |
GeneratedImmutableTypedMap.Builder<K> |
map(Map<? extends Pair<K,? extends TypeInfo<?>>,? extends Object> entries)
Sets or replaces all mappings from the specified map as entries for the
map map. |
GeneratedImmutableTypedMap.Builder<K> |
putAllMap(Map<? extends Pair<K,? extends TypeInfo<?>>,? extends Object> entries)
Put all mappings from the specified map as entries to
map map. |
GeneratedImmutableTypedMap.Builder<K> |
putMap(Map.Entry<? extends Pair<K,? extends TypeInfo<?>>,? extends Object> entry)
Put one entry to the
map map. |
GeneratedImmutableTypedMap.Builder<K> |
putMap(Pair<K,? extends TypeInfo<?>> key,
Object value)
Put one entry to the
map map. |
public final GeneratedImmutableTypedMap.Builder<K> from(ImmutableTypedMap<K> instance)
ImmutableTypedMap 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 GeneratedImmutableTypedMap.Builder<K> putMap(Pair<K,? extends TypeInfo<?>> key, Object value)
map map.key - The key in the map mapvalue - The associated value in the map mapthis builder for use in a chained invocationpublic final GeneratedImmutableTypedMap.Builder<K> putMap(Map.Entry<? extends Pair<K,? extends TypeInfo<?>>,? extends Object> entry)
map map. Nulls are not permittedentry - The key and value entrythis builder for use in a chained invocationpublic final GeneratedImmutableTypedMap.Builder<K> map(Map<? extends Pair<K,? extends TypeInfo<?>>,? extends Object> entries)
map map. Nulls are not permittedentries - The entries that will be added to the map mapthis builder for use in a chained invocationpublic final GeneratedImmutableTypedMap.Builder<K> putAllMap(Map<? extends Pair<K,? extends TypeInfo<?>>,? extends Object> entries)
map map. Nulls are not permittedentries - The entries that will be added to the map mapthis builder for use in a chained invocationpublic GeneratedImmutableTypedMap<K> build()
GeneratedImmutableTypedMap.IllegalStateException - if any required attributes are missingCopyright © 2024. All rights reserved.