Class ImmutableSession
java.lang.Object
org.kiwiproject.consul.model.session.Session
org.kiwiproject.consul.model.session.ImmutableSession
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableSession
extends Session
Immutable implementation of
Session.
Use the builder to create immutable instances:
ImmutableSession.builder().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableSession.Builderbuilder()Creates a builder forImmutableSession.static ImmutableSessionCreates an immutable copy of aSessionvalue.booleanThis instance is equal to all instances ofImmutableSessionthat have equal attribute values.com.google.common.collect.ImmutableList<String>getName()getNode()getTtl()inthashCode()Computes a hash code from attributes:lockDelay,name,node,checks,behavior,ttl.toString()Prints the immutable valueSessionwith attribute values.final ImmutableSessionwithBehavior(String value) Copy the current immutable object by setting a present value for the optionalbehaviorattribute.final ImmutableSessionwithBehavior(Optional<String> optional) Copy the current immutable object by setting an optional value for thebehaviorattribute.final ImmutableSessionwithChecks(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableSessionwithChecks(String... elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableSessionwithLockDelay(String value) Copy the current immutable object by setting a present value for the optionallockDelayattribute.final ImmutableSessionwithLockDelay(Optional<String> optional) Copy the current immutable object by setting an optional value for thelockDelayattribute.final ImmutableSessionCopy the current immutable object by setting a present value for the optionalnameattribute.final ImmutableSessionCopy the current immutable object by setting an optional value for thenameattribute.final ImmutableSessionCopy the current immutable object by setting a present value for the optionalnodeattribute.final ImmutableSessionCopy the current immutable object by setting an optional value for thenodeattribute.final ImmutableSessionCopy the current immutable object by setting a present value for the optionalttlattribute.final ImmutableSessionCopy the current immutable object by setting an optional value for thettlattribute.
-
Method Details
-
getLockDelay
- Specified by:
getLockDelayin classSession- Returns:
- The value of the
lockDelayattribute
-
getName
-
getNode
-
getChecks
-
getBehavior
- Specified by:
getBehaviorin classSession- Returns:
- The value of the
behaviorattribute
-
getTtl
-
withLockDelay
Copy the current immutable object by setting a present value for the optionallockDelayattribute.- Parameters:
value- The value for lockDelay- Returns:
- A modified copy of
thisobject
-
withLockDelay
Copy the current immutable object by setting an optional value for thelockDelayattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for lockDelay- Returns:
- A modified copy of
thisobject
-
withName
Copy the current immutable object by setting a present value for the optionalnameattribute.- Parameters:
value- The value for name- Returns:
- A modified copy of
thisobject
-
withName
Copy the current immutable object by setting an optional value for thenameattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for name- Returns:
- A modified copy of
thisobject
-
withNode
Copy the current immutable object by setting a present value for the optionalnodeattribute.- Parameters:
value- The value for node- Returns:
- A modified copy of
thisobject
-
withNode
Copy the current immutable object by setting an optional value for thenodeattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for node- Returns:
- A modified copy of
thisobject
-
withChecks
Copy the current immutable object with elements that replace the content ofchecks.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withChecks
Copy the current immutable object with elements that replace the content ofchecks. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of checks elements to set- Returns:
- A modified copy of
thisobject
-
withBehavior
Copy the current immutable object by setting a present value for the optionalbehaviorattribute.- Parameters:
value- The value for behavior- Returns:
- A modified copy of
thisobject
-
withBehavior
Copy the current immutable object by setting an optional value for thebehaviorattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for behavior- Returns:
- A modified copy of
thisobject
-
withTtl
Copy the current immutable object by setting a present value for the optionalttlattribute.- Parameters:
value- The value for ttl- Returns:
- A modified copy of
thisobject
-
withTtl
Copy the current immutable object by setting an optional value for thettlattribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for ttl- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableSessionthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:lockDelay,name,node,checks,behavior,ttl. -
toString
Prints the immutable valueSessionwith attribute values. -
copyOf
Creates an immutable copy of aSessionvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Session instance
-
builder
Creates a builder forImmutableSession.ImmutableSession.builder() .lockDelay(String) // optionallockDelay.name(String) // optionalname.node(String) // optionalnode.addChecks|addAllChecks(String) //checkselements .behavior(String) // optionalbehavior.ttl(String) // optionalttl.build();- Returns:
- A new ImmutableSession builder
-