Class RestoreArgs

  • All Implemented Interfaces:
    CompositeArgument

    public class RestoreArgs
    extends Object
    implements CompositeArgument
    Argument list builder for the Redis RESTORE command. Static import the methods from RestoreArgs.Builder and call the methods: ttl(…) .

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

    Since:
    5.1
    Author:
    Mark Paluch, dengliming
    • Constructor Detail

      • RestoreArgs

        public RestoreArgs()
    • Method Detail

      • ttl

        public RestoreArgs ttl​(long milliseconds)
        Set TTL in milliseconds after restoring the key.
        Parameters:
        milliseconds - time to live.
        Returns:
        this.
      • ttl

        public RestoreArgs ttl​(Duration ttl)
        Set TTL in milliseconds after restoring the key.
        Parameters:
        ttl - time to live.
        Returns:
        this.
      • replace

        public RestoreArgs replace()
        Replaces existing keys if the target key already exists.
        Returns:
        this.
      • replace

        public RestoreArgs replace​(boolean replace)
        Replaces existing keys if the target key already exists.
        Parameters:
        replace - true to enable replacing of existing keys.
        Returns:
        this.
      • absttl

        public RestoreArgs absttl()
        TTL will represent an absolute Unix timestamp (in milliseconds) in which the key will expire.
        Returns:
        this.
        Since:
        6.1
      • absttl

        public RestoreArgs absttl​(boolean absttl)
        TTL will represent an absolute Unix timestamp (in milliseconds) in which the key will expire.
        Parameters:
        absttl - true to apply absolute TTL instead of a relative remaining TTL.
        Returns:
        this.
        Since:
        6.1
      • idleTime

        public RestoreArgs idleTime​(long idleTime)
        Set the number of seconds since the object stored at the specified key is idle (not requested by read or write operations).
        Parameters:
        idleTime - the idle time when using a LRU eviction policy.
        Returns:
        this.
        Since:
        6.1
      • frequency

        public RestoreArgs frequency​(long frequency)
        Set the logarithmic access frequency counter of the object stored at the specified key.
        Parameters:
        frequency - the access frequency when using a LFU eviction policy.
        Returns:
        this.
        Since:
        6.1
      • 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.