Class ImmutableCamelCatalogSpec.Builder
- java.lang.Object
-
- org.apache.camel.k.tooling.maven.model.crd.ImmutableCamelCatalogSpec.Builder
-
- Direct Known Subclasses:
CamelCatalogSpec.Builder
- Enclosing class:
- ImmutableCamelCatalogSpec
public static class ImmutableCamelCatalogSpec.Builder extends Object
Builds instances of typeImmutableCamelCatalogSpec
. 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 forImmutableCamelCatalogSpec
instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CamelCatalogSpec.Builder
artifacts(Map<String,? extends CamelArtifact> entries)
Sets or replaces all mappings from the specified map as entries for theartifacts
map.ImmutableCamelCatalogSpec
build()
Builds a newImmutableCamelCatalogSpec
.CamelCatalogSpec.Builder
from(CamelCatalogSpec instance)
Fill a builder with attribute values from the providedCamelCatalogSpec
instance.CamelCatalogSpec.Builder
loaders(Map<String,? extends CamelLoader> entries)
Sets or replaces all mappings from the specified map as entries for theloaders
map.CamelCatalogSpec.Builder
putAllArtifacts(Map<String,? extends CamelArtifact> entries)
Put all mappings from the specified map as entries toartifacts
map.CamelCatalogSpec.Builder
putAllLoaders(Map<String,? extends CamelLoader> entries)
Put all mappings from the specified map as entries toloaders
map.CamelCatalogSpec.Builder
putArtifact(String key, CamelArtifact value)
Put one entry to theartifacts
map.CamelCatalogSpec.Builder
putArtifact(Map.Entry<String,? extends CamelArtifact> entry)
Put one entry to theartifacts
map.CamelCatalogSpec.Builder
putLoader(String key, CamelLoader value)
Put one entry to theloaders
map.CamelCatalogSpec.Builder
putLoader(Map.Entry<String,? extends CamelLoader> entry)
Put one entry to theloaders
map.CamelCatalogSpec.Builder
runtime(RuntimeSpec runtime)
Initializes the value for theruntime
attribute.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableCamelCatalogSpec
instances.new CamelCatalogSpec.Builder() .runtime(org.apache.camel.k.tooling.maven.model.crd.RuntimeSpec) // required
runtime
.putArtifact|putAllArtifacts(String => org.apache.camel.k.tooling.maven.model.CamelArtifact) //artifacts
mappings .putLoader|putAllLoaders(String => org.apache.camel.k.tooling.maven.model.CamelLoader) //loaders
mappings .build();
-
-
Method Detail
-
from
public final CamelCatalogSpec.Builder from(CamelCatalogSpec instance)
Fill a builder with attribute values from the providedCamelCatalogSpec
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
-
runtime
public final CamelCatalogSpec.Builder runtime(RuntimeSpec runtime)
Initializes the value for theruntime
attribute.- Parameters:
runtime
- The value for runtime- Returns:
this
builder for use in a chained invocation
-
putArtifact
public final CamelCatalogSpec.Builder putArtifact(String key, CamelArtifact value)
Put one entry to theartifacts
map.- Parameters:
key
- The key in the artifacts mapvalue
- The associated value in the artifacts map- Returns:
this
builder for use in a chained invocation
-
putArtifact
public final CamelCatalogSpec.Builder putArtifact(Map.Entry<String,? extends CamelArtifact> entry)
Put one entry to theartifacts
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
artifacts
public final CamelCatalogSpec.Builder artifacts(Map<String,? extends CamelArtifact> entries)
Sets or replaces all mappings from the specified map as entries for theartifacts
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the artifacts map- Returns:
this
builder for use in a chained invocation
-
putAllArtifacts
public final CamelCatalogSpec.Builder putAllArtifacts(Map<String,? extends CamelArtifact> entries)
Put all mappings from the specified map as entries toartifacts
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the artifacts map- Returns:
this
builder for use in a chained invocation
-
putLoader
public final CamelCatalogSpec.Builder putLoader(String key, CamelLoader value)
Put one entry to theloaders
map.- Parameters:
key
- The key in the loaders mapvalue
- The associated value in the loaders map- Returns:
this
builder for use in a chained invocation
-
putLoader
public final CamelCatalogSpec.Builder putLoader(Map.Entry<String,? extends CamelLoader> entry)
Put one entry to theloaders
map. Nulls are not permitted- Parameters:
entry
- The key and value entry- Returns:
this
builder for use in a chained invocation
-
loaders
public final CamelCatalogSpec.Builder loaders(Map<String,? extends CamelLoader> entries)
Sets or replaces all mappings from the specified map as entries for theloaders
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the loaders map- Returns:
this
builder for use in a chained invocation
-
putAllLoaders
public final CamelCatalogSpec.Builder putAllLoaders(Map<String,? extends CamelLoader> entries)
Put all mappings from the specified map as entries toloaders
map. Nulls are not permitted- Parameters:
entries
- The entries that will be added to the loaders map- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableCamelCatalogSpec build()
Builds a newImmutableCamelCatalogSpec
.- Returns:
- An immutable instance of CamelCatalogSpec
- Throws:
IllegalStateException
- if any required attributes are missing
-
-