Class ImmutableCamelCatalogSpec.Builder
java.lang.Object
org.apache.camel.k.catalog.model.k8s.crd.ImmutableCamelCatalogSpec.Builder
- Direct Known Subclasses:
CamelCatalogSpec.Builder
- Enclosing class:
- ImmutableCamelCatalogSpec
Builds instances of type
ImmutableCamelCatalogSpec
.
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 TypeMethodDescriptionfinal CamelCatalogSpec.Builder
artifacts
(Map<String, ? extends CamelArtifact> entries) Sets or replaces all mappings from the specified map as entries for theartifacts
map.build()
Builds a newImmutableCamelCatalogSpec
.final CamelCatalogSpec.Builder
from
(CamelCatalogSpec instance) Fill a builder with attribute values from the providedCamelCatalogSpec
instance.final CamelCatalogSpec.Builder
loaders
(Map<String, ? extends CamelLoader> entries) Sets or replaces all mappings from the specified map as entries for theloaders
map.final CamelCatalogSpec.Builder
putAllArtifacts
(Map<String, ? extends CamelArtifact> entries) Put all mappings from the specified map as entries toartifacts
map.final CamelCatalogSpec.Builder
putAllLoaders
(Map<String, ? extends CamelLoader> entries) Put all mappings from the specified map as entries toloaders
map.final CamelCatalogSpec.Builder
putArtifact
(String key, CamelArtifact value) Put one entry to theartifacts
map.final CamelCatalogSpec.Builder
putArtifact
(Map.Entry<String, ? extends CamelArtifact> entry) Put one entry to theartifacts
map.final CamelCatalogSpec.Builder
putLoader
(String key, CamelLoader value) Put one entry to theloaders
map.final CamelCatalogSpec.Builder
putLoader
(Map.Entry<String, ? extends CamelLoader> entry) Put one entry to theloaders
map.final CamelCatalogSpec.Builder
runtime
(RuntimeSpec runtime) Initializes the value for theruntime
attribute.
-
Constructor Details
-
Builder
public Builder()Creates a builder forImmutableCamelCatalogSpec
instances.new CamelCatalogSpec.Builder() .runtime(org.apache.camel.k.catalog.model.k8s.crd.RuntimeSpec) // required
runtime
.putArtifact|putAllArtifacts(String => org.apache.camel.k.catalog.model.CamelArtifact) //artifacts
mappings .putLoader|putAllLoaders(String => org.apache.camel.k.catalog.model.CamelLoader) //loaders
mappings .build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedCamelCatalogSpec
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.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
runtime
Initializes the value for theruntime
attribute.- Parameters:
runtime
- The value for runtime- Returns:
this
builder for use in a chained invocation
-
putArtifact
Put one entry to theartifacts
map.- Parameters:
key
- The key in the artifacts mapvalue
- The associated value in the artifacts map- Returns:
this
builder for use in a chained invocation
-
putArtifact
Put one entry to theartifacts
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
artifacts
Sets or replaces all mappings from the specified map as entries for theartifacts
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the artifacts map- Returns:
this
builder for use in a chained invocation
-
putAllArtifacts
Put all mappings from the specified map as entries toartifacts
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the artifacts map- Returns:
this
builder for use in a chained invocation
-
putLoader
Put one entry to theloaders
map.- Parameters:
key
- The key in the loaders mapvalue
- The associated value in the loaders map- Returns:
this
builder for use in a chained invocation
-
putLoader
Put one entry to theloaders
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
loaders
Sets or replaces all mappings from the specified map as entries for theloaders
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the loaders map- Returns:
this
builder for use in a chained invocation
-
putAllLoaders
Put all mappings from the specified map as entries toloaders
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the loaders map- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableCamelCatalogSpec
.- Returns:
- An immutable instance of CamelCatalogSpec
- Throws:
IllegalStateException
- if any required attributes are missing
-