Class ImmutableCamelScheme.Builder
- java.lang.Object
-
- org.apache.camel.k.tooling.maven.model.ImmutableCamelScheme.Builder
-
- Direct Known Subclasses:
CamelScheme.Builder
- Enclosing class:
- ImmutableCamelScheme
public static class ImmutableCamelScheme.Builder extends Object
Builds instances of typeImmutableCamelScheme
. 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 forImmutableCamelScheme
instances.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableCamelScheme
build()
Builds a newImmutableCamelScheme
.CamelScheme.Builder
from(CamelScheme instance)
Fill a builder with attribute values from the providedCamelScheme
instance.CamelScheme.Builder
http(boolean http)
Initializes the value for thehttp
attribute.CamelScheme.Builder
id(String id)
Initializes the value for theid
attribute.CamelScheme.Builder
passive(boolean passive)
Initializes the value for thepassive
attribute.
-
-
-
Constructor Detail
-
Builder
public Builder()
Creates a builder forImmutableCamelScheme
instances.new CamelScheme.Builder() .id(String) // required
id
.http(boolean) // optionalhttp
.passive(boolean) // optionalpassive
.build();
-
-
Method Detail
-
from
public final CamelScheme.Builder from(CamelScheme instance)
Fill a builder with attribute values from the providedCamelScheme
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
-
id
public final CamelScheme.Builder id(String id)
Initializes the value for theid
attribute.- Parameters:
id
- The value for id- Returns:
this
builder for use in a chained invocation
-
http
public final CamelScheme.Builder http(boolean http)
Initializes the value for thehttp
attribute.If not set, this attribute will have a default value as returned by the initializer of
http
.- Parameters:
http
- The value for http- Returns:
this
builder for use in a chained invocation
-
passive
public final CamelScheme.Builder passive(boolean passive)
Initializes the value for thepassive
attribute.If not set, this attribute will have a default value as returned by the initializer of
passive
.- Parameters:
passive
- The value for passive- Returns:
this
builder for use in a chained invocation
-
build
public ImmutableCamelScheme build()
Builds a newImmutableCamelScheme
.- Returns:
- An immutable instance of CamelScheme
- Throws:
IllegalStateException
- if any required attributes are missing
-
-