public static class ImmutableObjectMeta.Builder extends Object
ImmutableObjectMeta.
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.
| Constructor and Description |
|---|
Builder()
Creates a builder for
ImmutableObjectMeta instances. |
| Modifier and Type | Method and Description |
|---|---|
ImmutableObjectMeta |
build()
Builds a new
ImmutableObjectMeta. |
ObjectMeta.Builder |
from(ObjectMeta instance)
Fill a builder with attribute values from the provided
ObjectMeta instance. |
ObjectMeta.Builder |
labels(Map<String,? extends String> entries)
Sets or replaces all mappings from the specified map as entries for the
labels map. |
ObjectMeta.Builder |
name(String name)
Initializes the value for the
name attribute. |
ObjectMeta.Builder |
putAllLabels(Map<String,? extends String> entries)
Put all mappings from the specified map as entries to
labels map. |
ObjectMeta.Builder |
putLabels(Map.Entry<String,? extends String> entry)
Put one entry to the
labels map. |
ObjectMeta.Builder |
putLabels(String key,
String value)
Put one entry to the
labels map. |
public Builder()
ImmutableObjectMeta instances.
new ObjectMeta.Builder()
.name(String) // required name
.putLabels|putAllLabels(String => String) // labels mappings
.build();
public final ObjectMeta.Builder from(ObjectMeta instance)
ObjectMeta 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 ObjectMeta.Builder name(String name)
name attribute.name - The value for namethis builder for use in a chained invocationpublic final ObjectMeta.Builder putLabels(String key, String value)
labels map.key - The key in the labels mapvalue - The associated value in the labels mapthis builder for use in a chained invocationpublic final ObjectMeta.Builder putLabels(Map.Entry<String,? extends String> entry)
labels map. Nulls are not permittedentry - The key and value entrythis builder for use in a chained invocationpublic final ObjectMeta.Builder labels(Map<String,? extends String> entries)
labels map. Nulls are not permittedentries - The entries that will be added to the labels mapthis builder for use in a chained invocationpublic final ObjectMeta.Builder putAllLabels(Map<String,? extends String> entries)
labels map. Nulls are not permittedentries - The entries that will be added to the labels mapthis builder for use in a chained invocationpublic ImmutableObjectMeta build()
ImmutableObjectMeta.IllegalStateException - if any required attributes are missingCopyright © 2019 The Apache Software Foundation. All rights reserved.