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