Class ImmutableObjectMeta.Builder
java.lang.Object
org.apache.camel.k.catalog.model.k8s.ImmutableObjectMeta.Builder
- Direct Known Subclasses:
ObjectMeta.Builder
- Enclosing class:
- ImmutableObjectMeta
Builds instances of type
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutableObjectMeta.final ObjectMeta.Builderfrom(ObjectMeta instance) Fill a builder with attribute values from the providedObjectMetainstance.final ObjectMeta.BuilderSets or replaces all mappings from the specified map as entries for thelabelsmap.final ObjectMeta.BuilderInitializes the value for thenameattribute.final ObjectMeta.BuilderputAllLabels(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tolabelsmap.final ObjectMeta.BuilderPut one entry to thelabelsmap.final ObjectMeta.BuilderPut one entry to thelabelsmap.
-
Constructor Details
-
Builder
public Builder()Creates a builder forImmutableObjectMetainstances.new ObjectMeta.Builder() .name(String) // requiredname.putLabels|putAllLabels(String => String) //labelsmappings .build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedObjectMetainstance. 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.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
name
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
putLabels
Put one entry to thelabelsmap.- Parameters:
key- The key in the labels mapvalue- The associated value in the labels map- Returns:
thisbuilder for use in a chained invocation
-
putLabels
Put one entry to thelabelsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
labels
Sets or replaces all mappings from the specified map as entries for thelabelsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the labels map- Returns:
thisbuilder for use in a chained invocation
-
putAllLabels
Put all mappings from the specified map as entries tolabelsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the labels map- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableObjectMeta.- Returns:
- An immutable instance of ObjectMeta
- Throws:
IllegalStateException- if any required attributes are missing
-