@NotThreadSafe public static final class ImmutableSession.Builder extends Object
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.
| Modifier and Type | Method and Description |
|---|---|
ImmutableSession.Builder |
addAllChecks(Iterable<String> elements)
Adds elements to
checks list. |
ImmutableSession.Builder |
addChecks(String... elements)
Adds elements to
checks list. |
ImmutableSession.Builder |
addChecks(String element)
Adds one element to
checks list. |
ImmutableSession.Builder |
behavior(Optional<String> behavior)
Initializes the optional value
behavior to behavior. |
ImmutableSession.Builder |
behavior(String behavior)
Initializes the optional value
behavior to behavior. |
ImmutableSession |
build()
Builds a new
ImmutableSession. |
ImmutableSession.Builder |
checks(Iterable<String> elements)
Sets or replaces all elements for
checks list. |
ImmutableSession.Builder |
from(Session instance)
Fill a builder with attribute values from the provided
Session instance. |
ImmutableSession.Builder |
lockDelay(Optional<String> lockDelay)
Initializes the optional value
lockDelay to lockDelay. |
ImmutableSession.Builder |
lockDelay(String lockDelay)
Initializes the optional value
lockDelay to lockDelay. |
ImmutableSession.Builder |
name(Optional<String> name)
Initializes the optional value
name to name. |
ImmutableSession.Builder |
name(String name)
Initializes the optional value
name to name. |
ImmutableSession.Builder |
node(Optional<String> node)
Initializes the optional value
node to node. |
ImmutableSession.Builder |
node(String node)
Initializes the optional value
node to node. |
ImmutableSession.Builder |
ttl(Optional<String> ttl)
Initializes the optional value
ttl to ttl. |
ImmutableSession.Builder |
ttl(String ttl)
Initializes the optional value
ttl to ttl. |
@CanIgnoreReturnValue public final ImmutableSession.Builder from(Session instance)
Session instance.
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.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder lockDelay(String lockDelay)
lockDelay to lockDelay.lockDelay - The value for lockDelaythis builder for chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder lockDelay(Optional<String> lockDelay)
lockDelay to lockDelay.lockDelay - The value for lockDelaythis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder name(String name)
name to name.name - The value for namethis builder for chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder name(Optional<String> name)
name to name.name - The value for namethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder node(String node)
node to node.node - The value for nodethis builder for chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder node(Optional<String> node)
node to node.node - The value for nodethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder addChecks(String element)
checks list.element - A checks elementthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder addChecks(String... elements)
checks list.elements - An array of checks elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder checks(Iterable<String> elements)
checks list.elements - An iterable of checks elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder addAllChecks(Iterable<String> elements)
checks list.elements - An iterable of checks elementsthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder behavior(String behavior)
behavior to behavior.behavior - The value for behaviorthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder behavior(Optional<String> behavior)
behavior to behavior.behavior - The value for behaviorthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder ttl(String ttl)
ttl to ttl.ttl - The value for ttlthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableSession.Builder ttl(Optional<String> ttl)
ttl to ttl.ttl - The value for ttlthis builder for use in a chained invocationpublic ImmutableSession build()
ImmutableSession.IllegalStateException - if any required attributes are missingCopyright © 2019. All rights reserved.