Class ImmutableRuntimeSpec.Builder
java.lang.Object
org.apache.camel.k.catalog.model.k8s.crd.ImmutableRuntimeSpec.Builder
- Direct Known Subclasses:
RuntimeSpec.Builder
- Enclosing class:
- ImmutableRuntimeSpec
Builds instances of type
ImmutableRuntimeSpec
.
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 RuntimeSpec.Builder
addAllDependencies
(Iterable<? extends Artifact> elements) Adds elements todependencies
sortedSet.final RuntimeSpec.Builder
addDependencies
(Artifact... elements) Adds elements todependencies
sortedSet.final RuntimeSpec.Builder
addDependency
(Artifact element) Adds one element todependencies
sortedSet.final RuntimeSpec.Builder
applicationClass
(String applicationClass) Initializes the value for theapplicationClass
attribute.build()
Builds a newImmutableRuntimeSpec
.final RuntimeSpec.Builder
capabilities
(Map<String, ? extends CamelCapability> entries) Sets or replaces all mappings from the specified map as entries for thecapabilities
map.final RuntimeSpec.Builder
dependencies
(Iterable<? extends Artifact> elements) Sets or replaces all elements fordependencies
sortedSet.final RuntimeSpec.Builder
from
(RuntimeSpec instance) Fill a builder with attribute values from the providedRuntimeSpec
instance.final RuntimeSpec.Builder
Sets or replaces all mappings from the specified map as entries for themetadata
map.final RuntimeSpec.Builder
Initializes the value for theprovider
attribute.final RuntimeSpec.Builder
putAllCapabilities
(Map<String, ? extends CamelCapability> entries) Put all mappings from the specified map as entries tocapabilities
map.final RuntimeSpec.Builder
putAllMetadata
(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tometadata
map.final RuntimeSpec.Builder
putCapability
(String key, CamelCapability value) Put one entry to thecapabilities
map.final RuntimeSpec.Builder
putCapability
(Map.Entry<String, ? extends CamelCapability> entry) Put one entry to thecapabilities
map.final RuntimeSpec.Builder
putMetadata
(String key, String value) Put one entry to themetadata
map.final RuntimeSpec.Builder
putMetadata
(Map.Entry<String, ? extends String> entry) Put one entry to themetadata
map.final RuntimeSpec.Builder
Initializes the value for theversion
attribute.
-
Constructor Details
-
Builder
public Builder()Creates a builder forImmutableRuntimeSpec
instances.new RuntimeSpec.Builder() .provider(String) // required
provider
.version(String) // requiredversion
.applicationClass(String) // requiredapplicationClass
.putMetadata|putAllMetadata(String => String) //metadata
mappings .addDependency|addAllDependencies(org.apache.camel.k.catalog.model.Artifact) //dependencies
elements .putCapability|putAllCapabilities(String => org.apache.camel.k.catalog.model.CamelCapability) //capabilities
mappings .build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedRuntimeSpec
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
-
provider
Initializes the value for theprovider
attribute.- Parameters:
provider
- The value for provider- Returns:
this
builder for use in a chained invocation
-
version
Initializes the value for theversion
attribute.- Parameters:
version
- The value for version- Returns:
this
builder for use in a chained invocation
-
applicationClass
Initializes the value for theapplicationClass
attribute.- Parameters:
applicationClass
- The value for applicationClass- Returns:
this
builder for use in a chained invocation
-
putMetadata
Put one entry to themetadata
map.- Parameters:
key
- The key in the metadata mapvalue
- The associated value in the metadata map- Returns:
this
builder for use in a chained invocation
-
putMetadata
Put one entry to themetadata
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
metadata
Sets or replaces all mappings from the specified map as entries for themetadata
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the metadata map- Returns:
this
builder for use in a chained invocation
-
putAllMetadata
Put all mappings from the specified map as entries tometadata
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the metadata map- Returns:
this
builder for use in a chained invocation
-
addDependency
Adds one element todependencies
sortedSet.- Parameters:
element
- A dependencies element- Returns:
this
builder for use in a chained invocation
-
addDependencies
Adds elements todependencies
sortedSet.- Parameters:
elements
- An array of dependencies elements- Returns:
this
builder for use in a chained invocation
-
dependencies
Sets or replaces all elements fordependencies
sortedSet.- Parameters:
elements
- An iterable of dependencies elements- Returns:
this
builder for use in a chained invocation
-
addAllDependencies
Adds elements todependencies
sortedSet.- Parameters:
elements
- An iterable of dependencies elements- Returns:
this
builder for use in a chained invocation
-
putCapability
Put one entry to thecapabilities
map.- Parameters:
key
- The key in the capabilities mapvalue
- The associated value in the capabilities map- Returns:
this
builder for use in a chained invocation
-
putCapability
Put one entry to thecapabilities
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
capabilities
Sets or replaces all mappings from the specified map as entries for thecapabilities
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the capabilities map- Returns:
this
builder for use in a chained invocation
-
putAllCapabilities
Put all mappings from the specified map as entries tocapabilities
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the capabilities map- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableRuntimeSpec
.- Returns:
- An immutable instance of RuntimeSpec
- Throws:
IllegalStateException
- if any required attributes are missing
-