Class ImmutableSessionInfo
java.lang.Object
org.kiwiproject.consul.model.session.SessionInfo
org.kiwiproject.consul.model.session.ImmutableSessionInfo
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableSessionInfo
extends SessionInfo
Immutable implementation of
SessionInfo
.
Use the builder to create immutable instances:
ImmutableSessionInfo.builder()
.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableSessionInfo
. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableSessionInfo.Builder
builder()
Creates a builder forImmutableSessionInfo
.static ImmutableSessionInfo
copyOf
(SessionInfo instance) Creates an immutable copy of aSessionInfo
value.boolean
This instance is equal to all instances ofImmutableSessionInfo
that have equal attribute values.com.google.common.collect.ImmutableList<String>
long
getId()
getName()
getNode()
getTtl()
int
hashCode()
Computes a hash code from attributes:createIndex
,lockDelay
,name
,node
,checks
,behavior
,ttl
,id
.toString()
Prints the immutable valueSessionInfo
with attribute values.final ImmutableSessionInfo
withBehavior
(String value) Copy the current immutable object by setting a value for thebehavior
attribute.final ImmutableSessionInfo
withChecks
(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofchecks
.final ImmutableSessionInfo
withChecks
(String... elements) Copy the current immutable object with elements that replace the content ofchecks
.final ImmutableSessionInfo
withCreateIndex
(long value) Copy the current immutable object by setting a value for thecreateIndex
attribute.final ImmutableSessionInfo
Copy the current immutable object by setting a value for theid
attribute.final ImmutableSessionInfo
withLockDelay
(Long value) Copy the current immutable object by setting a value for thelockDelay
attribute.final ImmutableSessionInfo
Copy the current immutable object by setting a present value for the optionalname
attribute.final ImmutableSessionInfo
Copy the current immutable object by setting an optional value for thename
attribute.final ImmutableSessionInfo
Copy the current immutable object by setting a value for thenode
attribute.final ImmutableSessionInfo
Copy the current immutable object by setting a present value for the optionalttl
attribute.final ImmutableSessionInfo
Copy the current immutable object by setting an optional value for thettl
attribute.
-
Method Details
-
getCreateIndex
public long getCreateIndex()- Specified by:
getCreateIndex
in classSessionInfo
- Returns:
- The value of the
createIndex
attribute
-
getLockDelay
- Specified by:
getLockDelay
in classSessionInfo
- Returns:
- The value of the
lockDelay
attribute
-
getName
- Specified by:
getName
in classSessionInfo
- Returns:
- The value of the
name
attribute
-
getNode
- Specified by:
getNode
in classSessionInfo
- Returns:
- The value of the
node
attribute
-
getChecks
- Specified by:
getChecks
in classSessionInfo
- Returns:
- The value of the
checks
attribute
-
getBehavior
- Specified by:
getBehavior
in classSessionInfo
- Returns:
- The value of the
behavior
attribute
-
getTtl
- Specified by:
getTtl
in classSessionInfo
- Returns:
- The value of the
ttl
attribute
-
getId
- Specified by:
getId
in classSessionInfo
- Returns:
- The value of the
id
attribute
-
withCreateIndex
Copy the current immutable object by setting a value for thecreateIndex
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for createIndex- Returns:
- A modified copy of the
this
object
-
withLockDelay
Copy the current immutable object by setting a value for thelockDelay
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for lockDelay- Returns:
- A modified copy of the
this
object
-
withName
Copy the current immutable object by setting a present value for the optionalname
attribute.- Parameters:
value
- The value for name- Returns:
- A modified copy of
this
object
-
withName
Copy the current immutable object by setting an optional value for thename
attribute. 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
this
object
-
withNode
Copy the current immutable object by setting a value for thenode
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for node- Returns:
- A modified copy of the
this
object
-
withChecks
Copy the current immutable object with elements that replace the content ofchecks
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
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
this
object
-
withBehavior
Copy the current immutable object by setting a value for thebehavior
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for behavior- Returns:
- A modified copy of the
this
object
-
withTtl
Copy the current immutable object by setting a present value for the optionalttl
attribute.- Parameters:
value
- The value for ttl- Returns:
- A modified copy of
this
object
-
withTtl
Copy the current immutable object by setting an optional value for thettl
attribute. 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
this
object
-
withId
Copy the current immutable object by setting a value for theid
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for id- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableSessionInfo
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:createIndex
,lockDelay
,name
,node
,checks
,behavior
,ttl
,id
. -
toString
Prints the immutable valueSessionInfo
with attribute values. -
copyOf
Creates an immutable copy of aSessionInfo
value. 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 SessionInfo instance
-
builder
Creates a builder forImmutableSessionInfo
.ImmutableSessionInfo.builder() .createIndex(long) // required
createIndex
.lockDelay(Long) // requiredlockDelay
.name(String) // optionalname
.node(String) // requirednode
.addChecks|addAllChecks(String) //checks
elements .behavior(String) // requiredbehavior
.ttl(String) // optionalttl
.id(String) // requiredid
.build();- Returns:
- A new ImmutableSessionInfo builder
-