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.BuilderaddAllDependencies(Iterable<? extends Artifact> elements) Adds elements todependenciessortedSet.final RuntimeSpec.BuilderaddDependencies(Artifact... elements) Adds elements todependenciessortedSet.final RuntimeSpec.BuilderaddDependency(Artifact element) Adds one element todependenciessortedSet.final RuntimeSpec.BuilderapplicationClass(String applicationClass) Initializes the value for theapplicationClassattribute.build()Builds a newImmutableRuntimeSpec.final RuntimeSpec.Buildercapabilities(Map<String, ? extends CamelCapability> entries) Sets or replaces all mappings from the specified map as entries for thecapabilitiesmap.final RuntimeSpec.Builderdependencies(Iterable<? extends Artifact> elements) Sets or replaces all elements fordependenciessortedSet.final RuntimeSpec.Builderfrom(RuntimeSpec instance) Fill a builder with attribute values from the providedRuntimeSpecinstance.final RuntimeSpec.BuilderSets or replaces all mappings from the specified map as entries for themetadatamap.final RuntimeSpec.BuilderInitializes the value for theproviderattribute.final RuntimeSpec.BuilderputAllCapabilities(Map<String, ? extends CamelCapability> entries) Put all mappings from the specified map as entries tocapabilitiesmap.final RuntimeSpec.BuilderputAllMetadata(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tometadatamap.final RuntimeSpec.BuilderputCapability(String key, CamelCapability value) Put one entry to thecapabilitiesmap.final RuntimeSpec.BuilderputCapability(Map.Entry<String, ? extends CamelCapability> entry) Put one entry to thecapabilitiesmap.final RuntimeSpec.BuilderputMetadata(String key, String value) Put one entry to themetadatamap.final RuntimeSpec.BuilderputMetadata(Map.Entry<String, ? extends String> entry) Put one entry to themetadatamap.final RuntimeSpec.BuilderInitializes the value for theversionattribute.
-
Constructor Details
-
Builder
public Builder()Creates a builder forImmutableRuntimeSpecinstances.new RuntimeSpec.Builder() .provider(String) // requiredprovider.version(String) // requiredversion.applicationClass(String) // requiredapplicationClass.putMetadata|putAllMetadata(String => String) //metadatamappings .addDependency|addAllDependencies(org.apache.camel.k.catalog.model.Artifact) //dependencieselements .putCapability|putAllCapabilities(String => org.apache.camel.k.catalog.model.CamelCapability) //capabilitiesmappings .build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedRuntimeSpecinstance. 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
-
provider
Initializes the value for theproviderattribute.- Parameters:
provider- The value for provider- Returns:
thisbuilder for use in a chained invocation
-
version
Initializes the value for theversionattribute.- Parameters:
version- The value for version- Returns:
thisbuilder for use in a chained invocation
-
applicationClass
Initializes the value for theapplicationClassattribute.- Parameters:
applicationClass- The value for applicationClass- Returns:
thisbuilder for use in a chained invocation
-
putMetadata
Put one entry to themetadatamap.- Parameters:
key- The key in the metadata mapvalue- The associated value in the metadata map- Returns:
thisbuilder for use in a chained invocation
-
putMetadata
Put one entry to themetadatamap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
metadata
Sets or replaces all mappings from the specified map as entries for themetadatamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the metadata map- Returns:
thisbuilder for use in a chained invocation
-
putAllMetadata
Put all mappings from the specified map as entries tometadatamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the metadata map- Returns:
thisbuilder for use in a chained invocation
-
addDependency
Adds one element todependenciessortedSet.- Parameters:
element- A dependencies element- Returns:
thisbuilder for use in a chained invocation
-
addDependencies
Adds elements todependenciessortedSet.- Parameters:
elements- An array of dependencies elements- Returns:
thisbuilder for use in a chained invocation
-
dependencies
Sets or replaces all elements fordependenciessortedSet.- Parameters:
elements- An iterable of dependencies elements- Returns:
thisbuilder for use in a chained invocation
-
addAllDependencies
Adds elements todependenciessortedSet.- Parameters:
elements- An iterable of dependencies elements- Returns:
thisbuilder for use in a chained invocation
-
putCapability
Put one entry to thecapabilitiesmap.- Parameters:
key- The key in the capabilities mapvalue- The associated value in the capabilities map- Returns:
thisbuilder for use in a chained invocation
-
putCapability
Put one entry to thecapabilitiesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
capabilities
Sets or replaces all mappings from the specified map as entries for thecapabilitiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the capabilities map- Returns:
thisbuilder for use in a chained invocation
-
putAllCapabilities
Put all mappings from the specified map as entries tocapabilitiesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the capabilities map- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableRuntimeSpec.- Returns:
- An immutable instance of RuntimeSpec
- Throws:
IllegalStateException- if any required attributes are missing
-