Class ImmutableTypeMeta.Builder
- java.lang.Object
-
- org.apache.camel.k.tooling.maven.model.k8s.ImmutableTypeMeta.Builder
-
- Direct Known Subclasses:
TypeMeta.Builder
- Enclosing class:
- ImmutableTypeMeta
public static class ImmutableTypeMeta.Builder extends Object
Builds instances of typeImmutableTypeMeta
. 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 forImmutableTypeMeta
instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeMeta.Builder
apiVersion(String apiVersion)
Initializes the value for theapiVersion
attribute.ImmutableTypeMeta
build()
Builds a newImmutableTypeMeta
.TypeMeta.Builder
from(TypeMeta instance)
Fill a builder with attribute values from the providedTypeMeta
instance.TypeMeta.Builder
kind(String kind)
Initializes the value for thekind
attribute.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableTypeMeta
instances.new TypeMeta.Builder() .apiVersion(String) // optional
apiVersion
.kind(String) // optionalkind
.build();
-
-
Method Detail
-
from
public final TypeMeta.Builder from(TypeMeta instance)
Fill a builder with attribute values from the providedTypeMeta
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
public final TypeMeta.Builder apiVersion(String 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
public final TypeMeta.Builder kind(String 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
-
build
public ImmutableTypeMeta build()
Builds a newImmutableTypeMeta
.- Returns:
- An immutable instance of TypeMeta
- Throws:
IllegalStateException
- if any required attributes are missing
-
-