Class ImmutableCamelCatalog.Builder
java.lang.Object
org.apache.camel.k.catalog.model.k8s.crd.ImmutableCamelCatalog.Builder
- Direct Known Subclasses:
CamelCatalog.Builder
- Enclosing class:
- ImmutableCamelCatalog
Builds instances of type
ImmutableCamelCatalog
.
Initialize attributes and then invoke the build()
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 -
Method Summary
Modifier and TypeMethodDescriptionfinal CamelCatalog.Builder
apiVersion
(String apiVersion) Initializes the value for theapiVersion
attribute.build()
Builds a newImmutableCamelCatalog
.final CamelCatalog.Builder
from
(CamelCatalog instance) Fill a builder with attribute values from the providedCamelCatalog
instance.final CamelCatalog.Builder
Initializes the value for thekind
attribute.final CamelCatalog.Builder
metadata
(ObjectMeta metadata) Initializes the value for themetadata
attribute.final CamelCatalog.Builder
spec
(CamelCatalogSpec spec) Initializes the value for thespec
attribute.
-
Constructor Details
-
Builder
public Builder()Creates a builder forImmutableCamelCatalog
instances.new CamelCatalog.Builder() .apiVersion(String) // optional
apiVersion
.kind(String) // optionalkind
.metadata(org.apache.camel.k.catalog.model.k8s.ObjectMeta) // requiredmetadata
.spec(org.apache.camel.k.catalog.model.k8s.crd.CamelCatalogSpec) // requiredspec
.build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedCamelCatalog
instance. 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:
this
builder for use in a chained invocation
-
apiVersion
Initializes the value for theapiVersion
attribute.If not set, this attribute will have a default value as returned by the initializer of
apiVersion
.- Parameters:
apiVersion
- The value for apiVersion- Returns:
this
builder for use in a chained invocation
-
kind
Initializes the value for thekind
attribute.If not set, this attribute will have a default value as returned by the initializer of
kind
.- Parameters:
kind
- The value for kind- Returns:
this
builder for use in a chained invocation
-
metadata
Initializes the value for themetadata
attribute.- Parameters:
metadata
- The value for metadata- Returns:
this
builder for use in a chained invocation
-
spec
Initializes the value for thespec
attribute.- Parameters:
spec
- The value for spec- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableCamelCatalog
.- Returns:
- An immutable instance of CamelCatalog
- Throws:
IllegalStateException
- if any required attributes are missing
-