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