Package org.kiwiproject.consul.model.kv
Class ImmutableOperation.Builder
java.lang.Object
org.kiwiproject.consul.model.kv.ImmutableOperation.Builder
- Enclosing class:
- ImmutableOperation
Builds instances of type
ImmutableOperation.
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.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newImmutableOperation.flags(long flags) Initializes the optional valueflagsto flags.Initializes the optional valueflagsto flags.Fill a builder with attribute values from the providedOperationinstance.index(BigInteger index) Initializes the optional valueindexto index.index(Optional<? extends BigInteger> index) Initializes the optional valueindexto index.Initializes the optional valuekeyto key.Initializes the optional valuekeyto key.Initializes the optional valuesessionto session.Initializes the optional valuesessionto session.Initializes the optional valuevalueto value.Initializes the optional valuevalueto value.Initializes the value for theverbattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedOperationinstance. 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
-
verb
Initializes the value for theverbattribute.- Parameters:
verb- The value for verb- Returns:
thisbuilder for use in a chained invocation
-
key
Initializes the optional valuekeyto key.- Parameters:
key- The value for key- Returns:
thisbuilder for chained invocation
-
key
Initializes the optional valuekeyto key.- Parameters:
key- The value for key- Returns:
thisbuilder for use in a chained invocation
-
value
Initializes the optional valuevalueto value.- Parameters:
value- The value for value- Returns:
thisbuilder for chained invocation
-
value
Initializes the optional valuevalueto value.- Parameters:
value- The value for value- Returns:
thisbuilder for use in a chained invocation
-
flags
Initializes the optional valueflagsto flags.- Parameters:
flags- The value for flags- Returns:
thisbuilder for chained invocation
-
flags
Initializes the optional valueflagsto flags.- Parameters:
flags- The value for flags- Returns:
thisbuilder for use in a chained invocation
-
index
Initializes the optional valueindexto index.- Parameters:
index- The value for index- Returns:
thisbuilder for chained invocation
-
index
@CanIgnoreReturnValue public final ImmutableOperation.Builder index(Optional<? extends BigInteger> index) Initializes the optional valueindexto index.- Parameters:
index- The value for index- Returns:
thisbuilder for use in a chained invocation
-
session
Initializes the optional valuesessionto session.- Parameters:
session- The value for session- Returns:
thisbuilder for chained invocation
-
session
Initializes the optional valuesessionto session.- Parameters:
session- The value for session- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableOperation.- Returns:
- An immutable instance of Operation
- Throws:
IllegalStateException- if any required attributes are missing
-