Class ImmutableRuntimeSpec.Builder
- java.lang.Object
-
- org.apache.camel.k.catalog.model.k8s.crd.ImmutableRuntimeSpec.Builder
-
- Direct Known Subclasses:
RuntimeSpec.Builder
- Enclosing class:
- ImmutableRuntimeSpec
public static class ImmutableRuntimeSpec.Builder extends Object
Builds instances of typeImmutableRuntimeSpec
. Initialize attributes and then invoke thebuild()
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 Constructor Description Builder()
Creates a builder forImmutableRuntimeSpec
instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RuntimeSpec.Builder
addAllDependencies(Iterable<? extends Artifact> elements)
Adds elements todependencies
sortedSet.RuntimeSpec.Builder
addDependencies(Artifact... elements)
Adds elements todependencies
sortedSet.RuntimeSpec.Builder
addDependency(Artifact element)
Adds one element todependencies
sortedSet.RuntimeSpec.Builder
applicationClass(String applicationClass)
Initializes the value for theapplicationClass
attribute.ImmutableRuntimeSpec
build()
Builds a newImmutableRuntimeSpec
.RuntimeSpec.Builder
capabilities(Map<String,? extends CamelCapability> entries)
Sets or replaces all mappings from the specified map as entries for thecapabilities
map.RuntimeSpec.Builder
dependencies(Iterable<? extends Artifact> elements)
Sets or replaces all elements fordependencies
sortedSet.RuntimeSpec.Builder
from(RuntimeSpec instance)
Fill a builder with attribute values from the providedRuntimeSpec
instance.RuntimeSpec.Builder
metadata(Map<String,? extends String> entries)
Sets or replaces all mappings from the specified map as entries for themetadata
map.RuntimeSpec.Builder
provider(String provider)
Initializes the value for theprovider
attribute.RuntimeSpec.Builder
putAllCapabilities(Map<String,? extends CamelCapability> entries)
Put all mappings from the specified map as entries tocapabilities
map.RuntimeSpec.Builder
putAllMetadata(Map<String,? extends String> entries)
Put all mappings from the specified map as entries tometadata
map.RuntimeSpec.Builder
putCapability(String key, CamelCapability value)
Put one entry to thecapabilities
map.RuntimeSpec.Builder
putCapability(Map.Entry<String,? extends CamelCapability> entry)
Put one entry to thecapabilities
map.RuntimeSpec.Builder
putMetadata(String key, String value)
Put one entry to themetadata
map.RuntimeSpec.Builder
putMetadata(Map.Entry<String,? extends String> entry)
Put one entry to themetadata
map.RuntimeSpec.Builder
version(String version)
Initializes the value for theversion
attribute.
-
-
-
Constructor Detail
-
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 Detail
-
from
public final RuntimeSpec.Builder from(RuntimeSpec instance)
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
public final RuntimeSpec.Builder provider(String provider)
Initializes the value for theprovider
attribute.- Parameters:
provider
- The value for provider- Returns:
this
builder for use in a chained invocation
-
version
public final RuntimeSpec.Builder version(String version)
Initializes the value for theversion
attribute.- Parameters:
version
- The value for version- Returns:
this
builder for use in a chained invocation
-
applicationClass
public final RuntimeSpec.Builder applicationClass(String applicationClass)
Initializes the value for theapplicationClass
attribute.- Parameters:
applicationClass
- The value for applicationClass- Returns:
this
builder for use in a chained invocation
-
putMetadata
public final RuntimeSpec.Builder putMetadata(String key, String value)
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
public final RuntimeSpec.Builder putMetadata(Map.Entry<String,? extends String> entry)
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
public final RuntimeSpec.Builder metadata(Map<String,? extends String> entries)
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
public final RuntimeSpec.Builder putAllMetadata(Map<String,? extends String> entries)
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
public final RuntimeSpec.Builder addDependency(Artifact element)
Adds one element todependencies
sortedSet.- Parameters:
element
- A dependencies element- Returns:
this
builder for use in a chained invocation
-
addDependencies
public final RuntimeSpec.Builder addDependencies(Artifact... elements)
Adds elements todependencies
sortedSet.- Parameters:
elements
- An array of dependencies elements- Returns:
this
builder for use in a chained invocation
-
dependencies
public final RuntimeSpec.Builder dependencies(Iterable<? extends Artifact> elements)
Sets or replaces all elements fordependencies
sortedSet.- Parameters:
elements
- An iterable of dependencies elements- Returns:
this
builder for use in a chained invocation
-
addAllDependencies
public final RuntimeSpec.Builder addAllDependencies(Iterable<? extends Artifact> elements)
Adds elements todependencies
sortedSet.- Parameters:
elements
- An iterable of dependencies elements- Returns:
this
builder for use in a chained invocation
-
putCapability
public final RuntimeSpec.Builder putCapability(String key, CamelCapability value)
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
public final RuntimeSpec.Builder putCapability(Map.Entry<String,? extends CamelCapability> entry)
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
public final RuntimeSpec.Builder capabilities(Map<String,? extends CamelCapability> entries)
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
public final RuntimeSpec.Builder putAllCapabilities(Map<String,? extends CamelCapability> entries)
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
public ImmutableRuntimeSpec build()
Builds a newImmutableRuntimeSpec
.- Returns:
- An immutable instance of RuntimeSpec
- Throws:
IllegalStateException
- if any required attributes are missing
-
-