Class ImmutableCamelCatalog.Builder
- java.lang.Object
-
- org.apache.camel.k.tooling.maven.model.crd.ImmutableCamelCatalog.Builder
-
- Direct Known Subclasses:
CamelCatalog.Builder
- Enclosing class:
- ImmutableCamelCatalog
public static class ImmutableCamelCatalog.Builder extends Object
Builds instances of typeImmutableCamelCatalog. 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 forImmutableCamelCataloginstances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CamelCatalog.BuilderapiVersion(String apiVersion)Initializes the value for theapiVersionattribute.ImmutableCamelCatalogbuild()Builds a newImmutableCamelCatalog.CamelCatalog.Builderfrom(CamelCatalog instance)Fill a builder with attribute values from the providedCamelCataloginstance.CamelCatalog.Builderkind(String kind)Initializes the value for thekindattribute.CamelCatalog.Buildermetadata(ObjectMeta metadata)Initializes the value for themetadataattribute.CamelCatalog.Builderspec(CamelCatalogSpec spec)Initializes the value for thespecattribute.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableCamelCataloginstances.new CamelCatalog.Builder() .apiVersion(String) // optionalapiVersion.kind(String) // optionalkind.metadata(org.apache.camel.k.tooling.maven.model.k8s.ObjectMeta) // requiredmetadata.spec(org.apache.camel.k.tooling.maven.model.crd.CamelCatalogSpec) // requiredspec.build();
-
-
Method Detail
-
from
public final CamelCatalog.Builder from(CamelCatalog instance)
Fill a builder with attribute values from the providedCamelCataloginstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
apiVersion
public final CamelCatalog.Builder apiVersion(String apiVersion)
Initializes the value for theapiVersionattribute.If not set, this attribute will have a default value as returned by the initializer of
apiVersion.- Parameters:
apiVersion- The value for apiVersion- Returns:
thisbuilder for use in a chained invocation
-
kind
public final CamelCatalog.Builder kind(String kind)
Initializes the value for thekindattribute.If not set, this attribute will have a default value as returned by the initializer of
kind.- Parameters:
kind- The value for kind- Returns:
thisbuilder for use in a chained invocation
-
metadata
public final CamelCatalog.Builder metadata(ObjectMeta metadata)
Initializes the value for themetadataattribute.- Parameters:
metadata- The value for metadata- Returns:
thisbuilder for use in a chained invocation
-
spec
public final CamelCatalog.Builder spec(CamelCatalogSpec spec)
Initializes the value for thespecattribute.- Parameters:
spec- The value for spec- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableCamelCatalog build()
Builds a newImmutableCamelCatalog.- Returns:
- An immutable instance of CamelCatalog
- Throws:
IllegalStateException- if any required attributes are missing
-
-