Class ImmutableSessionInfo.Builder
java.lang.Object
org.kiwiproject.consul.model.session.ImmutableSessionInfo.Builder
- Enclosing class:
- ImmutableSessionInfo
Builds instances of type
ImmutableSessionInfo.
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 TypeMethodDescriptionaddAllChecks(Iterable<String> elements) Adds elements tocheckslist.Adds one element tocheckslist.Adds elements tocheckslist.Initializes the value for thebehaviorattribute.build()Builds a newImmutableSessionInfo.Sets or replaces all elements forcheckslist.createIndex(long createIndex) Initializes the value for thecreateIndexattribute.from(SessionInfo instance) Fill a builder with attribute values from the providedSessionInfoinstance.Initializes the value for theidattribute.Initializes the value for thelockDelayattribute.Initializes the optional valuenameto name.Initializes the optional valuenameto name.Initializes the value for thenodeattribute.Initializes the optional valuettlto ttl.Initializes the optional valuettlto ttl.
-
Method Details
-
from
Fill a builder with attribute values from the providedSessionInfoinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- 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
-
lockDelay
Initializes the value for thelockDelayattribute.- Parameters:
lockDelay- The value for lockDelay- Returns:
thisbuilder for use in a chained invocation
-
name
Initializes the optional valuenameto name.- Parameters:
name- The value for name- Returns:
thisbuilder for chained invocation
-
name
Initializes the optional valuenameto name.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
node
Initializes the value for thenodeattribute.- Parameters:
node- The value for node- Returns:
thisbuilder for use in a chained invocation
-
addChecks
Adds one element tocheckslist.- Parameters:
element- A checks element- Returns:
thisbuilder for use in a chained invocation
-
addChecks
Adds elements tocheckslist.- Parameters:
elements- An array of checks elements- Returns:
thisbuilder for use in a chained invocation
-
checks
Sets or replaces all elements forcheckslist.- Parameters:
elements- An iterable of checks elements- Returns:
thisbuilder for use in a chained invocation
-
addAllChecks
@CanIgnoreReturnValue public final ImmutableSessionInfo.Builder addAllChecks(Iterable<String> elements) Adds elements tocheckslist.- Parameters:
elements- An iterable of checks elements- Returns:
thisbuilder for use in a chained invocation
-
behavior
Initializes the value for thebehaviorattribute.- Parameters:
behavior- The value for behavior- Returns:
thisbuilder for use in a chained invocation
-
ttl
Initializes the optional valuettlto ttl.- Parameters:
ttl- The value for ttl- Returns:
thisbuilder for chained invocation
-
ttl
Initializes the optional valuettlto ttl.- Parameters:
ttl- The value for ttl- Returns:
thisbuilder for use in a chained invocation
-
id
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableSessionInfo.- Returns:
- An immutable instance of SessionInfo
- Throws:
IllegalStateException- if any required attributes are missing
-