Interface NodeSelectionStringCommands<K,​V>

  • Type Parameters:
    K - Key type.
    V - Value type.
    All Known Subinterfaces:
    NodeSelectionCommands<K,​V>

    public interface NodeSelectionStringCommands<K,​V>
    Synchronous executed commands on a node selection for Strings.
    Since:
    4.0
    Author:
    Mark Paluch
    Generated class:
    by io.lettuce.apigenerator.CreateSyncNodeSelectionClusterApi
    • Method Detail

      • append

        Executions<Long> append​(K key,
                                V value)
        Append a value to a key.
        Parameters:
        key - the key.
        value - the value.
        Returns:
        Long integer-reply the length of the string after the append operation.
      • bitcount

        Executions<Long> bitcount​(K key)
        Count set bits in a string.
        Parameters:
        key - the key.
        Returns:
        Long integer-reply The number of bits set to 1.
      • bitcount

        Executions<Long> bitcount​(K key,
                                  long start,
                                  long end)
        Count set bits in a string.
        Parameters:
        key - the key.
        start - the start.
        end - the end.
        Returns:
        Long integer-reply The number of bits set to 1.
      • bitfield

        Executions<List<Long>> bitfield​(K key,
                                        BitFieldArgs bitFieldArgs)
        Execute BITFIELD with its subcommands.
        Parameters:
        key - the key.
        bitFieldArgs - the args containing subcommands, must not be null.
        Returns:
        Long bulk-reply the results from the bitfield commands.
      • bitpos

        Executions<Long> bitpos​(K key,
                                boolean state)
        Find first bit set or clear in a string.
        Parameters:
        key - the key.
        state - the state.
        Returns:
        Long integer-reply The command returns the position of the first bit set to 1 or 0 according to the request. If we look for set bits (the bit argument is 1) and the string is empty or composed of just zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string only contains bit set to 1, the function returns the first bit not part of the string on the right. So if the string is three bytes set to the value 0xff the command BITPOS key 0 will return 24, since up to bit 23 all the bits are 1. Basically the function consider the right of the string as padded with zeros if you look for clear bits and specify no range or the start argument only.
      • bitpos

        Executions<Long> bitpos​(K key,
                                boolean state,
                                long start)
        Find first bit set or clear in a string.
        Parameters:
        key - the key.
        state - the bit type: long.
        start - the start type: long.
        Returns:
        Long integer-reply The command returns the position of the first bit set to 1 or 0 according to the request. If we look for set bits (the bit argument is 1) and the string is empty or composed of just zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string only contains bit set to 1, the function returns the first bit not part of the string on the right. So if the string is three bytes set to the value 0xff the command BITPOS key 0 will return 24, since up to bit 23 all the bits are 1. Basically the function consider the right of the string as padded with zeros if you look for clear bits and specify no range or the start argument only.
        Since:
        5.0.1
      • bitpos

        Executions<Long> bitpos​(K key,
                                boolean state,
                                long start,
                                long end)
        Find first bit set or clear in a string.
        Parameters:
        key - the key.
        state - the bit type: long.
        start - the start type: long.
        end - the end type: long.
        Returns:
        Long integer-reply The command returns the position of the first bit set to 1 or 0 according to the request. If we look for set bits (the bit argument is 1) and the string is empty or composed of just zero bytes, -1 is returned. If we look for clear bits (the bit argument is 0) and the string only contains bit set to 1, the function returns the first bit not part of the string on the right. So if the string is three bytes set to the value 0xff the command BITPOS key 0 will return 24, since up to bit 23 all the bits are 1. Basically the function consider the right of the string as padded with zeros if you look for clear bits and specify no range or the start argument only. However this behavior changes if you are looking for clear bits and specify a range with both start and end. If no clear bit is found in the specified range, the function returns -1 as the user specified a clear range and there are no 0 bits in that range.
      • bitopAnd

        Executions<Long> bitopAnd​(K destination,
                                  K... keys)
        Perform bitwise AND between strings.
        Parameters:
        destination - result key of the operation.
        keys - operation input key names.
        Returns:
        Long integer-reply The size of the string stored in the destination key, that is equal to the size of the longest input string.
      • bitopNot

        Executions<Long> bitopNot​(K destination,
                                  K source)
        Perform bitwise NOT between strings.
        Parameters:
        destination - result key of the operation.
        source - operation input key names.
        Returns:
        Long integer-reply The size of the string stored in the destination key, that is equal to the size of the longest input string.
      • bitopOr

        Executions<Long> bitopOr​(K destination,
                                 K... keys)
        Perform bitwise OR between strings.
        Parameters:
        destination - result key of the operation.
        keys - operation input key names.
        Returns:
        Long integer-reply The size of the string stored in the destination key, that is equal to the size of the longest input string.
      • bitopXor

        Executions<Long> bitopXor​(K destination,
                                  K... keys)
        Perform bitwise XOR between strings.
        Parameters:
        destination - result key of the operation.
        keys - operation input key names.
        Returns:
        Long integer-reply The size of the string stored in the destination key, that is equal to the size of the longest input string.
      • decr

        Executions<Long> decr​(K key)
        Decrement the integer value of a key by one.
        Parameters:
        key - the key.
        Returns:
        Long integer-reply the value of key after the decrement.
      • decrby

        Executions<Long> decrby​(K key,
                                long amount)
        Decrement the integer value of a key by the given number.
        Parameters:
        key - the key.
        amount - the decrement type: long.
        Returns:
        Long integer-reply the value of key after the decrement.
      • get

        Executions<V> get​(K key)
        Get the value of a key.
        Parameters:
        key - the key.
        Returns:
        V bulk-string-reply the value of key, or null when key does not exist.
      • getbit

        Executions<Long> getbit​(K key,
                                long offset)
        Returns the bit value at offset in the string value stored at key.
        Parameters:
        key - the key.
        offset - the offset type: long.
        Returns:
        Long integer-reply the bit value stored at offset.
      • getdel

        Executions<V> getdel​(K key)
        Get the value of key and delete the key.
        Parameters:
        key - the key.
        Returns:
        V bulk-string-reply the value of key, or null when key does not exist.
        Since:
        6.1
      • getex

        Executions<V> getex​(K key,
                            GetExArgs args)
        Get the value of key and optionally set its expiration.
        Parameters:
        key - the key.
        args - the arguments for GETEX.
        Returns:
        V bulk-string-reply the value of key, or null when key does not exist.
        Since:
        6.1
      • getrange

        Executions<V> getrange​(K key,
                               long start,
                               long end)
        Get a substring of the string stored at a key.
        Parameters:
        key - the key.
        start - the start type: long.
        end - the end type: long.
        Returns:
        V bulk-string-reply.
      • getset

        Executions<V> getset​(K key,
                             V value)
        Set the string value of a key and return its old value.
        Parameters:
        key - the key.
        value - the value.
        Returns:
        V bulk-string-reply the old value stored at key, or null when key did not exist.
      • incr

        Executions<Long> incr​(K key)
        Increment the integer value of a key by one.
        Parameters:
        key - the key.
        Returns:
        Long integer-reply the value of key after the increment.
      • incrby

        Executions<Long> incrby​(K key,
                                long amount)
        Increment the integer value of a key by the given amount.
        Parameters:
        key - the key.
        amount - the increment type: long.
        Returns:
        Long integer-reply the value of key after the increment.
      • incrbyfloat

        Executions<Double> incrbyfloat​(K key,
                                       double amount)
        Increment the float value of a key by the given amount.
        Parameters:
        key - the key.
        amount - the increment type: double.
        Returns:
        Double bulk-string-reply the value of key after the increment.
      • mget

        Executions<List<KeyValue<K,​V>>> mget​(K... keys)
        Get the values of all the given keys.
        Parameters:
        keys - the key.
        Returns:
        List<V> array-reply list of values at the specified keys.
      • mget

        Executions<Long> mget​(KeyValueStreamingChannel<K,​V> channel,
                              K... keys)
        Stream over the values of all the given keys.
        Parameters:
        channel - the channel.
        keys - the keys.
        Returns:
        Long array-reply list of values at the specified keys.
      • mset

        Executions<String> mset​(Map<K,​V> map)
        Set multiple keys to multiple values.
        Parameters:
        map - the map.
        Returns:
        String simple-string-reply always OK since MSET can't fail.
      • msetnx

        Executions<Boolean> msetnx​(Map<K,​V> map)
        Set multiple keys to multiple values, only if none of the keys exist.
        Parameters:
        map - the map.
        Returns:
        Boolean integer-reply specifically: 1 if the all the keys were set. 0 if no key was set (at least one key already existed).
      • set

        Executions<String> set​(K key,
                               V value)
        Set the string value of a key.
        Parameters:
        key - the key.
        value - the value.
        Returns:
        String simple-string-reply OK if SET was executed correctly.
      • set

        Executions<String> set​(K key,
                               V value,
                               SetArgs setArgs)
        Set the string value of a key.
        Parameters:
        key - the key.
        value - the value.
        setArgs - the setArgs.
        Returns:
        String simple-string-reply OK if SET was executed correctly.
      • setGet

        Executions<V> setGet​(K key,
                             V value)
        Set the string value of a key and return its old value.
        Parameters:
        key - the key.
        value - the value.
        Returns:
        V bulk-string-reply the old value stored at key, or null when key did not exist.
        Since:
        6.1
      • setGet

        Executions<V> setGet​(K key,
                             V value,
                             SetArgs setArgs)
        Set the string value of a key and return its old value.
        Parameters:
        key - the key.
        value - the value.
        setArgs - the command arguments.
        Returns:
        V bulk-string-reply the old value stored at key, or null when key did not exist.
        Since:
        6.1
      • setbit

        Executions<Long> setbit​(K key,
                                long offset,
                                int value)
        Sets or clears the bit at offset in the string value stored at key.
        Parameters:
        key - the key.
        offset - the offset type: long.
        value - the value type: string.
        Returns:
        Long integer-reply the original bit value stored at offset.
      • setex

        Executions<String> setex​(K key,
                                 long seconds,
                                 V value)
        Set the value and expiration of a key.
        Parameters:
        key - the key.
        seconds - the seconds type: long.
        value - the value.
        Returns:
        String simple-string-reply.
      • psetex

        Executions<String> psetex​(K key,
                                  long milliseconds,
                                  V value)
        Set the value and expiration in milliseconds of a key.
        Parameters:
        key - the key.
        milliseconds - the milliseconds type: long.
        value - the value.
        Returns:
        String simple-string-reply.
      • setnx

        Executions<Boolean> setnx​(K key,
                                  V value)
        Set the value of a key, only if the key does not exist.
        Parameters:
        key - the key.
        value - the value.
        Returns:
        Boolean integer-reply specifically: 1 if the key was set 0 if the key was not set.
      • setrange

        Executions<Long> setrange​(K key,
                                  long offset,
                                  V value)
        Overwrite part of a string at key starting at the specified offset.
        Parameters:
        key - the key.
        offset - the offset type: long.
        value - the value.
        Returns:
        Long integer-reply the length of the string after it was modified by the command.
      • stralgoLcs

        Executions<StringMatchResult> stralgoLcs​(StrAlgoArgs strAlgoArgs)
        The STRALGO command implements complex algorithms that operate on strings. This method uses the LCS algorithm (longest common substring).
        • Without modifiers the string representing the longest common substring is returned.
        • When LEN is given the command returns the length of the longest common substring.
        • When IDX is given the command returns an array with the LCS length and all the ranges in both the strings, start and end offset for each string, where there are matches. When WITHMATCHLEN is given each array representing a match will also have the length of the match.
        Parameters:
        strAlgoArgs - command arguments.
        Returns:
        StringMatchResult.
        Since:
        6.0
      • strlen

        Executions<Long> strlen​(K key)
        Get the length of the value stored in a key.
        Parameters:
        key - the key.
        Returns:
        Long integer-reply the length of the string at key, or 0 when key does not exist.