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.Builderis 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 forImmutableCamelLoaderinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CamelLoader.BuilderaddAllDependencies(Iterable<? extends Artifact> elements)Adds elements todependenciesset.CamelLoader.BuilderaddAllLanguages(Iterable<String> elements)Adds elements tolanguagesset.CamelLoader.BuilderaddDependencies(Artifact... elements)Adds elements todependenciesset.CamelLoader.BuilderaddDependency(Artifact element)Adds one element todependenciesset.CamelLoader.BuilderaddLanguage(String element)Adds one element tolanguagesset.CamelLoader.BuilderaddLanguages(String... elements)Adds elements tolanguagesset.CamelLoader.BuilderartifactId(String artifactId)Initializes the value for theartifactIdattribute.ImmutableCamelLoaderbuild()Builds a newImmutableCamelLoader.CamelLoader.Builderdependencies(Iterable<? extends Artifact> elements)Sets or replaces all elements fordependenciesset.CamelLoader.Builderfrom(Artifact instance)Fill a builder with attribute values from the providedorg.apache.camel.k.tooling.maven.model.Artifactinstance.CamelLoader.Builderfrom(CamelLoader instance)Fill a builder with attribute values from the providedorg.apache.camel.k.tooling.maven.model.CamelLoaderinstance.CamelLoader.BuildergroupId(String groupId)Initializes the value for thegroupIdattribute.CamelLoader.Builderlanguages(Iterable<String> elements)Sets or replaces all elements forlanguagesset.CamelLoader.Buildermetadata(Map<String,? extends String> entries)Sets or replaces all mappings from the specified map as entries for themetadatamap.CamelLoader.BuilderputAllMetadata(Map<String,? extends String> entries)Put all mappings from the specified map as entries tometadatamap.CamelLoader.BuilderputMetadata(String key, String value)Put one entry to themetadatamap.CamelLoader.BuilderputMetadata(Map.Entry<String,? extends String> entry)Put one entry to themetadatamap.CamelLoader.Builderversion(String version)Initializes the optional valueversionto version.CamelLoader.Builderversion(Optional<String> version)Initializes the optional valueversionto version.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableCamelLoaderinstances.new CamelLoader.Builder() .groupId(String) // requiredgroupId.artifactId(String) // requiredartifactId.version(String) // optionalversion.addLanguage|addAllLanguages(String) //languageselements .addDependency|addAllDependencies(org.apache.camel.k.tooling.maven.model.Artifact) //dependencieselements .putMetadata|putAllMetadata(String => String) //metadatamappings .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.CamelLoaderinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder 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.Artifactinstance.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
groupId
public final CamelLoader.Builder groupId(String groupId)
Initializes the value for thegroupIdattribute.- Parameters:
groupId- The value for groupId- Returns:
thisbuilder for use in a chained invocation
-
artifactId
public final CamelLoader.Builder artifactId(String artifactId)
Initializes the value for theartifactIdattribute.- Parameters:
artifactId- The value for artifactId- Returns:
thisbuilder for use in a chained invocation
-
version
public final CamelLoader.Builder version(String version)
Initializes the optional valueversionto version.- Parameters:
version- The value for version- Returns:
thisbuilder for chained invocation
-
version
public final CamelLoader.Builder version(Optional<String> version)
Initializes the optional valueversionto version.- Parameters:
version- The value for version- Returns:
thisbuilder for use in a chained invocation
-
addLanguage
public final CamelLoader.Builder addLanguage(String element)
Adds one element tolanguagesset.- Parameters:
element- A languages element- Returns:
thisbuilder for use in a chained invocation
-
addLanguages
public final CamelLoader.Builder addLanguages(String... elements)
Adds elements tolanguagesset.- Parameters:
elements- An array of languages elements- Returns:
thisbuilder for use in a chained invocation
-
languages
public final CamelLoader.Builder languages(Iterable<String> elements)
Sets or replaces all elements forlanguagesset.- Parameters:
elements- An iterable of languages elements- Returns:
thisbuilder for use in a chained invocation
-
addAllLanguages
public final CamelLoader.Builder addAllLanguages(Iterable<String> elements)
Adds elements tolanguagesset.- Parameters:
elements- An iterable of languages elements- Returns:
thisbuilder for use in a chained invocation
-
addDependency
public final CamelLoader.Builder addDependency(Artifact element)
Adds one element todependenciesset.- Parameters:
element- A dependencies element- Returns:
thisbuilder for use in a chained invocation
-
addDependencies
public final CamelLoader.Builder addDependencies(Artifact... elements)
Adds elements todependenciesset.- Parameters:
elements- An array of dependencies elements- Returns:
thisbuilder for use in a chained invocation
-
dependencies
public final CamelLoader.Builder dependencies(Iterable<? extends Artifact> elements)
Sets or replaces all elements fordependenciesset.- Parameters:
elements- An iterable of dependencies elements- Returns:
thisbuilder for use in a chained invocation
-
addAllDependencies
public final CamelLoader.Builder addAllDependencies(Iterable<? extends Artifact> elements)
Adds elements todependenciesset.- Parameters:
elements- An iterable of dependencies elements- Returns:
thisbuilder for use in a chained invocation
-
putMetadata
public final CamelLoader.Builder putMetadata(String key, String value)
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
public final CamelLoader.Builder putMetadata(Map.Entry<String,? extends String> entry)
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
public final CamelLoader.Builder metadata(Map<String,? extends String> entries)
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
public final CamelLoader.Builder putAllMetadata(Map<String,? extends String> entries)
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
-
build
public ImmutableCamelLoader build()
Builds a newImmutableCamelLoader.- Returns:
- An immutable instance of CamelLoader
- Throws:
IllegalStateException- if any required attributes are missing
-
-