Class ImmutableSession


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableSession
    extends Session
    Immutable implementation of Session.

    Use the builder to create immutable instances: ImmutableSession.builder().

    • Method Summary

      Modifier and Type Method Description
      static ImmutableSession.Builder builder()
      Creates a builder for ImmutableSession.
      static ImmutableSession copyOf​(Session instance)
      Creates an immutable copy of a Session value.
      boolean equals​(java.lang.Object another)
      This instance is equal to all instances of ImmutableSession that have equal attribute values.
      java.util.Optional<java.lang.String> getBehavior()  
      com.google.common.collect.ImmutableList<java.lang.String> getChecks()  
      java.util.Optional<java.lang.String> getLockDelay()  
      java.util.Optional<java.lang.String> getName()  
      java.util.Optional<java.lang.String> getNode()  
      java.util.Optional<java.lang.String> getTtl()  
      int hashCode()
      Computes a hash code from attributes: lockDelay, name, node, checks, behavior, ttl.
      java.lang.String toString()
      Prints the immutable value Session with attribute values.
      ImmutableSession withBehavior​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional behavior attribute.
      ImmutableSession withBehavior​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the behavior attribute.
      ImmutableSession withChecks​(java.lang.Iterable<java.lang.String> elements)
      Copy the current immutable object with elements that replace the content of checks.
      ImmutableSession withChecks​(java.lang.String... elements)
      Copy the current immutable object with elements that replace the content of checks.
      ImmutableSession withLockDelay​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional lockDelay attribute.
      ImmutableSession withLockDelay​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the lockDelay attribute.
      ImmutableSession withName​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional name attribute.
      ImmutableSession withName​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the name attribute.
      ImmutableSession withNode​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional node attribute.
      ImmutableSession withNode​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the node attribute.
      ImmutableSession withTtl​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional ttl attribute.
      ImmutableSession withTtl​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the ttl attribute.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getLockDelay

        public java.util.Optional<java.lang.String> getLockDelay()
        Specified by:
        getLockDelay in class Session
        Returns:
        The value of the lockDelay attribute
      • getName

        public java.util.Optional<java.lang.String> getName()
        Specified by:
        getName in class Session
        Returns:
        The value of the name attribute
      • getNode

        public java.util.Optional<java.lang.String> getNode()
        Specified by:
        getNode in class Session
        Returns:
        The value of the node attribute
      • getChecks

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

        public java.util.Optional<java.lang.String> getBehavior()
        Specified by:
        getBehavior in class Session
        Returns:
        The value of the behavior attribute
      • getTtl

        public java.util.Optional<java.lang.String> getTtl()
        Specified by:
        getTtl in class Session
        Returns:
        The value of the ttl attribute
      • withLockDelay

        public final ImmutableSession withLockDelay​(java.lang.String value)
        Copy the current immutable object by setting a present value for the optional lockDelay attribute.
        Parameters:
        value - The value for lockDelay
        Returns:
        A modified copy of this object
      • withLockDelay

        public final ImmutableSession withLockDelay​(java.util.Optional<java.lang.String> optional)
        Copy the current immutable object by setting an optional value for the lockDelay 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 lockDelay
        Returns:
        A modified copy of this object
      • withName

        public final ImmutableSession withName​(java.lang.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 ImmutableSession withName​(java.util.Optional<java.lang.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 ImmutableSession withNode​(java.lang.String value)
        Copy the current immutable object by setting a present value for the optional node attribute.
        Parameters:
        value - The value for node
        Returns:
        A modified copy of this object
      • withNode

        public final ImmutableSession withNode​(java.util.Optional<java.lang.String> optional)
        Copy the current immutable object by setting an optional value for the node 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 node
        Returns:
        A modified copy of this object
      • withChecks

        public final ImmutableSession withChecks​(java.lang.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 ImmutableSession withChecks​(java.lang.Iterable<java.lang.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 ImmutableSession withBehavior​(java.lang.String value)
        Copy the current immutable object by setting a present value for the optional behavior attribute.
        Parameters:
        value - The value for behavior
        Returns:
        A modified copy of this object
      • withBehavior

        public final ImmutableSession withBehavior​(java.util.Optional<java.lang.String> optional)
        Copy the current immutable object by setting an optional value for the behavior 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 behavior
        Returns:
        A modified copy of this object
      • withTtl

        public final ImmutableSession withTtl​(java.lang.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 ImmutableSession withTtl​(java.util.Optional<java.lang.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
      • equals

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

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

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

        public static ImmutableSession copyOf​(Session instance)
        Creates an immutable copy of a Session 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 Session instance
      • builder

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