Class ImmutableTypeMeta.Builder
java.lang.Object
org.apache.camel.k.catalog.model.k8s.ImmutableTypeMeta.Builder
- Direct Known Subclasses:
TypeMeta.Builder
- Enclosing class:
- ImmutableTypeMeta
Builds instances of type
ImmutableTypeMeta.
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 TypeMeta.BuilderapiVersion(String apiVersion) Initializes the value for theapiVersionattribute.build()Builds a newImmutableTypeMeta.final TypeMeta.BuilderFill a builder with attribute values from the providedTypeMetainstance.final TypeMeta.BuilderInitializes the value for thekindattribute.
-
Constructor Details
-
Builder
public Builder()Creates a builder forImmutableTypeMetainstances.new TypeMeta.Builder() .apiVersion(String) // optionalapiVersion.kind(String) // optionalkind.build();
-
-
Method Details
-
from
Fill a builder with attribute values from the providedTypeMetainstance. 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
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
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
-
build
Builds a newImmutableTypeMeta.- Returns:
- An immutable instance of TypeMeta
- Throws:
IllegalStateException- if any required attributes are missing
-