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.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 forImmutableCamelCatalogSpecinstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CamelCatalogSpec.Builderartifacts(Map<String,? extends CamelArtifact> entries)Sets or replaces all mappings from the specified map as entries for theartifactsmap.ImmutableCamelCatalogSpecbuild()Builds a newImmutableCamelCatalogSpec.CamelCatalogSpec.Builderfrom(CamelCatalogSpec instance)Fill a builder with attribute values from the providedCamelCatalogSpecinstance.CamelCatalogSpec.Builderloaders(Map<String,? extends CamelLoader> entries)Sets or replaces all mappings from the specified map as entries for theloadersmap.CamelCatalogSpec.BuilderputAllArtifacts(Map<String,? extends CamelArtifact> entries)Put all mappings from the specified map as entries toartifactsmap.CamelCatalogSpec.BuilderputAllLoaders(Map<String,? extends CamelLoader> entries)Put all mappings from the specified map as entries toloadersmap.CamelCatalogSpec.BuilderputArtifact(String key, CamelArtifact value)Put one entry to theartifactsmap.CamelCatalogSpec.BuilderputArtifact(Map.Entry<String,? extends CamelArtifact> entry)Put one entry to theartifactsmap.CamelCatalogSpec.BuilderputLoader(String key, CamelLoader value)Put one entry to theloadersmap.CamelCatalogSpec.BuilderputLoader(Map.Entry<String,? extends CamelLoader> entry)Put one entry to theloadersmap.CamelCatalogSpec.Builderruntime(RuntimeSpec runtime)Initializes the value for theruntimeattribute.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableCamelCatalogSpecinstances.new CamelCatalogSpec.Builder() .runtime(org.apache.camel.k.tooling.maven.model.crd.RuntimeSpec) // requiredruntime.putArtifact|putAllArtifacts(String => org.apache.camel.k.tooling.maven.model.CamelArtifact) //artifactsmappings .putLoader|putAllLoaders(String => org.apache.camel.k.tooling.maven.model.CamelLoader) //loadersmappings .build();
-
-
Method Detail
-
from
public final CamelCatalogSpec.Builder from(CamelCatalogSpec instance)
Fill a builder with attribute values from the providedCamelCatalogSpecinstance. 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:
thisbuilder for use in a chained invocation
-
runtime
public final CamelCatalogSpec.Builder runtime(RuntimeSpec runtime)
Initializes the value for theruntimeattribute.- Parameters:
runtime- The value for runtime- Returns:
thisbuilder for use in a chained invocation
-
putArtifact
public final CamelCatalogSpec.Builder putArtifact(String key, CamelArtifact value)
Put one entry to theartifactsmap.- Parameters:
key- The key in the artifacts mapvalue- The associated value in the artifacts map- Returns:
thisbuilder for use in a chained invocation
-
putArtifact
public final CamelCatalogSpec.Builder putArtifact(Map.Entry<String,? extends CamelArtifact> entry)
Put one entry to theartifactsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder 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 theartifactsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the artifacts map- Returns:
thisbuilder 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 toartifactsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the artifacts map- Returns:
thisbuilder for use in a chained invocation
-
putLoader
public final CamelCatalogSpec.Builder putLoader(String key, CamelLoader value)
Put one entry to theloadersmap.- Parameters:
key- The key in the loaders mapvalue- The associated value in the loaders map- Returns:
thisbuilder for use in a chained invocation
-
putLoader
public final CamelCatalogSpec.Builder putLoader(Map.Entry<String,? extends CamelLoader> entry)
Put one entry to theloadersmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder 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 theloadersmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the loaders map- Returns:
thisbuilder 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 toloadersmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the loaders map- Returns:
thisbuilder 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
-
-