Class ImmutableSession.Builder
java.lang.Object
org.kiwiproject.consul.model.session.ImmutableSession.Builder
- Enclosing class:
- ImmutableSession
Builds instances of type
ImmutableSession.
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 TypeMethodDescriptionfinal ImmutableSession.BuilderaddAllChecks(Iterable<String> elements) Adds elements tocheckslist.final ImmutableSession.BuilderAdds one element tocheckslist.final ImmutableSession.BuilderAdds elements tocheckslist.final ImmutableSession.BuilderInitializes the optional valuebehaviorto behavior.final ImmutableSession.BuilderInitializes the optional valuebehaviorto behavior.build()Builds a newImmutableSession.final ImmutableSession.BuilderSets or replaces all elements forcheckslist.final ImmutableSession.BuilderFill a builder with attribute values from the providedSessioninstance.final ImmutableSession.BuilderInitializes the optional valuelockDelayto lockDelay.final ImmutableSession.BuilderInitializes the optional valuelockDelayto lockDelay.final ImmutableSession.BuilderInitializes the optional valuenameto name.final ImmutableSession.BuilderInitializes the optional valuenameto name.final ImmutableSession.BuilderInitializes the optional valuenodeto node.final ImmutableSession.BuilderInitializes the optional valuenodeto node.final ImmutableSession.BuilderInitializes the optional valuettlto ttl.final ImmutableSession.BuilderInitializes the optional valuettlto ttl.
-
Method Details
-
from
Fill a builder with attribute values from the providedSessioninstance. 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
-
lockDelay
Initializes the optional valuelockDelayto lockDelay.- Parameters:
lockDelay- The value for lockDelay- Returns:
thisbuilder for chained invocation
-
lockDelay
Initializes the optional valuelockDelayto lockDelay.- 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 optional valuenodeto node.- Parameters:
node- The value for node- Returns:
thisbuilder for chained invocation
-
node
Initializes the optional valuenodeto node.- 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
Adds elements tocheckslist.- Parameters:
elements- An iterable of checks elements- Returns:
thisbuilder for use in a chained invocation
-
behavior
Initializes the optional valuebehaviorto behavior.- Parameters:
behavior- The value for behavior- Returns:
thisbuilder for chained invocation
-
behavior
Initializes the optional valuebehaviorto behavior.- 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
-
build
Builds a newImmutableSession.- Returns:
- An immutable instance of Session
- Throws:
IllegalStateException- if any required attributes are missing
-