Class SetCommandKt

  • All Implemented Interfaces:

    
    public final class SetCommandKt
    
                        
    • Constructor Detail

    • Method Detail

      • setCommand

         final static RedisRequest setCommand(String key, StreamWithLength valueStream, SetCondition condition, SetExpiration expiration, Function1<Boolean, Unit> onResult)
        Parameters:
        condition -
        • optional, only set the key if the condition is met

        expiration -
        • optional, sets the expiration of the key

        onResult -
        • called with true if the key was set, false if not because the condition was not met

      • setGetCommand

         final static RedisRequest setGetCommand(String key, StreamWithLength valueStream, SetCondition condition, SetExpiration expiration, Function1<StreamWithLength, Unit> onResult)

        SET with the GET option: sets the key and returns its previous value.

        Parameters:
        condition -
        • optional, only set the key if the condition is met

        expiration -
        • optional, sets the expiration of the key

        onResult -
        • called with the previous value of the key, null if the key did not exist. Note: when a condition is given, Redis does not tell whether the key was set.