Class GetExArgs

  • All Implemented Interfaces:
    CompositeArgument

    public class GetExArgs
    extends Object
    implements CompositeArgument
    Argument list builder for the Redis GETEX command starting from Redis 6.2. Static import the methods from GetExArgs.Builder and chain the method calls: ex(10).nx().

    GetExArgs is a mutable object and instances should be used only once to avoid shared mutable state.

    Since:
    6.1
    Author:
    Mark Paluch
    • Constructor Detail

      • GetExArgs

        public GetExArgs()
    • Method Detail

      • ex

        public GetExArgs ex​(long timeout)
        Set the specified expire time, in seconds.
        Parameters:
        timeout - expire time in seconds.
        Returns:
        this GetExArgs.
      • ex

        public GetExArgs ex​(Duration timeout)
        Set the specified expire time, in seconds.
        Parameters:
        timeout - expire time in seconds.
        Returns:
        this GetExArgs.
        Since:
        6.1
      • exAt

        public GetExArgs exAt​(long timestamp)
        Set the specified expire at time using a posix timestamp.
        Parameters:
        timestamp - the timestamp type: posix time in seconds.
        Returns:
        this GetExArgs.
        Since:
        6.1
      • exAt

        public GetExArgs exAt​(Date timestamp)
        Set the specified expire at time using a posix timestamp.
        Parameters:
        timestamp - the timestamp type: posix time in seconds.
        Returns:
        this GetExArgs.
        Since:
        6.1
      • exAt

        public GetExArgs exAt​(Instant timestamp)
        Set the specified expire at time using a posix timestamp.
        Parameters:
        timestamp - the timestamp type: posix time in seconds.
        Returns:
        this GetExArgs.
        Since:
        6.1
      • px

        public GetExArgs px​(long timeout)
        Set the specified expire time, in milliseconds.
        Parameters:
        timeout - expire time in milliseconds.
        Returns:
        this GetExArgs.
      • px

        public GetExArgs px​(Duration timeout)
        Set the specified expire time, in milliseconds.
        Parameters:
        timeout - expire time in milliseconds.
        Returns:
        this GetExArgs.
      • pxAt

        public GetExArgs pxAt​(long timestamp)
        Set the specified expire at time using a posix timestamp.
        Parameters:
        timestamp - the timestamp type: posix time in milliseconds.
        Returns:
        this GetExArgs.
        Since:
        6.1
      • pxAt

        public GetExArgs pxAt​(Date timestamp)
        Set the specified expire at time using a posix timestamp.
        Parameters:
        timestamp - the timestamp type: posix time in milliseconds.
        Returns:
        this GetExArgs.
        Since:
        6.1
      • pxAt

        public GetExArgs pxAt​(Instant timestamp)
        Set the specified expire at time using a posix timestamp.
        Parameters:
        timestamp - the timestamp type: posix time in milliseconds.
        Returns:
        this GetExArgs.
        Since:
        6.1
      • persist

        public GetExArgs persist()
        Remove the time to live associated with the key.
        Returns:
        this GetExArgs.
      • build

        public <K,​V> void build​(CommandArgs<K,​V> args)
        Description copied from interface: CompositeArgument
        Build command arguments and contribute arguments to CommandArgs.

        Implementing classes are required to implement this method. Depending on the command nature and configured arguments, this method may contribute arguments but is not required to add arguments if none are specified.

        Specified by:
        build in interface CompositeArgument
        Type Parameters:
        K - Key type.
        V - Value type.
        Parameters:
        args - the command arguments, must not be null.