Package org.kiwiproject.consul.model.kv
Class ImmutableValue.Builder
java.lang.Object
org.kiwiproject.consul.model.kv.ImmutableValue.Builder
- Enclosing class:
- ImmutableValue
Builds instances of type
ImmutableValue.
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 newImmutableValue.final ImmutableValue.BuildercreateIndex(long createIndex) Initializes the value for thecreateIndexattribute.final ImmutableValue.Builderflags(long flags) Initializes the value for theflagsattribute.final ImmutableValue.BuilderFill a builder with attribute values from the providedValueinstance.final ImmutableValue.BuilderInitializes the value for thekeyattribute.final ImmutableValue.BuilderlockIndex(long lockIndex) Initializes the value for thelockIndexattribute.final ImmutableValue.BuildermodifyIndex(long modifyIndex) Initializes the value for themodifyIndexattribute.final ImmutableValue.BuilderInitializes the optional valuesessionto session.final ImmutableValue.BuilderInitializes the optional valuesessionto session.final ImmutableValue.BuilderInitializes the optional valuevalueto value.final ImmutableValue.BuilderInitializes the optional valuevalueto value.
-
Method Details
-
from
Fill a builder with attribute values from the providedValueinstance. 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
-
createIndex
Initializes the value for thecreateIndexattribute.- Parameters:
createIndex- The value for createIndex- Returns:
thisbuilder for use in a chained invocation
-
modifyIndex
Initializes the value for themodifyIndexattribute.- Parameters:
modifyIndex- The value for modifyIndex- Returns:
thisbuilder for use in a chained invocation
-
lockIndex
Initializes the value for thelockIndexattribute.- Parameters:
lockIndex- The value for lockIndex- Returns:
thisbuilder for use in a chained invocation
-
key
Initializes the value for thekeyattribute.- Parameters:
key- The value for key- Returns:
thisbuilder for use in a chained invocation
-
flags
Initializes the value for theflagsattribute.- Parameters:
flags- The value for flags- 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
-
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 newImmutableValue.- Returns:
- An immutable instance of Value
- Throws:
IllegalStateException- if any required attributes are missing
-