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 classBuilds instances of typeImmutableSessionInfo. -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableSessionInfo.Builderbuilder()Creates a builder forImmutableSessionInfo.static ImmutableSessionInfocopyOf(SessionInfo instance) Creates an immutable copy of aSessionInfovalue.booleanThis instance is equal to all instances ofImmutableSessionInfothat have equal attribute values.com.google.common.collect.ImmutableList<String>longgetId()getName()getNode()getTtl()inthashCode()Computes a hash code from attributes:createIndex,lockDelay,name,node,checks,behavior,ttl,id.toString()Prints the immutable valueSessionInfowith attribute values.final ImmutableSessionInfowithBehavior(String value) Copy the current immutable object by setting a value for thebehaviorattribute.final ImmutableSessionInfowithChecks(Iterable<String> elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableSessionInfowithChecks(String... elements) Copy the current immutable object with elements that replace the content ofchecks.final ImmutableSessionInfowithCreateIndex(long value) Copy the current immutable object by setting a value for thecreateIndexattribute.final ImmutableSessionInfoCopy the current immutable object by setting a value for theidattribute.final ImmutableSessionInfowithLockDelay(Long value) Copy the current immutable object by setting a value for thelockDelayattribute.final ImmutableSessionInfoCopy the current immutable object by setting a present value for the optionalnameattribute.final ImmutableSessionInfoCopy the current immutable object by setting an optional value for thenameattribute.final ImmutableSessionInfoCopy the current immutable object by setting a value for thenodeattribute.final ImmutableSessionInfoCopy the current immutable object by setting a present value for the optionalttlattribute.final ImmutableSessionInfoCopy the current immutable object by setting an optional value for thettlattribute.
-
Method Details
-
getCreateIndex
public long getCreateIndex()- Specified by:
getCreateIndexin classSessionInfo- Returns:
- The value of the
createIndexattribute
-
getLockDelay
- Specified by:
getLockDelayin classSessionInfo- Returns:
- The value of the
lockDelayattribute
-
getName
- Specified by:
getNamein classSessionInfo- Returns:
- The value of the
nameattribute
-
getNode
- Specified by:
getNodein classSessionInfo- Returns:
- The value of the
nodeattribute
-
getChecks
- Specified by:
getChecksin classSessionInfo- Returns:
- The value of the
checksattribute
-
getBehavior
- Specified by:
getBehaviorin classSessionInfo- Returns:
- The value of the
behaviorattribute
-
getTtl
- Specified by:
getTtlin classSessionInfo- Returns:
- The value of the
ttlattribute
-
getId
- Specified by:
getIdin classSessionInfo- Returns:
- The value of the
idattribute
-
withCreateIndex
Copy the current immutable object by setting a value for thecreateIndexattribute. 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
thisobject
-
withLockDelay
Copy the current immutable object by setting a value for thelockDelayattribute. 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
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 value for thenodeattribute. 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
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 value for thebehaviorattribute. 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
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
-
withId
Copy the current immutable object by setting a value for theidattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableSessionInfothat 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 valueSessionInfowith attribute values. -
copyOf
Creates an immutable copy of aSessionInfovalue. 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) // requiredcreateIndex.lockDelay(Long) // requiredlockDelay.name(String) // optionalname.node(String) // requirednode.addChecks|addAllChecks(String) //checkselements .behavior(String) // requiredbehavior.ttl(String) // optionalttl.id(String) // requiredid.build();- Returns:
- A new ImmutableSessionInfo builder
-