Package org.apache.camel.k.catalog.model
Class ImmutableCamelLoader.Builder
java.lang.Object
org.apache.camel.k.catalog.model.ImmutableCamelLoader.Builder
- Direct Known Subclasses:
CamelLoader.Builder
- Enclosing class:
- ImmutableCamelLoader
Builds instances of type
ImmutableCamelLoader
.
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 CamelLoader.Builder
addAllDependencies
(Iterable<? extends Artifact> elements) Adds elements todependencies
sortedSet.final CamelLoader.Builder
addAllLanguages
(Iterable<String> elements) Adds elements tolanguages
sortedSet.final CamelLoader.Builder
addDependencies
(Artifact... elements) Adds elements todependencies
sortedSet.final CamelLoader.Builder
addDependency
(Artifact element) Adds one element todependencies
sortedSet.final CamelLoader.Builder
addLanguage
(String element) Adds one element tolanguages
sortedSet.final CamelLoader.Builder
addLanguages
(String... elements) Adds elements tolanguages
sortedSet.final CamelLoader.Builder
artifactId
(String artifactId) Initializes the value for theartifactId
attribute.build()
Builds a newImmutableCamelLoader
.final CamelLoader.Builder
dependencies
(Iterable<? extends Artifact> elements) Sets or replaces all elements fordependencies
sortedSet.final CamelLoader.Builder
Fill a builder with attribute values from the providedorg.apache.camel.k.catalog.model.Artifact
instance.final CamelLoader.Builder
from
(CamelLoader instance) Fill a builder with attribute values from the providedorg.apache.camel.k.catalog.model.CamelLoader
instance.final CamelLoader.Builder
Initializes the value for thegroupId
attribute.final CamelLoader.Builder
Sets or replaces all elements forlanguages
sortedSet.final CamelLoader.Builder
Sets or replaces all mappings from the specified map as entries for themetadata
map.final CamelLoader.Builder
putAllMetadata
(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tometadata
map.final CamelLoader.Builder
putMetadata
(String key, String value) Put one entry to themetadata
map.final CamelLoader.Builder
putMetadata
(Map.Entry<String, ? extends String> entry) Put one entry to themetadata
map.final CamelLoader.Builder
Initializes the optional valueversion
to version.final CamelLoader.Builder
Initializes the optional valueversion
to version.
-
Constructor Details
-
Builder
public Builder()Creates a builder forImmutableCamelLoader
instances.new CamelLoader.Builder() .groupId(String) // required
groupId
.artifactId(String) // requiredartifactId
.version(String) // optionalversion
.addLanguage|addAllLanguages(String) //languages
elements .addDependency|addAllDependencies(org.apache.camel.k.catalog.model.Artifact) //dependencies
elements .putMetadata|putAllMetadata(String => String) //metadata
mappings .build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedorg.apache.camel.k.catalog.model.CamelLoader
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
Fill a builder with attribute values from the providedorg.apache.camel.k.catalog.model.Artifact
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
groupId
Initializes the value for thegroupId
attribute.- Parameters:
groupId
- The value for groupId- Returns:
this
builder for use in a chained invocation
-
artifactId
Initializes the value for theartifactId
attribute.- Parameters:
artifactId
- The value for artifactId- Returns:
this
builder for use in a chained invocation
-
version
Initializes the optional valueversion
to version.- Parameters:
version
- The value for version- Returns:
this
builder for chained invocation
-
version
Initializes the optional valueversion
to version.- Parameters:
version
- The value for version- Returns:
this
builder for use in a chained invocation
-
addLanguage
Adds one element tolanguages
sortedSet.- Parameters:
element
- A languages element- Returns:
this
builder for use in a chained invocation
-
addLanguages
Adds elements tolanguages
sortedSet.- Parameters:
elements
- An array of languages elements- Returns:
this
builder for use in a chained invocation
-
languages
Sets or replaces all elements forlanguages
sortedSet.- Parameters:
elements
- An iterable of languages elements- Returns:
this
builder for use in a chained invocation
-
addAllLanguages
Adds elements tolanguages
sortedSet.- Parameters:
elements
- An iterable of languages elements- 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
-
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
-
build
Builds a newImmutableCamelLoader
.- Returns:
- An immutable instance of CamelLoader
- Throws:
IllegalStateException
- if any required attributes are missing
-