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