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().

  • Method Details

    • getCreateIndex

      public long getCreateIndex()
      Specified by:
      getCreateIndex in class SessionInfo
      Returns:
      The value of the createIndex attribute
    • getLockDelay

      public Long getLockDelay()
      Specified by:
      getLockDelay in class SessionInfo
      Returns:
      The value of the lockDelay attribute
    • getName

      public Optional<String> getName()
      Specified by:
      getName in class SessionInfo
      Returns:
      The value of the name attribute
    • getNode

      public String getNode()
      Specified by:
      getNode in class SessionInfo
      Returns:
      The value of the node attribute
    • getChecks

      public com.google.common.collect.ImmutableList<String> getChecks()
      Specified by:
      getChecks in class SessionInfo
      Returns:
      The value of the checks attribute
    • getBehavior

      public String getBehavior()
      Specified by:
      getBehavior in class SessionInfo
      Returns:
      The value of the behavior attribute
    • getTtl

      public Optional<String> getTtl()
      Specified by:
      getTtl in class SessionInfo
      Returns:
      The value of the ttl attribute
    • getId

      public String getId()
      Specified by:
      getId in class SessionInfo
      Returns:
      The value of the id attribute
    • withCreateIndex

      public final ImmutableSessionInfo withCreateIndex(long value)
      Copy the current immutable object by setting a value for the createIndex attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for createIndex
      Returns:
      A modified copy of the this object
    • withLockDelay

      public final ImmutableSessionInfo withLockDelay(Long value)
      Copy the current immutable object by setting a value for the lockDelay attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for lockDelay
      Returns:
      A modified copy of the this object
    • withName

      public final ImmutableSessionInfo withName(String value)
      Copy the current immutable object by setting a present value for the optional name attribute.
      Parameters:
      value - The value for name
      Returns:
      A modified copy of this object
    • withName

      public final ImmutableSessionInfo withName(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the name attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for name
      Returns:
      A modified copy of this object
    • withNode

      public final ImmutableSessionInfo withNode(String value)
      Copy the current immutable object by setting a value for the node attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for node
      Returns:
      A modified copy of the this object
    • withChecks

      public final ImmutableSessionInfo withChecks(String... elements)
      Copy the current immutable object with elements that replace the content of checks.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withChecks

      public final ImmutableSessionInfo withChecks(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of checks. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of checks elements to set
      Returns:
      A modified copy of this object
    • withBehavior

      public final ImmutableSessionInfo withBehavior(String value)
      Copy the current immutable object by setting a value for the behavior attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for behavior
      Returns:
      A modified copy of the this object
    • withTtl

      public final ImmutableSessionInfo withTtl(String value)
      Copy the current immutable object by setting a present value for the optional ttl attribute.
      Parameters:
      value - The value for ttl
      Returns:
      A modified copy of this object
    • withTtl

      public final ImmutableSessionInfo withTtl(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the ttl attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for ttl
      Returns:
      A modified copy of this object
    • withId

      public final ImmutableSessionInfo withId(String value)
      Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for id
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableSessionInfo that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: createIndex, lockDelay, name, node, checks, behavior, ttl, id.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value SessionInfo with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutableSessionInfo copyOf(SessionInfo instance)
      Creates an immutable copy of a SessionInfo 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

      public static ImmutableSessionInfo.Builder builder()
      Creates a builder for ImmutableSessionInfo.
       ImmutableSessionInfo.builder()
          .createIndex(long) // required createIndex
          .lockDelay(Long) // required lockDelay
          .name(String) // optional name
          .node(String) // required node
          .addChecks|addAllChecks(String) // checks elements
          .behavior(String) // required behavior
          .ttl(String) // optional ttl
          .id(String) // required id
          .build();
       
      Returns:
      A new ImmutableSessionInfo builder