Class BaseBatch<T extends BaseBatch<T>>

  • Type Parameters:
    T - child typing for chaining method calls.
    Direct Known Subclasses:
    Batch, ClusterBatch

    public abstract class BaseBatch<T extends BaseBatch<T>>
    extends java.lang.Object
    Base class encompassing shared commands for both standalone and cluster server installations. Batches allow the execution of a group of commands in a single step.

    Batch Response: An array of command responses is returned by the client exec command, in the order they were given. Each element in the array represents a command given to the batch. The response for each command depends on the executed Valkey command. Specific response types are documented alongside each method.

    isAtomic: Determines whether the batch is atomic or non-atomic. If true, the batch will be executed as an atomic transaction. If false, the batch will be executed as a non-atomic pipeline.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BaseBatch​(boolean isAtomic)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      <ArgType> T append​(ArgType key, ArgType value)
      Appends a value to a key.
      <ArgType> T bitcount​(ArgType key)
      Counts the number of set bits (population counting) in a string stored at key.
      <ArgType> T bitcount​(ArgType key, long start)
      Counts the number of set bits (population counting) in a string stored at key.
      <ArgType> T bitcount​(ArgType key, long start, long end)
      Counts the number of set bits (population counting) in a string stored at key.
      <ArgType> T bitcount​(ArgType key, long start, long end, @NonNull BitmapIndexType options)
      Counts the number of set bits (population counting) in a string stored at key.
      <ArgType> T bitfield​(ArgType key, @NonNull BitFieldOptions.BitFieldSubCommands[] subCommands)
      Reads or modifies the array of bits representing the string that is held at key based on the specified subCommands.
      <ArgType> T bitfieldReadOnly​(ArgType key, @NonNull BitFieldOptions.BitFieldReadOnlySubCommands[] subCommands)
      Reads the array of bits representing the string that is held at key based on the specified subCommands.
      This command is routed depending on the client's ReadFrom strategy.
      <ArgType> T bitop​(@NonNull BitwiseOperation bitwiseOperation, ArgType destination, @NonNull ArgType[] keys)
      Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination.
      <ArgType> T bitpos​(ArgType key, long bit)
      Returns the position of the first bit matching the given bit value.
      <ArgType> T bitpos​(ArgType key, long bit, long start)
      Returns the position of the first bit matching the given bit value.
      <ArgType> T bitpos​(ArgType key, long bit, long start, long end)
      Returns the position of the first bit matching the given bit value.
      <ArgType> T bitpos​(ArgType key, long bit, long start, long end, @NonNull BitmapIndexType offsetType)
      Returns the position of the first bit matching the given bit value.
      <ArgType> T blmove​(ArgType source, ArgType destination, @NonNull ListDirection whereFrom, @NonNull ListDirection whereTo, double timeout)
      Blocks the connection until it atomically pops and removes the left/right-most element to the list stored at source depending on whereFrom, and pushes the element at the first/last element of the list stored at destination depending on whereFrom.
      BLMove is the blocking variant of #lmove(ArgType, ArgType, ListDirection, ListDirection).
      <ArgType> T blmpop​(@NonNull ArgType[] keys, @NonNull ListDirection direction, double timeout)
      Blocks the connection until it pops one element from the first non-empty list from the provided keys.
      <ArgType> T blmpop​(@NonNull ArgType[] keys, @NonNull ListDirection direction, @NonNull java.lang.Long count, double timeout)
      Blocks the connection until it pops one or more elements from the first non-empty list from the provided keys.
      <ArgType> T blpop​(@NonNull ArgType[] keys, double timeout)
      Pops an element from the head of the first list that is non-empty, with the given keys being checked in the order that they are given.
      Blocks the connection when there are no elements to pop from any of the given lists.
      <ArgType> T brpop​(@NonNull ArgType[] keys, double timeout)
      Pops an element from the tail of the first list that is non-empty, with the given keys being checked in the order that they are given.
      Blocks the connection when there are no elements to pop from any of the given lists.
      protected CommandRequestOuterClass.Command buildCommand​(CommandRequestOuterClass.RequestType requestType)
      Build protobuf CommandRequestOuterClass.Command object for given command and arguments.
      protected CommandRequestOuterClass.Command buildCommand​(CommandRequestOuterClass.RequestType requestType, CommandRequestOuterClass.Command.ArgsArray args)
      Build protobuf CommandRequestOuterClass.Command object for given command and arguments.
      protected CommandRequestOuterClass.Command buildCommand​(CommandRequestOuterClass.RequestType requestType, ArgsBuilder argsBuilder)
      Build protobuf CommandRequestOuterClass.Command object for given command and arguments.
      <ArgType> T bzmpop​(@NonNull ArgType[] keys, @NonNull ScoreFilter modifier, double timeout)
      Blocks the connection until it pops and returns a member-score pair from the first non-empty sorted set, with the given keys being checked in the order they are provided.
      BZMPOP is the blocking variant of #zmpop(ArgType[], ScoreFilter).
      <ArgType> T bzmpop​(@NonNull ArgType[] keys, @NonNull ScoreFilter modifier, double timeout, long count)
      Blocks the connection until it pops and returns multiple member-score pairs from the first non-empty sorted set, with the given keys being checked in the order they are provided.
      BZMPOP is the blocking variant of #zmpop(ArgType[], ScoreFilter, long).
      <ArgType> T bzpopmax​(@NonNull ArgType[] keys, double timeout)
      Blocks the connection until it removes and returns a member with the highest score from the sorted sets stored at the specified keys.
      <ArgType> T bzpopmin​(@NonNull ArgType[] keys, double timeout)
      Blocks the connection until it removes and returns a member with the lowest score from the sorted sets stored at the specified keys.
      T clientGetName()
      Gets the name of the current connection.
      T clientId()
      Gets the current connection id.
      T clientPause​(long timeout)
      Suspends all clients for the specified timeout.
      T clientPause​(long timeout, @NonNull ClientPauseMode mode)
      Suspends all clients for the specified timeout.
      T clientUnpause()
      Resumes processing commands on all clients.
      <ArgType> T configGet​(@NonNull ArgType[] parameters)
      Reads the configuration parameters of the running server.
      Starting from server version 7, command supports multiple parameters.
      T configResetStat()
      Resets the statistics reported by the server using the INFO and LATENCY HISTOGRAM commands.
      T configRewrite()
      Rewrites the configuration file with the current configuration.
      <ArgType> T configSet​(@NonNull java.util.Map<ArgType,​ArgType> parameters)
      Sets configuration parameters to the specified values.
      Starting from server version 7, command supports multiple parameters.
      <ArgType> T copy​(ArgType source, ArgType destination)
      Copies the value stored at the source to the destination key if the destination key does not yet exist.
      <ArgType> T copy​(ArgType source, ArgType destination, boolean replace)
      Copies the value stored at the source to the destination key.
      <ArgType> T copy​(ArgType source, ArgType destination, long destinationDB)
      Copies the value stored at the source to the destination key on destinationDB.
      <ArgType> T copy​(ArgType source, ArgType destination, long destinationDB, boolean replace)
      Copies the value stored at the source to the destination key on destinationDB.
      protected <ArgType> ArgType[] createArray​(ArgType... args)
      Helper function for creating generic type ("ArgType") array
      <ArgType> T customCommand​(ArgType[] args)
      Executes a single command, without checking inputs.
      T dbsize()
      Returns the number of keys in the currently selected database.
      <ArgType> T decr​(ArgType key)
      Decrements the number stored at key by one.
      <ArgType> T decrBy​(ArgType key, long amount)
      Decrements the number stored at key by amount.
      <ArgType> T del​(@NonNull ArgType[] keys)
      Removes the specified keys from the database.
      <ArgType> T dump​(ArgType key)
      Serialize the value stored at key in a Valkey-specific format and return it to the user.
      <ArgType> T echo​(ArgType message)
      Echoes the provided message back.
      protected CommandRequestOuterClass.Command.ArgsArray emptyArgs()
      Build protobuf CommandRequestOuterClass.Command.ArgsArray object for empty arguments.
      <ArgType> T exists​(@NonNull ArgType[] keys)
      Returns the number of keys in keys that exist in the database.
      <ArgType> T expire​(ArgType key, long seconds)
      Sets a timeout on key in seconds.
      <ArgType> T expire​(ArgType key, long seconds, @NonNull ExpireOptions expireOptions)
      Sets a timeout on key in seconds.
      <ArgType> T expireAt​(ArgType key, long unixSeconds)
      Sets a timeout on key.
      <ArgType> T expireAt​(ArgType key, long unixSeconds, @NonNull ExpireOptions expireOptions)
      Sets a timeout on key.
      <ArgType> T expiretime​(ArgType key)
      Returns the absolute Unix timestamp (since January 1, 1970) at which the given key will expire, in seconds.
      To get the expiration with millisecond precision, use #pexpiretime(ArgType).
      <ArgType> T fcall​(ArgType function, @NonNull ArgType[] arguments)
      Invokes a previously loaded read-only function.
      <ArgType> T fcall​(ArgType function, @NonNull ArgType[] keys, @NonNull ArgType[] arguments)
      Invokes a previously loaded function.
      <ArgType> T fcallReadOnly​(ArgType function, @NonNull ArgType[] arguments)
      Invokes a previously loaded function.
      <ArgType> T fcallReadOnly​(ArgType function, @NonNull ArgType[] keys, @NonNull ArgType[] arguments)
      Invokes a previously loaded read-only function.
      T flushall()
      Deletes all the keys of all the existing databases.
      T flushall​(FlushMode mode)
      Deletes all the keys of all the existing databases.
      T flushdb()
      Deletes all the keys of the currently selected database.
      T flushdb​(FlushMode mode)
      Deletes all the keys of the currently selected database.
      <ArgType> T functionDelete​(ArgType libName)
      Deletes a library and all its functions.
      T functionDump()
      Returns the serialized payload of all loaded libraries.
      T functionFlush()
      Deletes all function libraries.
      T functionFlush​(@NonNull FlushMode mode)
      Deletes all function libraries.
      T functionList​(boolean withCode)
      Returns information about the functions and libraries.
      <ArgType> T functionList​(ArgType libNamePattern, boolean withCode)
      Returns information about the functions and libraries.
      <ArgType> T functionLoad​(ArgType libraryCode, boolean replace)
      Loads a library to Valkey.
      T functionRestore​(@lombok.NonNull byte[] payload)
      Restores libraries from the serialized payload returned by functionDump().
      T functionRestore​(@lombok.NonNull byte[] payload, @NonNull FunctionRestorePolicy policy)
      Restores libraries from the serialized payload returned by functionDump().
      T functionStats()
      Returns information about the function that's currently running and information about the available execution engines.
      <ArgType> T geoadd​(ArgType key, @NonNull java.util.Map<ArgType,​GeospatialData> membersToGeospatialData)
      Adds geospatial members with their positions to the specified sorted set stored at key .
      If a member is already a part of the sorted set, its position is updated.
      To perform a geoadd operation while specifying optional parameters, use #geoadd(ArgType, Map, GeoAddOptions).
      <ArgType> T geoadd​(ArgType key, @NonNull java.util.Map<ArgType,​GeospatialData> membersToGeospatialData, @NonNull GeoAddOptions options)
      Adds geospatial members with their positions to the specified sorted set stored at key .
      If a member is already a part of the sorted set, its position is updated.
      <ArgType> T geodist​(ArgType key, ArgType member1, ArgType member2)
      Returns the distance between member1 and member2 saved in the geospatial index stored at key.
      <ArgType> T geodist​(ArgType key, ArgType member1, ArgType member2, @NonNull GeoUnit geoUnit)
      Returns the distance between member1 and member2 saved in the geospatial index stored at key.
      <ArgType> T geohash​(ArgType key, @NonNull ArgType[] members)
      Returns the GeoHash strings representing the positions of all the specified members in the sorted set stored at key.
      <ArgType> T geopos​(ArgType key, @NonNull ArgType[] members)
      Returns the positions (longitude,latitude) of all the specified members of the geospatial index represented by the sorted set at key.
      <ArgType> T geosearch​(ArgType key, @NonNull GeoSearchOrigin.SearchOrigin searchFrom, @NonNull GeoSearchShape searchBy)
      Returns the members of a sorted set populated with geospatial information using #geoadd(ArgType, Map), which are within the borders of the area specified by a given shape.
      <ArgType> T geosearch​(ArgType key, @NonNull GeoSearchOrigin.SearchOrigin searchFrom, @NonNull GeoSearchShape searchBy, @NonNull GeoSearchOptions options)
      Returns the members of a sorted set populated with geospatial information using #geoadd(ArgType, Map), which are within the borders of the area specified by a given shape.
      <ArgType> T geosearch​(ArgType key, @NonNull GeoSearchOrigin.SearchOrigin searchFrom, @NonNull GeoSearchShape searchBy, @NonNull GeoSearchOptions options, @NonNull GeoSearchResultOptions resultOptions)
      Returns the members of a sorted set populated with geospatial information using #geoadd(ArgType, Map), which are within the borders of the area specified by a given shape.
      <ArgType> T geosearch​(ArgType key, @NonNull GeoSearchOrigin.SearchOrigin searchFrom, @NonNull GeoSearchShape searchBy, @NonNull GeoSearchResultOptions resultOptions)
      Returns the members of a sorted set populated with geospatial information using #geoadd(ArgType, Map), which are within the borders of the area specified by a given shape.
      <ArgType> T geosearchstore​(ArgType destination, ArgType source, @NonNull GeoSearchOrigin.SearchOrigin searchFrom, @NonNull GeoSearchShape searchBy)
      Searches for members in a sorted set stored at source representing geospatial data within a circular or rectangular area and stores the result in destination.
      <ArgType> T geosearchstore​(ArgType destination, ArgType source, @NonNull GeoSearchOrigin.SearchOrigin searchFrom, @NonNull GeoSearchShape searchBy, @NonNull GeoSearchResultOptions resultOptions)
      Searches for members in a sorted set stored at source representing geospatial data within a circular or rectangular area and stores the result in destination.
      <ArgType> T geosearchstore​(ArgType destination, ArgType source, @NonNull GeoSearchOrigin.SearchOrigin searchFrom, @NonNull GeoSearchShape searchBy, @NonNull GeoSearchStoreOptions options)
      Searches for members in a sorted set stored at source representing geospatial data within a circular or rectangular area and stores the result in destination.
      <ArgType> T geosearchstore​(ArgType destination, ArgType source, @NonNull GeoSearchOrigin.SearchOrigin searchFrom, @NonNull GeoSearchShape searchBy, @NonNull GeoSearchStoreOptions options, @NonNull GeoSearchResultOptions resultOptions)
      Searches for members in a sorted set stored at source representing geospatial data within a circular or rectangular area and stores the result in destination.
      <ArgType> T get​(ArgType key)
      Gets the value associated with the given key, or null if no such key exists.
      <ArgType> T getbit​(ArgType key, long offset)
      Returns the bit value at offset in the string value stored at key.
      <ArgType> T getdel​(ArgType key)
      Gets a string value associated with the given key and deletes the key.
      <ArgType> T getex​(ArgType key)
      Gets the value associated with the given key.
      <ArgType> T getex​(ArgType key, @NonNull GetExOptions options)
      Gets the value associated with the given key.
      CommandRequestOuterClass.Batch.Builder getProtobufBatch()
      Returns the protobuf batch builder.
      <ArgType> T getrange​(ArgType key, int start, int end)
      Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive).
      protected abstract T getThis()  
      <ArgType> T hdel​(ArgType key, @NonNull ArgType[] fields)
      Removes the specified fields from the hash stored at key.
      <ArgType> T hexists​(ArgType key, ArgType field)
      Returns if field is an existing field in the hash stored at key.
      <ArgType> T hexpire​(ArgType key, long seconds, @NonNull ArgType[] fields, @NonNull HashFieldExpirationConditionOptions options)
      Sets expiration time for hash fields.
      <ArgType> T hexpireat​(ArgType key, long unixSeconds, @NonNull ArgType[] fields, @NonNull HashFieldExpirationConditionOptions options)
      Sets expiration time for hash fields, in seconds, using an absolute Unix timestamp.
      <ArgType> T hexpiretime​(ArgType key, @NonNull ArgType[] fields)
      Returns the absolute Unix timestamp (in seconds) at which the given hash fields will expire.
      <ArgType> T hget​(ArgType key, ArgType field)
      Retrieves the value associated with field in the hash stored at key.
      <ArgType> T hgetall​(ArgType key)
      Returns all fields and values of the hash stored at key.
      <ArgType> T hgetex​(ArgType key, @NonNull ArgType[] fields, @NonNull HGetExOptions options)
      Gets the values of the specified fields from the hash stored at key and optionally sets their expiration.
      If a field does not exist in the hash, a null value is returned for that field.
      <ArgType> T hincrBy​(ArgType key, ArgType field, long amount)
      Increments the number stored at field in the hash stored at key by increment.
      <ArgType> T hincrByFloat​(ArgType key, ArgType field, double amount)
      Increments the string representing a floating point number stored at field in the hash stored at key by increment.
      <ArgType> T hkeys​(ArgType key)
      Returns all field names in the hash stored at key.
      <ArgType> T hlen​(ArgType key)
      Returns the number of fields contained in the hash stored at key.
      <ArgType> T hmget​(ArgType key, @NonNull ArgType[] fields)
      Returns the values associated with the specified fields in the hash stored at key.
      <ArgType> T hpersist​(ArgType key, @NonNull ArgType[] fields)
      Removes the expiration time for each specified field, turning the field from volatile (a field with expiration time) to persistent (a field that will never expire as no expiration time is associated).
      <ArgType> T hpexpire​(ArgType key, long milliseconds, @NonNull ArgType[] fields, @NonNull HashFieldExpirationConditionOptions options)
      Sets expiration time for hash fields, in milliseconds.
      <ArgType> T hpexpireat​(ArgType key, long unixMilliseconds, @NonNull ArgType[] fields, @NonNull HashFieldExpirationConditionOptions options)
      Sets expiration time for hash fields, using an absolute Unix timestamp in milliseconds.
      <ArgType> T hpexpiretime​(ArgType key, @NonNull ArgType[] fields)
      Returns the absolute Unix timestamp (in milliseconds) at which the given hash fields will expire.
      <ArgType> T hpttl​(ArgType key, @NonNull ArgType[] fields)
      Returns the remaining time to live of hash fields that have a timeout, in milliseconds.
      <ArgType> T hrandfield​(ArgType key)
      Returns a random field name from the hash value stored at key.
      <ArgType> T hrandfieldWithCount​(ArgType key, long count)
      Retrieves up to count random field names from the hash value stored at key .
      <ArgType> T hrandfieldWithCountWithValues​(ArgType key, long count)
      Retrieves up to count random field names along with their values from the hash value stored at key.
      <ArgType> T hscan​(ArgType key, ArgType cursor)
      Iterates fields of Hash types and their associated values.
      <ArgType> T hscan​(ArgType key, ArgType cursor, @NonNull HScanOptions hScanOptions)
      Iterates fields of Hash types and their associated values.
      <ArgType> T hset​(ArgType key, @NonNull java.util.Map<ArgType,​ArgType> fieldValueMap)
      Sets the specified fields to their respective values in the hash stored at key.
      <ArgType> T hsetex​(ArgType key, @NonNull java.util.Map<ArgType,​ArgType> fieldValueMap, @NonNull HSetExOptions options)
      Sets the specified fields to their respective values in the hash stored at key with optional expiration.
      <ArgType> T hsetnx​(ArgType key, ArgType field, ArgType value)
      Sets field in the hash stored at key to value, only if field does not yet exist.
      If key does not exist, a new key holding a hash is created.
      If field already exists, this operation has no effect.
      <ArgType> T hstrlen​(ArgType key, ArgType field)
      Returns the string length of the value associated with field in the hash stored at key.
      <ArgType> T httl​(ArgType key, @NonNull ArgType[] fields)
      Returns the remaining time to live of hash fields that have a timeout, in seconds.
      <ArgType> T hvals​(ArgType key)
      Returns all values in the hash stored at key.
      <ArgType> T incr​(ArgType key)
      Increments the number stored at key by one.
      <ArgType> T incrBy​(ArgType key, long amount)
      Increments the number stored at key by amount.
      <ArgType> T incrByFloat​(ArgType key, double amount)
      Increments the string representing a floating point number stored at key by amount.
      T info()
      Gets information and statistics about the server using the InfoOptions.Section.DEFAULT option.
      T info​(@NonNull InfoOptions.Section[] sections)
      Gets information and statistics about the server.
      Starting from server version 7, command supports multiple section arguments.
      boolean isBinaryOutput()
      Returns whether batch commands may return binary data.
      T lastsave()
      Returns UNIX TIME of the last DB save timestamp or startup timestamp if no save was made since then.
      <ArgType> T lcs​(ArgType key1, ArgType key2)
      Returns all the longest common subsequences combined between strings stored at key1 and key2.
      <ArgType> T lcsIdx​(ArgType key1, ArgType key2)
      Returns the indices and length of the longest common subsequence between strings stored at key1 and key2.
      <ArgType> T lcsIdx​(ArgType key1, ArgType key2, long minMatchLen)
      Returns the indices and the total length of all the longest common subsequences between strings stored at key1 and key2.
      <ArgType> T lcsIdxWithMatchLen​(ArgType key1, ArgType key2)
      Returns the indices and lengths of the longest common subsequences between strings stored at key1 and key2.
      <ArgType> T lcsIdxWithMatchLen​(ArgType key1, ArgType key2, long minMatchLen)
      Returns the indices and lengths of the longest common subsequences between strings stored at key1 and key2.
      <ArgType> T lcsLen​(ArgType key1, ArgType key2)
      Returns the total length of all the longest common subsequences between strings stored at key1 and key2.
      <ArgType> T lindex​(ArgType key, long index)
      Returns the element at index from the list stored at key.
      The index is zero-based, so 0 means the first element, 1 the second element and so on.
      <ArgType> T linsert​(ArgType key, @NonNull LInsertOptions.InsertPosition position, ArgType pivot, ArgType element)
      Inserts element in the list at key either before or after the pivot.
      <ArgType> T llen​(ArgType key)
      Returns the length of the list stored at key.
      <ArgType> T lmove​(ArgType source, ArgType destination, @NonNull ListDirection whereFrom, @NonNull ListDirection whereTo)
      Atomically pops and removes the left/right-most element to the list stored at source depending on whereFrom, and pushes the element at the first/last element of the list stored at destination depending on whereFrom.
      <ArgType> T lmpop​(@NonNull ArgType[] keys, @NonNull ListDirection direction)
      Pops one element from the first non-empty list from the provided keys.
      <ArgType> T lmpop​(@NonNull ArgType[] keys, @NonNull ListDirection direction, @NonNull java.lang.Long count)
      Pops one or more elements from the first non-empty list from the provided keys .
      T lolwut()
      Displays a piece of generative computer art and the server version.
      T lolwut​(int version)
      Displays a piece of generative computer art and the server version.
      T lolwut​(int @NonNull [] parameters)
      Displays a piece of generative computer art and the server version.
      T lolwut​(int version, int @NonNull [] parameters)
      Displays a piece of generative computer art and the server version.
      <ArgType> T lpop​(ArgType key)
      Removes and returns the first elements of the list stored at key.
      <ArgType> T lpopCount​(ArgType key, long count)
      Removes and returns up to count elements of the list stored at key, depending on the list's length.
      <ArgType> T lpos​(ArgType key, ArgType element)
      Returns the index of the first occurrence of element inside the list specified by key.
      <ArgType> T lpos​(ArgType key, ArgType element, @NonNull LPosOptions options)
      Returns the index of an occurrence of element within a list based on the given options.
      <ArgType> T lposCount​(ArgType key, ArgType element, long count)
      Returns an array of indices of matching elements within a list.
      <ArgType> T lposCount​(ArgType key, ArgType element, long count, @NonNull LPosOptions options)
      Returns an array of indices of matching elements within a list based on the given options.
      <ArgType> T lpush​(ArgType key, @NonNull ArgType[] elements)
      Inserts all the specified values at the head of the list stored at key.
      <ArgType> T lpushx​(ArgType key, @NonNull ArgType[] elements)
      Inserts all the specified values at the head of the list stored at key, only if key exists and holds a list.
      <ArgType> T lrange​(ArgType key, long start, long end)
      Returns the specified elements of the list stored at key.
      The offsets start and end are zero-based indexes, with 0 being the first element of the list, 1 being the next element and so on.
      <ArgType> T lrem​(ArgType key, long count, ArgType element)
      Removes the first count occurrences of elements equal to element from the list stored at key.
      <ArgType> T lset​(ArgType key, long index, ArgType element)
      Sets the list element at index to element.
      The index is zero-based, so 0 means the first element, 1 the second element and so on.
      <ArgType> T ltrim​(ArgType key, long start, long end)
      Trims an existing list so that it will contain only the specified range of elements specified.
      <ArgType> T mget​(@NonNull ArgType[] keys)
      Retrieves the values of multiple keys.
      <ArgType> T move​(ArgType key, long dbIndex)
      Move key from the currently selected database to the database specified by dbIndex.
      T mset​(@NonNull java.util.Map<?,​?> keyValueMap)
      Sets multiple keys to multiple values in a single operation.
      T msetnx​(@NonNull java.util.Map<?,​?> keyValueMap)
      Sets multiple keys to multiple values in a single operation.
      <ArgType> T objectEncoding​(ArgType key)
      Returns the internal encoding for the server object stored at key.
      <ArgType> T objectFreq​(ArgType key)
      Returns the logarithmic access frequency counter of a server object stored at key.
      <ArgType> T objectIdletime​(ArgType key)
      Returns the time in seconds since the last access to the value stored at key.
      <ArgType> T objectRefcount​(ArgType key)
      Returns the reference count of the object stored at key.
      <ArgType> T persist​(ArgType key)
      Removes the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated).
      <ArgType> T pexpire​(ArgType key, long milliseconds)
      Sets a timeout on key in milliseconds.
      <ArgType> T pexpire​(ArgType key, long milliseconds, @NonNull ExpireOptions expireOptions)
      Sets a timeout on key in milliseconds.
      <ArgType> T pexpireAt​(ArgType key, long unixMilliseconds)
      Sets a timeout on key.
      <ArgType> T pexpireAt​(ArgType key, long unixMilliseconds, @NonNull ExpireOptions expireOptions)
      Sets a timeout on key.
      <ArgType> T pexpiretime​(ArgType key)
      Returns the absolute Unix timestamp (since January 1, 1970) at which the given key will expire, in milliseconds.
      <ArgType> T pfadd​(ArgType key, @NonNull ArgType[] elements)
      Adds all elements to the HyperLogLog data structure stored at the specified key.
      <ArgType> T pfcount​(@NonNull ArgType[] keys)
      Estimates the cardinality of the data stored in a HyperLogLog structure for a single key or calculates the combined cardinality of multiple keys by merging their HyperLogLogs temporarily.
      <ArgType> T pfmerge​(ArgType destination, @NonNull ArgType[] sourceKeys)
      Merges multiple HyperLogLog values into a unique value.
      If the destination variable exists, it is treated as one of the source HyperLogLog data sets, otherwise a new HyperLogLog is created.
      T ping()
      Pings the server.
      <ArgType> T ping​(ArgType msg)
      Pings the server.
      <ArgType> T pttl​(ArgType key)
      Returns the remaining time to live of key that has a timeout, in milliseconds.
      <ArgType> T publish​(ArgType message, ArgType channel)
      Publishes message on pubsub channel.
      T pubsubChannels()
      Lists the currently active channels.
      <ArgType> T pubsubChannels​(ArgType pattern)
      Lists the currently active channels.
      T pubsubNumPat()
      Returns the number of unique patterns that are subscribed to by clients.
      <ArgType> T pubsubNumSub​(@NonNull ArgType[] channels)
      Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified channels.
      T randomKey()
      Returns a random key from the currently selected database.
      <ArgType> T rename​(ArgType key, ArgType newKey)
      Renames key to newKey.
      If newKey already exists it is overwritten.
      <ArgType> T renamenx​(ArgType key, ArgType newKey)
      Renames key to newKey if newKey does not yet exist.
      T reset()
      Resets the connection state.
      <ArgType> T restore​(ArgType key, long ttl, @lombok.NonNull byte[] value)
      Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via dump(ArgType)).
      <ArgType> T restore​(ArgType key, long ttl, @lombok.NonNull byte[] value, @NonNull RestoreOptions restoreOptions)
      Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via dump(ArgType)).
      <ArgType> T rpop​(ArgType key)
      Removes and returns the last elements of the list stored at key.
      The command pops a single element from the end of the list.
      <ArgType> T rpopCount​(ArgType key, long count)
      Removes and returns up to count elements from the list stored at key, depending on the list's length.
      <ArgType> T rpush​(ArgType key, @NonNull ArgType[] elements)
      Inserts all the specified values at the tail of the list stored at key.
      elements are inserted one after the other to the tail of the list, from the leftmost element to the rightmost element.
      <ArgType> T rpushx​(ArgType key, @NonNull ArgType[] elements)
      Inserts all the specified values at the tail of the list stored at key, only if key exists and holds a list.
      <ArgType> T sadd​(ArgType key, @NonNull ArgType[] members)
      Adds specified members to the set stored at key.
      <ArgType> T scard​(ArgType key)
      Retrieves the set cardinality (number of elements) of the set stored at key.
      <ArgType> T sdiff​(@NonNull ArgType[] keys)
      Computes the difference between the first set and all the successive sets in keys.
      <ArgType> T sdiffstore​(ArgType destination, @NonNull ArgType[] keys)
      Stores the difference between the first set and all the successive sets in keys into a new set at destination.
      <ArgType> T set​(ArgType key, ArgType value)
      Sets the given key with the given value.
      <ArgType> T set​(ArgType key, ArgType value, @NonNull SetOptions options)
      Sets the given key with the given value.
      <ArgType> T setbit​(ArgType key, long offset, long value)
      Sets or clears the bit at offset in the string value stored at key.
      <ArgType> T setrange​(ArgType key, int offset, ArgType value)
      Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.
      If the offset is larger than the current length of the string at key, the string is padded with zero bytes to make offset fit.
      <ArgType> T sinter​(@NonNull ArgType[] keys)
      Gets the intersection of all the given sets.
      <ArgType> T sintercard​(@NonNull ArgType[] keys)
      Gets the cardinality of the intersection of all the given sets.
      <ArgType> T sintercard​(@NonNull ArgType[] keys, long limit)
      Gets the cardinality of the intersection of all the given sets.
      <ArgType> T sinterstore​(ArgType destination, @NonNull ArgType[] keys)
      Stores the members of the intersection of all given sets specified by keys into a new set at destination.
      <ArgType> T sismember​(ArgType key, ArgType member)
      Returns if member is a member of the set stored at key.
      <ArgType> T smembers​(ArgType key)
      Retrieves all the members of the set value stored at key.
      <ArgType> T smismember​(ArgType key, @NonNull ArgType[] members)
      Checks whether each member is contained in the members of the set stored at key.
      <ArgType> T smove​(ArgType source, ArgType destination, ArgType member)
      Moves member from the set at source to the set at destination , removing it from the source set.
      <ArgType> T sort​(ArgType key)
      Sorts the elements in the list, set, or sorted set at key and returns the result.
      <ArgType> T sort​(ArgType key, @NonNull SortOptions sortOptions)
      Sorts the elements in the list, set, or sorted set at key and returns the result.
      <ArgType> T sortReadOnly​(ArgType key)
      Sorts the elements in the list, set, or sorted set at key and returns the result.
      <ArgType> T sortReadOnly​(ArgType key, @NonNull SortOptions sortOptions)
      Sorts the elements in the list, set, or sorted set at key and returns the result.
      <ArgType> T sortStore​(ArgType key, ArgType destination)
      Sorts the elements in the list, set, or sorted set at key and stores the result in destination.
      <ArgType> T sortStore​(ArgType key, ArgType destination, @NonNull SortOptions sortOptions)
      Sorts the elements in the list, set, or sorted set at key and stores the result in destination.
      <ArgType> T spop​(ArgType key)
      Removes and returns one random member from the set stored at key.
      <ArgType> T spopCount​(ArgType key, long count)
      Removes and returns up to count random members from the set stored at key , depending on the set's length.
      <ArgType> T srandmember​(ArgType key)
      Returns a random element from the set value stored at key.
      <ArgType> T srandmember​(ArgType key, long count)
      Returns random elements from the set value stored at key.
      <ArgType> T srem​(ArgType key, @NonNull ArgType[] members)
      Removes specified members from the set stored at key.
      <ArgType> T sscan​(ArgType key, ArgType cursor)
      Iterates incrementally over a set.
      <ArgType> T sscan​(ArgType key, ArgType cursor, @NonNull SScanOptions sScanOptions)
      Iterates incrementally over a set.
      <ArgType> T strlen​(ArgType key)
      Returns the length of the string value stored at key.
      <ArgType> T sunion​(@NonNull ArgType[] keys)
      Gets the union of all the given sets.
      <ArgType> T sunionstore​(ArgType destination, @NonNull ArgType[] keys)
      Stores the members of the union of all given sets specified by keys into a new set at destination.
      T time()
      Returns the server time.
      <ArgType> T touch​(@NonNull ArgType[] keys)
      Updates the last access time of specified keys.
      <ArgType> T ttl​(ArgType key)
      Returns the remaining time to live of key that has a timeout.
      <ArgType> T type​(ArgType key)
      Returns the string representation of the type of the value stored at key.
      <ArgType> T unlink​(@NonNull ArgType[] keys)
      Unlinks (deletes) multiple keys from the database.
      T wait​(long numReplicas, long timeout)
      Returns the number of replicas that acknowledged the write commands sent by the current client before this command, both in the case where the specified number of replicas are reached, or when the timeout is reached.
      T withBinaryOutput()
      Sets binaryOutput to true.
      <ArgType> T xack​(ArgType key, ArgType group, @NonNull ArgType[] ids)
      Returns the number of messages that were successfully acknowledged by the consumer group member of a stream.
      <ArgType> T xadd​(ArgType key, @NonNull ArgType[][] values)
      Adds an entry to the specified stream stored at key.
      If the key doesn't exist, the stream is created.
      <ArgType> T xadd​(ArgType key, @NonNull ArgType[][] values, @NonNull StreamAddOptions options)
      Adds an entry to the specified stream stored at key.
      If the key doesn't exist, the stream is created.
      <ArgType> T xadd​(ArgType key, @NonNull java.util.Map<ArgType,​ArgType> values)
      Adds an entry to the specified stream stored at key.
      If the key doesn't exist, the stream is created.
      <ArgType> T xadd​(ArgType key, @NonNull java.util.Map<ArgType,​ArgType> values, @NonNull StreamAddOptions options)
      Adds an entry to the specified stream stored at key.
      If the key doesn't exist, the stream is created.
      <ArgType> T xautoclaim​(ArgType key, ArgType group, ArgType consumer, long minIdleTime, ArgType start)
      Transfers ownership of pending stream entries that match the specified criteria.
      <ArgType> T xautoclaim​(ArgType key, ArgType group, ArgType consumer, long minIdleTime, ArgType start, long count)
      Transfers ownership of pending stream entries that match the specified criteria.
      <ArgType> T xautoclaimJustId​(ArgType key, ArgType group, ArgType consumer, long minIdleTime, ArgType start)
      Transfers ownership of pending stream entries that match the specified criteria.
      <ArgType> T xautoclaimJustId​(ArgType key, ArgType group, ArgType consumer, long minIdleTime, ArgType start, long count)
      Transfers ownership of pending stream entries that match the specified criteria.
      <ArgType> T xclaim​(ArgType key, ArgType group, ArgType consumer, long minIdleTime, @NonNull ArgType[] ids)
      Changes the ownership of a pending message.
      <ArgType> T xclaim​(ArgType key, ArgType group, ArgType consumer, long minIdleTime, @NonNull ArgType[] ids, @NonNull StreamClaimOptions options)
      Changes the ownership of a pending message.
      <ArgType> T xclaimJustId​(ArgType key, ArgType group, ArgType consumer, long minIdleTime, @NonNull ArgType[] ids)
      Changes the ownership of a pending message.
      <ArgType> T xclaimJustId​(ArgType key, ArgType group, ArgType consumer, long minIdleTime, @NonNull ArgType[] ids, @NonNull StreamClaimOptions options)
      Changes the ownership of a pending message.
      <ArgType> T xdel​(ArgType key, @NonNull ArgType[] ids)
      Removes the specified entries by id from a stream, and returns the number of entries deleted.
      <ArgType> T xgroupCreate​(ArgType key, ArgType groupName, ArgType id)
      Creates a new consumer group uniquely identified by groupname for the stream stored at key.
      <ArgType> T xgroupCreate​(ArgType key, ArgType groupName, ArgType id, @NonNull StreamGroupOptions options)
      Creates a new consumer group uniquely identified by groupname for the stream stored at key.
      <ArgType> T xgroupCreateConsumer​(ArgType key, ArgType group, ArgType consumer)
      Creates a consumer named consumer in the consumer group group for the stream stored at key.
      <ArgType> T xgroupDelConsumer​(ArgType key, ArgType group, ArgType consumer)
      Deletes a consumer named consumer in the consumer group group.
      <ArgType> T xgroupDestroy​(ArgType key, ArgType groupName)
      Destroys the consumer group groupName for the stream stored at key.
      <ArgType> T xgroupSetId​(ArgType key, ArgType groupName, ArgType id)
      Sets the last delivered ID for a consumer group.
      <ArgType> T xgroupSetId​(ArgType key, ArgType groupName, ArgType id, long entriesRead)
      Sets the last delivered ID for a consumer group.
      <ArgType> T xinfoConsumers​(ArgType key, ArgType groupName)
      Returns the list of all consumers and their attributes for the given consumer group of the stream stored at key.
      <ArgType> T xinfoGroups​(ArgType key)
      Returns the list of all consumer groups and their attributes for the stream stored at key .
      <ArgType> T xinfoStream​(ArgType key)
      Returns information about the stream stored at key key.
      To get more detailed information use #xinfoStreamFull(ArgType) or #xinfoStreamFull(ArgType, int).
      <ArgType> T xinfoStreamFull​(ArgType key)
      Returns verbose information about the stream stored at key key.
      The output is limited by first 10 PEL entries.
      <ArgType> T xinfoStreamFull​(ArgType key, int count)
      Returns verbose information about the stream stored at key key.
      The output is limited by first 10 PEL entries.
      <ArgType> T xlen​(ArgType key)
      Returns the number of entries in the stream stored at key.
      <ArgType> T xpending​(ArgType key, ArgType group)
      Returns stream message summary information for pending messages matching a given range of IDs.
      <ArgType> T xpending​(ArgType key, ArgType group, @NonNull StreamRange start, @NonNull StreamRange end, long count)
      Returns an extended form of stream message information for pending messages matching a given range of IDs.
      <ArgType> T xpending​(ArgType key, ArgType group, @NonNull StreamRange start, @NonNull StreamRange end, long count, @NonNull StreamPendingOptions options)
      Returns an extended form of stream message information for pending messages matching a given range of IDs.
      <ArgType> T xrange​(ArgType key, @NonNull StreamRange start, @NonNull StreamRange end)
      Returns stream entries matching a given range of IDs.
      <ArgType> T xrange​(ArgType key, @NonNull StreamRange start, @NonNull StreamRange end, long count)
      Returns stream entries matching a given range of IDs.
      <ArgType> T xread​(@NonNull java.util.Map<ArgType,​ArgType> keysAndIds)
      Reads entries from the given streams.
      <ArgType> T xread​(@NonNull java.util.Map<ArgType,​ArgType> keysAndIds, @NonNull StreamReadOptions options)
      Reads entries from the given streams.
      <ArgType> T xreadgroup​(@NonNull java.util.Map<ArgType,​ArgType> keysAndIds, ArgType group, ArgType consumer)
      Reads entries from the given streams owned by a consumer group.
      <ArgType> T xreadgroup​(@NonNull java.util.Map<ArgType,​ArgType> keysAndIds, ArgType group, ArgType consumer, @NonNull StreamReadGroupOptions options)
      Reads entries from the given streams owned by a consumer group.
      <ArgType> T xrevrange​(ArgType key, @NonNull StreamRange end, @NonNull StreamRange start)
      Returns stream entries matching a given range of IDs in reverse order.
      Equivalent to #xrange(ArgType, StreamRange, StreamRange) but returns the entries in reverse order.
      <ArgType> T xrevrange​(ArgType key, @NonNull StreamRange end, @NonNull StreamRange start, long count)
      Returns stream entries matching a given range of IDs in reverse order.
      Equivalent to #xrange(ArgType, StreamRange, StreamRange, long) but returns the entries in reverse order.
      <ArgType> T xtrim​(ArgType key, @NonNull StreamTrimOptions options)
      Trims the stream by evicting older entries.
      <ArgType> T zadd​(ArgType key, @NonNull java.util.Map<ArgType,​java.lang.Double> membersScoresMap)
      Adds members with their scores to the sorted set stored at key.
      If a member is already a part of the sorted set, its score is updated.
      <ArgType> T zadd​(ArgType key, @NonNull java.util.Map<ArgType,​java.lang.Double> membersScoresMap, boolean changed)
      Adds members with their scores to the sorted set stored at key.
      If a member is already a part of the sorted set, its score is updated.
      <ArgType> T zadd​(ArgType key, @NonNull java.util.Map<ArgType,​java.lang.Double> membersScoresMap, @NonNull ZAddOptions options)
      Adds members with their scores to the sorted set stored at key.
      If a member is already a part of the sorted set, its score is updated.
      <ArgType> T zadd​(ArgType key, @NonNull java.util.Map<ArgType,​java.lang.Double> membersScoresMap, @NonNull ZAddOptions options, boolean changed)
      Adds members with their scores to the sorted set stored at key.
      If a member is already a part of the sorted set, its score is updated.
      <ArgType> T zaddIncr​(ArgType key, ArgType member, double increment)
      Increments the score of member in the sorted set stored at key by increment .
      If member does not exist in the sorted set, it is added with increment as its score (as if its previous score was 0.0).
      If key does not exist, a new sorted set with the specified member as its sole member is created.
      <ArgType> T zaddIncr​(ArgType key, ArgType member, double increment, @NonNull ZAddOptions options)
      Increments the score of member in the sorted set stored at key by increment .
      If member does not exist in the sorted set, it is added with increment as its score (as if its previous score was 0.0).
      If key does not exist, a new sorted set with the specified member as its sole member is created.
      zaddIncr with empty option acts as #zincrby(ArgType, double, ArgType).
      <ArgType> T zcard​(ArgType key)
      Returns the cardinality (number of elements) of the sorted set stored at key.
      <ArgType> T zcount​(ArgType key, @NonNull RangeOptions.ScoreRange minScore, @NonNull RangeOptions.ScoreRange maxScore)
      Returns the number of members in the sorted set stored at key with scores between minScore and maxScore.
      <ArgType> T zdiff​(@NonNull ArgType[] keys)
      Returns the difference between the first sorted set and all the successive sorted sets.
      To get the elements with their scores, see zdiffWithScores(ArgType[]).
      <ArgType> T zdiffstore​(ArgType destination, @NonNull ArgType[] keys)
      Calculates the difference between the first sorted set and all the successive sorted sets at keys and stores the difference as a sorted set to destination, overwriting it if it already exists.
      <ArgType> T zdiffWithScores​(@NonNull ArgType[] keys)
      Returns the difference between the first sorted set and all the successive sorted sets.
      <ArgType> T zincrby​(ArgType key, double increment, ArgType member)
      Increments the score of member in the sorted set stored at key by increment.
      If member does not exist in the sorted set, it is added with increment as its score.
      T zinter​(@NonNull WeightAggregateOptions.KeyArray keys)
      Returns the intersection of members from sorted sets specified by the given keys.
      T zinter​(@NonNull WeightAggregateOptions.KeyArrayBinary keys)
      Returns the intersection of members from sorted sets specified by the given keys.
      <ArgType> T zintercard​(@NonNull ArgType[] keys)
      Returns the cardinality of the intersection of the sorted sets specified by keys.
      <ArgType> T zintercard​(@NonNull ArgType[] keys, long limit)
      Returns the cardinality of the intersection of the sorted sets specified by keys.
      T zinterstore​(@NonNull GlideString destination, @NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys)
      Computes the intersection of sorted sets given by the specified KeysOrWeightedKeys , and stores the result in destination.
      T zinterstore​(@NonNull GlideString destination, @NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys, @NonNull WeightAggregateOptions.Aggregate aggregate)
      Computes the intersection of sorted sets given by the specified keysOrWeightedKeys , and stores the result in destination.
      T zinterstore​(@NonNull java.lang.String destination, @NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys)
      Computes the intersection of sorted sets given by the specified KeysOrWeightedKeys , and stores the result in destination.
      T zinterstore​(@NonNull java.lang.String destination, @NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys, @NonNull WeightAggregateOptions.Aggregate aggregate)
      Computes the intersection of sorted sets given by the specified keysOrWeightedKeys , and stores the result in destination.
      T zinterWithScores​(@NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys)
      Returns the intersection of members and their scores from sorted sets specified by the given keysOrWeightedKeys.
      T zinterWithScores​(@NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys)
      Returns the intersection of members and their scores from sorted sets specified by the given keysOrWeightedKeys.
      T zinterWithScores​(@NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys, @NonNull WeightAggregateOptions.Aggregate aggregate)
      Returns the intersection of members and their scores from sorted sets specified by the given keysOrWeightedKeys.
      T zinterWithScores​(@NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys, @NonNull WeightAggregateOptions.Aggregate aggregate)
      Returns the intersection of members and their scores from sorted sets specified by the given keysOrWeightedKeys.
      <ArgType> T zlexcount​(ArgType key, @NonNull RangeOptions.LexRange minLex, @NonNull RangeOptions.LexRange maxLex)
      Returns the number of members in the sorted set stored at key with scores between minLex and maxLex.
      <ArgType> T zmpop​(@NonNull ArgType[] keys, @NonNull ScoreFilter modifier)
      Pops a member-score pair from the first non-empty sorted set, with the given keys being checked in the order they are provided.
      <ArgType> T zmpop​(@NonNull ArgType[] keys, @NonNull ScoreFilter modifier, long count)
      Pops multiple member-score pairs from the first non-empty sorted set, with the given keys being checked in the order they are provided.
      <ArgType> T zmscore​(ArgType key, @NonNull ArgType[] members)
      Returns the scores associated with the specified members in the sorted set stored at key.
      <ArgType> T zpopmax​(ArgType key)
      Removes and returns the member with the highest score from the sorted set stored at the specified key.
      <ArgType> T zpopmax​(ArgType key, long count)
      Removes and returns up to count members with the highest scores from the sorted set stored at the specified key.
      <ArgType> T zpopmin​(ArgType key)
      Removes and returns the member with the lowest score from the sorted set stored at the specified key.
      <ArgType> T zpopmin​(ArgType key, long count)
      Removes and returns up to count members with the lowest scores from the sorted set stored at the specified key.
      <ArgType> T zrandmember​(ArgType key)
      Returns a random element from the sorted set stored at key.
      <ArgType> T zrandmemberWithCount​(ArgType key, long count)
      Retrieves random elements from the sorted set stored at key.
      <ArgType> T zrandmemberWithCountWithScores​(ArgType key, long count)
      Retrieves random elements along with their scores from the sorted set stored at key .
      <ArgType> T zrange​(ArgType key, @NonNull RangeOptions.RangeQuery rangeQuery)
      Returns the specified range of elements in the sorted set stored at key.
      ZRANGE can perform different types of range queries: by index (rank), by the score, or by lexicographical order.
      To get the elements with their scores, see zrangeWithScores(ArgType, glide.api.models.commands.RangeOptions.ScoredRangeQuery, boolean).
      <ArgType> T zrange​(ArgType key, @NonNull RangeOptions.RangeQuery rangeQuery, boolean reverse)
      Returns the specified range of elements in the sorted set stored at key.
      ZRANGE can perform different types of range queries: by index (rank), by the score, or by lexicographical order.
      To get the elements with their scores, see zrangeWithScores(ArgType, glide.api.models.commands.RangeOptions.ScoredRangeQuery, boolean).
      <ArgType> T zrangestore​(ArgType destination, ArgType source, @NonNull RangeOptions.RangeQuery rangeQuery)
      Stores a specified range of elements from the sorted set at source, into a new sorted set at destination.
      <ArgType> T zrangestore​(ArgType destination, ArgType source, @NonNull RangeOptions.RangeQuery rangeQuery, boolean reverse)
      Stores a specified range of elements from the sorted set at source, into a new sorted set at destination.
      <ArgType> T zrangeWithScores​(ArgType key, @NonNull RangeOptions.ScoredRangeQuery rangeQuery)
      Returns the specified range of elements with their scores in the sorted set stored at key .
      <ArgType> T zrangeWithScores​(ArgType key, @NonNull RangeOptions.ScoredRangeQuery rangeQuery, boolean reverse)
      Returns the specified range of elements with their scores in the sorted set stored at key .
      <ArgType> T zrank​(ArgType key, ArgType member)
      Returns the rank of member in the sorted set stored at key, with scores ordered from low to high, starting from 0.
      To get the rank of member with its score, see zrankWithScore(ArgType, ArgType).
      <ArgType> T zrankWithScore​(ArgType key, ArgType member)
      Returns the rank of member in the sorted set stored at key with its score, where scores are ordered from the lowest to highest, starting from 0.
      <ArgType> T zrem​(ArgType key, @NonNull ArgType[] members)
      Removes the specified members from the sorted set stored at key.
      Specified members that are not a member of this set are ignored.
      <ArgType> T zremrangebylex​(ArgType key, @NonNull RangeOptions.LexRange minLex, @NonNull RangeOptions.LexRange maxLex)
      Removes all elements in the sorted set stored at key with a lexicographical order between minLex and maxLex.
      <ArgType> T zremrangebyrank​(ArgType key, long start, long end)
      Removes all elements in the sorted set stored at key with rank between start and end.
      <ArgType> T zremrangebyscore​(ArgType key, @NonNull RangeOptions.ScoreRange minScore, @NonNull RangeOptions.ScoreRange maxScore)
      Removes all elements in the sorted set stored at key with a score between minScore and maxScore.
      <ArgType> T zrevrank​(ArgType key, ArgType member)
      Returns the rank of member in the sorted set stored at key, where scores are ordered from the highest to lowest, starting from 0.
      To get the rank of member with its score, see zrevrankWithScore(ArgType, ArgType).
      <ArgType> T zrevrankWithScore​(ArgType key, ArgType member)
      Returns the rank of member in the sorted set stored at key with its score, where scores are ordered from the highest to lowest, starting from 0.
      <ArgType> T zscan​(ArgType key, ArgType cursor)
      Iterates incrementally over a sorted set.
      <ArgType> T zscan​(ArgType key, ArgType cursor, @NonNull ZScanOptions zScanOptions)
      Iterates incrementally over a sorted set.
      <ArgType> T zscore​(ArgType key, ArgType member)
      Returns the score of member in the sorted set stored at key.
      T zunion​(@NonNull WeightAggregateOptions.KeyArray keys)
      Returns the union of members from sorted sets specified by the given keys.
      To get the elements with their scores, see zunionWithScores(glide.api.models.commands.WeightAggregateOptions.KeysOrWeightedKeys, glide.api.models.commands.WeightAggregateOptions.Aggregate).
      T zunion​(@NonNull WeightAggregateOptions.KeyArrayBinary keys)
      Returns the union of members from sorted sets specified by the given keys.
      To get the elements with their scores, see zunionWithScores(glide.api.models.commands.WeightAggregateOptions.KeysOrWeightedKeys, glide.api.models.commands.WeightAggregateOptions.Aggregate).
      T zunionstore​(@NonNull GlideString destination, @NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys)
      Computes the union of sorted sets given by the specified KeysOrWeightedKeys, and stores the result in destination.
      T zunionstore​(@NonNull GlideString destination, @NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys, @NonNull WeightAggregateOptions.Aggregate aggregate)
      Computes the union of sorted sets given by the specified KeysOrWeightedKeys, and stores the result in destination.
      T zunionstore​(@NonNull java.lang.String destination, @NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys)
      Computes the union of sorted sets given by the specified KeysOrWeightedKeys, and stores the result in destination.
      T zunionstore​(@NonNull java.lang.String destination, @NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys, @NonNull WeightAggregateOptions.Aggregate aggregate)
      Computes the union of sorted sets given by the specified KeysOrWeightedKeys, and stores the result in destination.
      T zunionWithScores​(@NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys)
      Returns the union of members and their scores from sorted sets specified by the given keysOrWeightedKeys.
      To perform a zunion operation while specifying aggregation settings, use zunionWithScores(KeysOrWeightedKeys, Aggregate).
      T zunionWithScores​(@NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys)
      Returns the union of members and their scores from sorted sets specified by the given keysOrWeightedKeys.
      To perform a zunion operation while specifying aggregation settings, use zunionWithScores(KeysOrWeightedKeys, Aggregate).
      T zunionWithScores​(@NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys, @NonNull WeightAggregateOptions.Aggregate aggregate)
      Returns the union of members and their scores from sorted sets specified by the given keysOrWeightedKeys.
      T zunionWithScores​(@NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys, @NonNull WeightAggregateOptions.Aggregate aggregate)
      Returns the union of members and their scores from sorted sets specified by the given keysOrWeightedKeys.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • binaryOutput

        protected boolean binaryOutput
        Flag whether batch commands may return binary data.
        If set to true, all commands in this batch return GlideString instead of String.
    • Constructor Detail

      • BaseBatch

        protected BaseBatch​(boolean isAtomic)
    • Method Detail

      • isBinaryOutput

        public boolean isBinaryOutput()
        Returns whether batch commands may return binary data.
      • withBinaryOutput

        public T withBinaryOutput()
        Sets binaryOutput to true.
      • getThis

        protected abstract T getThis()
      • customCommand

        public <ArgType> T customCommand​(ArgType[] args)
        Executes a single command, without checking inputs. Every part of the command, including subcommands, should be added as a separate value in args.
        Parameters:
        args - Arguments for the custom command.
        Returns:
        Command Response - The returned value for the custom command.
      • echo

        public <ArgType> T echo​(@NonNull
                                ArgType message)
        Echoes the provided message back.
        Parameters:
        message - The message to be echoed back.
        Returns:
        Command Response - The provided message.
        See Also:
        valkey.io for details.
      • ping

        public T ping()
        Pings the server.
        Returns:
        Command Response - A response from the server with a String.
        See Also:
        valkey.io for details.
      • reset

        public T reset()
        Resets the connection state.
        Returns:
        Command Response - A response from the server with a String.
        See Also:
        valkey.io for details.
      • ping

        public <ArgType> T ping​(@NonNull
                                ArgType msg)
        Pings the server.
        Parameters:
        msg - The ping argument that will be returned.
        Returns:
        Command Response - A response from the server with a String.
        See Also:
        valkey.io for details.
      • info

        public T info()
        Gets information and statistics about the server using the InfoOptions.Section.DEFAULT option.
        Returns:
        Command Response - A String with server info.
        See Also:
        valkey.io for details.
      • info

        public T info​(@NonNull
                      @NonNull InfoOptions.Section[] sections)
        Gets information and statistics about the server.
        Starting from server version 7, command supports multiple section arguments.
        Parameters:
        sections - A list of InfoOptions.Section values specifying which sections of information to retrieve. When no parameter is provided, the InfoOptions.Section.DEFAULT option is assumed.
        Returns:
        Command Response - A String containing the requested InfoOptions.Sections.
        See Also:
        valkey.io for details.
      • del

        public <ArgType> T del​(@NonNull
                               @NonNull ArgType[] keys)
        Removes the specified keys from the database. A key is ignored if it does not exist.
        Parameters:
        keys - The keys we wanted to remove.
        Returns:
        Command Response - The number of keys that were removed.
        See Also:
        valkey.io for details.
      • get

        public <ArgType> T get​(@NonNull
                               ArgType key)
        Gets the value associated with the given key, or null if no such key exists.
        Parameters:
        key - The key to retrieve from the database.
        Returns:
        Command Response - If key exists, returns the value of key as a String. Otherwise, return null.
        See Also:
        valkey.io for details.
      • getdel

        public <ArgType> T getdel​(@NonNull
                                  ArgType key)
        Gets a string value associated with the given key and deletes the key.
        Parameters:
        key - The key to retrieve from the database.
        Returns:
        Command Response - If key exists, returns the value of key. Otherwise, return null.
        See Also:
        valkey.io for details.
      • getex

        public <ArgType> T getex​(@NonNull
                                 ArgType key)
        Gets the value associated with the given key.
        Parameters:
        key - The key to retrieve from the database.
        Returns:
        Command Response - If key exists, return the value of the key. Otherwise, return null.
        Since:
        Valkey 6.2.0.
        See Also:
        valkey.io for details.
      • getex

        public <ArgType> T getex​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 @NonNull GetExOptions options)
        Gets the value associated with the given key.
        Parameters:
        key - The key to retrieve from the database.
        options - The GetExOptions options.
        Returns:
        Command Response - If key exists, return the value of the key. Otherwise, return null.
        Since:
        Valkey 6.2.0.
        See Also:
        valkey.io for details.
      • set

        public <ArgType> T set​(@NonNull
                               ArgType key,
                               @NonNull
                               ArgType value)
        Sets the given key with the given value.
        Parameters:
        key - The key to store.
        value - The value to store with the given key.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • append

        public <ArgType> T append​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  ArgType value)
        Appends a value to a key. If key does not exist it is created and set as an empty string, so APPEND will be similar to set(ArgType, ArgType) in this special case.
        Parameters:
        key - The key of the string.
        value - The value to append.
        Returns:
        Command Response - The length of the string after appending the value.
        See Also:
        valkey.io for details.
      • mget

        public <ArgType> T mget​(@NonNull
                                @NonNull ArgType[] keys)
        Retrieves the values of multiple keys.
        Parameters:
        keys - A list of keys to retrieve values for.
        Returns:
        Command Response - An array of values corresponding to the provided keys.
        If a keyis not found, its corresponding value in the list will be null .
        See Also:
        valkey.io for details.
      • mset

        public T mset​(@NonNull
                      @NonNull java.util.Map<?,​?> keyValueMap)
        Sets multiple keys to multiple values in a single operation.
        Parameters:
        keyValueMap - A key-value map consisting of keys and their respective values to set.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • msetnx

        public T msetnx​(@NonNull
                        @NonNull java.util.Map<?,​?> keyValueMap)
        Sets multiple keys to multiple values in a single operation. Performs no operation at all even if just a single key already exists.
        Parameters:
        keyValueMap - A key-value map consisting of keys and their respective values to set.
        Returns:
        Command Response - true if all keys were set, false if no key was set.
        See Also:
        valkey.io for details.
      • move

        public <ArgType> T move​(ArgType key,
                                long dbIndex)
        Move key from the currently selected database to the database specified by dbIndex.
        Parameters:
        key - The key to move.
        dbIndex - The index of the database to move key to.
        Returns:
        Command Response - true if key was moved, or false if the key already exists in the destination database or does not exist in the source database.
        See Also:
        valkey.io for more details.
      • incr

        public <ArgType> T incr​(@NonNull
                                ArgType key)
        Increments the number stored at key by one. If key does not exist, it is set to 0 before performing the operation.
        Parameters:
        key - The key to increment its value.
        Returns:
        Command Response - The value of key after the increment.
        See Also:
        valkey.io for details.
      • incrBy

        public <ArgType> T incrBy​(@NonNull
                                  ArgType key,
                                  long amount)
        Increments the number stored at key by amount. If key does not exist, it is set to 0 before performing the operation.
        Parameters:
        key - The key to increment its value.
        amount - The amount to increment.
        Returns:
        Command Response - The value of key after the increment.
        See Also:
        valkey.io for details.
      • incrByFloat

        public <ArgType> T incrByFloat​(@NonNull
                                       ArgType key,
                                       double amount)
        Increments the string representing a floating point number stored at key by amount. By using a negative increment value, the result is that the value stored at key is decremented. If key does not exist, it is set to 0 before performing the operation.
        Parameters:
        key - The key to increment its value.
        amount - The amount to increment.
        Returns:
        Command Response - The value of key after the increment.
        See Also:
        valkey.io for details.
      • decr

        public <ArgType> T decr​(@NonNull
                                ArgType key)
        Decrements the number stored at key by one. If key does not exist, it is set to 0 before performing the operation.
        Parameters:
        key - The key to decrement its value.
        Returns:
        Command Response - The value of key after the decrement.
        See Also:
        valkey.io for details.
      • decrBy

        public <ArgType> T decrBy​(@NonNull
                                  ArgType key,
                                  long amount)
        Decrements the number stored at key by amount. If key does not exist, it is set to 0 before performing the operation.
        Parameters:
        key - The key to decrement its value.
        amount - The amount to decrement.
        Returns:
        Command Response - The value of key after the decrement.
        See Also:
        valkey.io for details.
      • strlen

        public <ArgType> T strlen​(@NonNull
                                  ArgType key)
        Returns the length of the string value stored at key.
        Parameters:
        key - The key to check its length.
        Returns:
        Command Response - The length of the string value stored at key.
        If key does not exist, it is treated as an empty string, and the command returns 0.
        See Also:
        valkey.io for details.
      • setrange

        public <ArgType> T setrange​(@NonNull
                                    ArgType key,
                                    int offset,
                                    @NonNull
                                    ArgType value)
        Overwrites part of the string stored at key, starting at the specified offset, for the entire length of value.
        If the offset is larger than the current length of the string at key, the string is padded with zero bytes to make offset fit. Creates the key if it doesn't exist.
        Parameters:
        key - The key of the string to update.
        offset - The position in the string where value should be written.
        value - The string written with offset.
        Returns:
        Command Response - The length of the string stored at key after it was modified.
        See Also:
        valkey.io for details.
      • getrange

        public <ArgType> T getrange​(@NonNull
                                    ArgType key,
                                    int start,
                                    int end)
        Returns the substring of the string value stored at key, determined by the offsets start and end (both are inclusive). Negative offsets can be used in order to provide an offset starting from the end of the string. So -1 means the last character, -2 the penultimate and so forth. If key does not exist, an empty string is returned. If start or end are out of range, returns the substring within the valid range of the string.
        Parameters:
        key - The key of the string.
        start - The starting offset.
        end - The ending offset.
        Returns:
        Command Response - A substring extracted from the value stored at key.
        See Also:
        valkey.io for details.
      • hget

        public <ArgType> T hget​(@NonNull
                                ArgType key,
                                @NonNull
                                ArgType field)
        Retrieves the value associated with field in the hash stored at key.
        Parameters:
        key - The key of the hash.
        field - The field in the hash stored at key to retrieve from the database.
        Returns:
        Command Response - The value associated with field, or null when field is not present in the hash or key does not exist.
        See Also:
        valkey.io for details.
      • hset

        public <ArgType> T hset​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull java.util.Map<ArgType,​ArgType> fieldValueMap)
        Sets the specified fields to their respective values in the hash stored at key.
        Parameters:
        key - The key of the hash.
        fieldValueMap - A field-value map consisting of fields and their corresponding values to be set in the hash stored at the specified key.
        Returns:
        Command Response - The number of fields that were added.
        See Also:
        valkey.io for details.
      • hsetex

        public <ArgType> T hsetex​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  @NonNull java.util.Map<ArgType,​ArgType> fieldValueMap,
                                  @NonNull
                                  @NonNull HSetExOptions options)
        Sets the specified fields to their respective values in the hash stored at key with optional expiration. If key does not exist, a new key holding a hash is created.
        Parameters:
        key - The key of the hash.
        fieldValueMap - A field-value map consisting of fields and their corresponding values to be set in the hash stored at the specified key.
        options - The HSetExOptions for the command, including field conditional changes and expiry settings.
        Returns:
        Command Response - The number of fields that were added to the hash.
        Since:
        Valkey 9.0.0.
        See Also:
        valkey.io for details.
        Example:
        
         // Set fields with 60 second expiration, only if none exist
         HSetExOptions options = HSetExOptions.builder()
             .onlyIfNoneExist()
             .expiry(ExpirySet.Seconds(60L))
             .build();
        
         Map<String, String> fieldValueMap = Map.of("field1", "value1", "field2", "value2");
         batch.hsetex("myHash", fieldValueMap, options);
         
      • hgetex

        public <ArgType> T hgetex​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  @NonNull ArgType[] fields,
                                  @NonNull
                                  @NonNull HGetExOptions options)
        Gets the values of the specified fields from the hash stored at key and optionally sets their expiration.
        If a field does not exist in the hash, a null value is returned for that field.
        Parameters:
        key - The key of the hash.
        fields - The fields to retrieve from the hash.
        options - The HGetExOptions for the command, including expiry settings that support PERSIST but exclude KEEPTTL.
        Returns:
        Command Response - An array of values associated with the given fields, in the same order as they are requested. For every field that does not exist in the hash, a null value is returned.
        Since:
        Valkey 9.0.0.
        See Also:
        valkey.io for details.
        Example:
        
         // Get fields and set them to persist (no expiration)
         HGetExOptions options = HGetExOptions.builder()
             .expiry(HGetExExpiry.Persist())
             .build();
        
         String[] fields = {"field1", "field2"};
         batch.hgetex("myHash", fields, options);
         
      • hexpire

        public <ArgType> T hexpire​(@NonNull
                                   ArgType key,
                                   long seconds,
                                   @NonNull
                                   @NonNull ArgType[] fields,
                                   @NonNull
                                   @NonNull HashFieldExpirationConditionOptions options)
        Sets expiration time for hash fields. HEXPIRE sets the expiration time in seconds for the specified fields of the hash stored at key. You can specify whether to set the expiration only if the field has no expiration, only if the field has an existing expiration, only if the new expiration is greater than the current one, or only if the new expiration is less than the current one.
        Parameters:
        key - The key of the hash.
        seconds - The expiration time in seconds.
        fields - The fields in the hash stored at key to set expiration for.
        options - The HashFieldExpirationConditionOptions for the command, supporting only expiration conditions (NX/XX/GT/LT).
        Returns:
        Command Response - An array of Boolean values indicating the success of setting expiration for each field. true indicates that the expiration was successfully set, and false indicates that the condition was not met or the field does not exist.
        Since:
        Valkey 9.0 and above.
        See Also:
        valkey.io for details.
        Example:
        
         // Set expiration only if fields have no existing expiration
         HashFieldExpirationConditionOptions options = HashFieldExpirationConditionOptions.builder()
             .onlyIfNoExpiry()
             .build();
        
         String[] fields = {"field1", "field2"};
         batch.hexpire("myHash", 300L, fields, options);
         
      • hpersist

        public <ArgType> T hpersist​(@NonNull
                                    ArgType key,
                                    @NonNull
                                    @NonNull ArgType[] fields)
        Removes the expiration time for each specified field, turning the field from volatile (a field with expiration time) to persistent (a field that will never expire as no expiration time is associated).
        Parameters:
        key - The key of the hash.
        fields - The fields to remove expiration from.
        Returns:
        Command Response - An array of Boolean values, each corresponding to a field:
        • true if the expiration time was successfully removed from the field.
        • false if the field does not exist or does not have an expiration time.
        Since:
        Valkey 9.0 and above.
        See Also:
        valkey.io for details.
      • hpexpire

        public <ArgType> T hpexpire​(@NonNull
                                    ArgType key,
                                    long milliseconds,
                                    @NonNull
                                    @NonNull ArgType[] fields,
                                    @NonNull
                                    @NonNull HashFieldExpirationConditionOptions options)
        Sets expiration time for hash fields, in milliseconds. Creates the hash if it doesn't exist. If a field is already expired, it will be deleted rather than expired.
        Parameters:
        key - The key of the hash.
        milliseconds - The expiration time to set for the fields, in milliseconds.
        fields - The fields to set expiration for.
        options - The HashFieldExpirationConditionOptions for the command, supporting only expiration conditions (NX/XX/GT/LT).
        Returns:
        Command response - An array of Boolean values, each corresponding to a field:
        • true if the expiration time was successfully set for the field.
        • false if the field does not exist or the expiration time was not set due to the condition not being met.
        Since:
        Valkey 9.0 and above.
        See Also:
        valkey.io for details.
        Example:
        
         // Set expiration only if new expiration is greater than current
         HashFieldExpirationConditionOptions options = HashFieldExpirationConditionOptions.builder()
             .onlyIfGreaterThanCurrent()
             .build();
        
         String[] fields = {"field1", "field2"};
         batch.hpexpire("myHash", 30000L, fields, options);
         
      • hexpireat

        public <ArgType> T hexpireat​(@NonNull
                                     ArgType key,
                                     long unixSeconds,
                                     @NonNull
                                     @NonNull ArgType[] fields,
                                     @NonNull
                                     @NonNull HashFieldExpirationConditionOptions options)
        Sets expiration time for hash fields, in seconds, using an absolute Unix timestamp. Creates the hash if it doesn't exist. If a field is already expired, it will be deleted rather than expired.
        Parameters:
        key - The key of the hash.
        unixSeconds - The expiration time to set for the fields, as a Unix timestamp in seconds.
        fields - The fields to set expiration for.
        options - The HashFieldExpirationConditionOptions for the command, supporting only expiration conditions (NX/XX/GT/LT).
        Returns:
        Command response - An array of Boolean values, each corresponding to a field:
        • true if the expiration time was successfully set for the field.
        • false if the field does not exist or the expiration time was not set due to the condition not being met.
        Since:
        Valkey 9.0 and above.
        See Also:
        valkey.io for details.
        Example:
        
         // Set expiration only if fields have existing expiration
         HashFieldExpirationConditionOptions options = HashFieldExpirationConditionOptions.builder()
             .onlyIfHasExpiry()
             .build();
        
         String[] fields = {"field1", "field2"};
         long unixTimestamp = System.currentTimeMillis() / 1000 + 3600; // 1 hour from now
         batch.hexpireat("myHash", unixTimestamp, fields, options);
         
      • hpexpireat

        public <ArgType> T hpexpireat​(@NonNull
                                      ArgType key,
                                      long unixMilliseconds,
                                      @NonNull
                                      @NonNull ArgType[] fields,
                                      @NonNull
                                      @NonNull HashFieldExpirationConditionOptions options)
        Sets expiration time for hash fields, using an absolute Unix timestamp in milliseconds. HPEXPIREAT has the same effect and semantic as HEXPIREAT, but the Unix time at which the field will expire is specified in milliseconds instead of seconds. See hexpireat(Object, long, Object[], HashFieldExpirationConditionOptions) for more details.
        Parameters:
        key - The key of the hash.
        unixMilliseconds - The expiration time to set for the fields, as a Unix timestamp in milliseconds.
        fields - The fields to set expiration for.
        options - The HashFieldExpirationConditionOptions for the command, supporting only expiration conditions (NX/XX/GT/LT).
        Returns:
        Command response - An array of Boolean values, each corresponding to a field:
        • true if the expiration time was successfully set for the field.
        • false if the field does not exist or the expiration time was not set due to the condition not being met.
        Since:
        Valkey 9.0 and above.
        See Also:
        valkey.io for details.
        Example:
        
         // Set expiration only if new expiration is less than current
         HashFieldExpirationConditionOptions options = HashFieldExpirationConditionOptions.builder()
             .onlyIfLessThanCurrent()
             .build();
        
         String[] fields = {"field1", "field2"};
         long unixTimestamp = System.currentTimeMillis() + 1800000; // 30 minutes from now
         batch.hpexpireat("myHash", unixTimestamp, fields, options);
         
      • httl

        public <ArgType> T httl​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull ArgType[] fields)
        Returns the remaining time to live of hash fields that have a timeout, in seconds.
        Parameters:
        key - The key of the hash.
        fields - The fields to get the TTL for.
        Returns:
        Command Response - An array of Long values, each corresponding to a field:
        • TTL in seconds if the field exists and has a timeout.
        • -1 if the field exists but has no associated expire.
        • -2 if the field does not exist.
        Since:
        Valkey 9.0 and above.
        See Also:
        valkey.io for details.
      • hpttl

        public <ArgType> T hpttl​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 @NonNull ArgType[] fields)
        Returns the remaining time to live of hash fields that have a timeout, in milliseconds.
        Parameters:
        key - The key of the hash.
        fields - The fields to get the TTL for.
        Returns:
        Command Response - An array of TTL values in milliseconds for the specified fields:
        • For fields with a timeout, returns the remaining TTL in milliseconds.
        • For fields that exist but have no associated expire, returns -1.
        • For fields that do not exist, returns -2.
        Since:
        Valkey 9.0 and above.
        See Also:
        valkey.io for details.
      • hexpiretime

        public <ArgType> T hexpiretime​(@NonNull
                                       ArgType key,
                                       @NonNull
                                       @NonNull ArgType[] fields)
        Returns the absolute Unix timestamp (in seconds) at which the given hash fields will expire.
        Parameters:
        key - The key of the hash.
        fields - The fields to get the expiration timestamp for.
        Returns:
        Command Response - An array of expiration timestamps in seconds for the specified fields:
        • For fields with a timeout, returns the absolute Unix timestamp in seconds.
        • For fields that exist but have no associated expire, returns -1.
        • For fields that do not exist, returns -2.
        Since:
        Valkey 9.0 and above.
        See Also:
        valkey.io for details.
      • hpexpiretime

        public <ArgType> T hpexpiretime​(@NonNull
                                        ArgType key,
                                        @NonNull
                                        @NonNull ArgType[] fields)
        Returns the absolute Unix timestamp (in milliseconds) at which the given hash fields will expire.
        Parameters:
        key - The key of the hash.
        fields - The fields to get the expiration timestamp for.
        Returns:
        Command Response - An array of expiration timestamps in milliseconds for the specified fields:
        • For fields with a timeout, returns the absolute Unix timestamp in milliseconds.
        • For fields that exist but have no associated expire, returns -1.
        • For fields that do not exist, returns -2.
        Since:
        Valkey 9.0 and above.
        See Also:
        valkey.io for details.
      • hsetnx

        public <ArgType> T hsetnx​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  ArgType field,
                                  @NonNull
                                  ArgType value)
        Sets field in the hash stored at key to value, only if field does not yet exist.
        If key does not exist, a new key holding a hash is created.
        If field already exists, this operation has no effect.
        Parameters:
        key - The key of the hash.
        field - The field to set the value for.
        value - The value to set.
        Returns:
        Command Response - true if the field was set, false if the field already existed and was not set.
        See Also:
        valkey.io for details.
      • hdel

        public <ArgType> T hdel​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull ArgType[] fields)
        Removes the specified fields from the hash stored at key. Specified fields that do not exist within this hash are ignored.
        Parameters:
        key - The key of the hash.
        fields - The fields to remove from the hash stored at key.
        Returns:
        Command Response - The number of fields that were removed from the hash, not including specified but non-existing fields.
        If key does not exist, it is treated as an empty hash and it returns 0.
        See Also:
        valkey.io for details.
      • hlen

        public <ArgType> T hlen​(@NonNull
                                ArgType key)
        Returns the number of fields contained in the hash stored at key.
        Parameters:
        key - The key of the hash.
        Returns:
        Command Response - The number of fields in the hash, or 0 when the key does not exist.
        If key holds a value that is not a hash, an error is returned.
        See Also:
        valkey.io for details.
      • hvals

        public <ArgType> T hvals​(@NonNull
                                 ArgType key)
        Returns all values in the hash stored at key.
        Parameters:
        key - The key of the hash.
        Returns:
        Command Response - An array of values in the hash, or an empty array when the key does not exist.
        See Also:
        valkey.io for details.
      • hmget

        public <ArgType> T hmget​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 @NonNull ArgType[] fields)
        Returns the values associated with the specified fields in the hash stored at key.
        Parameters:
        key - The key of the hash.
        fields - The fields in the hash stored at key to retrieve from the database.
        Returns:
        Command Response - An array of values associated with the given fields, in the same order as they are requested.
        For every field that does not exist in the hash, a null value is returned.
        If key does not exist, it is treated as an empty hash, and it returns an array of null values.
        See Also:
        valkey.io for details.
      • hexists

        public <ArgType> T hexists​(@NonNull
                                   ArgType key,
                                   @NonNull
                                   ArgType field)
        Returns if field is an existing field in the hash stored at key.
        Parameters:
        key - The key of the hash.
        field - The field to check in the hash stored at key.
        Returns:
        Command Response - true if the hash contains the specified field. If the hash does not contain the field, or if the key does not exist, it returns false .
        See Also:
        valkey.io for details.
      • hgetall

        public <ArgType> T hgetall​(@NonNull
                                   ArgType key)
        Returns all fields and values of the hash stored at key.
        Parameters:
        key - The key of the hash.
        Returns:
        Command Response - A Map of fields and their values stored in the hash. Every field name in the map is associated with its corresponding value.
        If key does not exist, it returns an empty map.
        See Also:
        valkey.io for details.
      • hincrBy

        public <ArgType> T hincrBy​(@NonNull
                                   ArgType key,
                                   @NonNull
                                   ArgType field,
                                   long amount)
        Increments the number stored at field in the hash stored at key by increment. By using a negative increment value, the value stored at field in the hash stored at key is decremented. If field or key does not exist, it is set to 0 before performing the operation.
        Parameters:
        key - The key of the hash.
        field - The field in the hash stored at key to increment or decrement its value.
        amount - The amount by which to increment or decrement the field's value. Use a negative value to decrement.
        Returns:
        Command Response - The value of field in the hash stored at key after the increment or decrement.
        See Also:
        valkey.io for details.
      • hincrByFloat

        public <ArgType> T hincrByFloat​(@NonNull
                                        ArgType key,
                                        @NonNull
                                        ArgType field,
                                        double amount)
        Increments the string representing a floating point number stored at field in the hash stored at key by increment. By using a negative increment value, the value stored at field in the hash stored at key is decremented. If field or key does not exist, it is set to 0 before performing the operation.
        Parameters:
        key - The key of the hash.
        field - The field in the hash stored at key to increment or decrement its value.
        amount - The amount by which to increment or decrement the field's value. Use a negative value to decrement.
        Returns:
        Command Response - The value of field in the hash stored at key after the increment or decrement.
        See Also:
        valkey.io for details.
      • hkeys

        public <ArgType> T hkeys​(@NonNull
                                 ArgType key)
        Returns all field names in the hash stored at key.
        Parameters:
        key - The key of the hash.
        Returns:
        Command Response - An array of field names in the hash, or an empty array when the key does not exist.
        See Also:
        valkey.io for details
      • hstrlen

        public <ArgType> T hstrlen​(@NonNull
                                   ArgType key,
                                   @NonNull
                                   ArgType field)
        Returns the string length of the value associated with field in the hash stored at key.
        Parameters:
        key - The key of the hash.
        field - The field in the hash.
        Returns:
        Command Response - The string length or 0 if field or key does not exist.
        See Also:
        valkey.io for details.
      • hrandfield

        public <ArgType> T hrandfield​(@NonNull
                                      ArgType key)
        Returns a random field name from the hash value stored at key.
        Parameters:
        key - The key of the hash.
        Returns:
        Command Response - A random field name from the hash stored at key, or null when the key does not exist.
        Since:
        Valkey 6.2 and above.
        See Also:
        valkey.io for details.
      • hrandfieldWithCount

        public <ArgType> T hrandfieldWithCount​(@NonNull
                                               ArgType key,
                                               long count)
        Retrieves up to count random field names from the hash value stored at key .
        Parameters:
        key - The key of the hash.
        count - The number of field names to return.
        If count is positive, returns unique elements.
        If negative, allows for duplicates.
        Returns:
        Command Response - An array of random field names from the hash stored at key, or an empty array when the key does not exist.
        Since:
        Valkey 6.2 and above.
        See Also:
        valkey.io for details.
      • hrandfieldWithCountWithValues

        public <ArgType> T hrandfieldWithCountWithValues​(@NonNull
                                                         ArgType key,
                                                         long count)
        Retrieves up to count random field names along with their values from the hash value stored at key.
        Parameters:
        key - The key of the hash.
        count - The number of field names to return.
        If count is positive, returns unique elements.
        If negative, allows for duplicates.
        Returns:
        Command Response - A 2D array of [fieldName, value] arrays, where fieldName is a random field name from the hash and value is the associated value of the field name.
        If the hash does not exist or is empty, the response will be an empty array.
        Since:
        Valkey 6.2 and above.
        See Also:
        valkey.io for details.
      • lpush

        public <ArgType> T lpush​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 @NonNull ArgType[] elements)
        Inserts all the specified values at the head of the list stored at key. elements are inserted one after the other to the head of the list, from the leftmost element to the rightmost element. If key does not exist, it is created as an empty list before performing the push operations.
        Parameters:
        key - The key of the list.
        elements - The elements to insert at the head of the list stored at key.
        Returns:
        Command Response - The length of the list after the push operations.
        See Also:
        valkey.io for details.
      • lpop

        public <ArgType> T lpop​(@NonNull
                                ArgType key)
        Removes and returns the first elements of the list stored at key. The command pops a single element from the beginning of the list.
        Parameters:
        key - The key of the list.
        Returns:
        Command Response - The value of the first element.
        If key does not exist, null will be returned.
        See Also:
        valkey.io for details.
      • lpos

        public <ArgType> T lpos​(@NonNull
                                ArgType key,
                                @NonNull
                                ArgType element)
        Returns the index of the first occurrence of element inside the list specified by key. If no match is found, null is returned.
        Parameters:
        key - The name of the list.
        element - The value to search for within the list.
        Returns:
        Command Response - The index of the first occurrence of element, or null if element is not in the list.
        Since:
        Valkey 6.0.6.
        See Also:
        valkey.io for details.
      • lpos

        public <ArgType> T lpos​(@NonNull
                                ArgType key,
                                @NonNull
                                ArgType element,
                                @NonNull
                                @NonNull LPosOptions options)
        Returns the index of an occurrence of element within a list based on the given options. If no match is found, null is returned.
        Parameters:
        key - The name of the list.
        element - The value to search for within the list.
        options - The LPos options.
        Returns:
        Command Response - The index of element, or null if element is not in the list.
        Since:
        Valkey 6.0.6.
        See Also:
        valkey.io for details.
      • lposCount

        public <ArgType> T lposCount​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     ArgType element,
                                     long count)
        Returns an array of indices of matching elements within a list.
        Parameters:
        key - The name of the list.
        element - The value to search for within the list.
        count - The number of matches wanted.
        Returns:
        Command Response - An array that holds the indices of the matching elements within the list.
        Since:
        Valkey 6.0.6.
        See Also:
        valkey.io for details.
      • lposCount

        public <ArgType> T lposCount​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     ArgType element,
                                     long count,
                                     @NonNull
                                     @NonNull LPosOptions options)
        Returns an array of indices of matching elements within a list based on the given options. If no match is found, an empty arrayis returned.
        Parameters:
        key - The name of the list.
        element - The value to search for within the list.
        count - The number of matches wanted.
        options - The LPos options.
        Returns:
        Command Response - An array that holds the indices of the matching elements within the list.
        Since:
        Valkey 6.0.6.
        See Also:
        valkey.io for details.
      • lpopCount

        public <ArgType> T lpopCount​(@NonNull
                                     ArgType key,
                                     long count)
        Removes and returns up to count elements of the list stored at key, depending on the list's length.
        Parameters:
        key - The key of the list.
        count - The count of the elements to pop from the list.
        Returns:
        Command Response - An array of the popped elements will be returned depending on the list's length.
        If key does not exist, null will be returned.
        See Also:
        valkey.io for details.
      • lrange

        public <ArgType> T lrange​(@NonNull
                                  ArgType key,
                                  long start,
                                  long end)
        Returns the specified elements of the list stored at key.
        The offsets start and end are zero-based indexes, with 0 being the first element of the list, 1 being the next element and so on. These offsets can also be negative numbers indicating offsets starting at the end of the list, with -1 being the last element of the list, -2 being the penultimate, and so on.
        Parameters:
        key - The key of the list.
        start - The starting point of the range.
        end - The end of the range.
        Returns:
        Command Response - Array of elements in the specified range.
        If start exceeds the end of the list, or if start is greater than end, an empty array will be returned.
        If end exceeds the actual end of the list, the range will stop at the actual end of the list.
        If key does not exist an empty array will be returned.
        See Also:
        valkey.io for details.
      • lindex

        public <ArgType> T lindex​(@NonNull
                                  ArgType key,
                                  long index)
        Returns the element at index from the list stored at key.
        The index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here, -1 means the last element, -2 means the penultimate and so forth.
        Parameters:
        key - The key of the list.
        index - The index of the element in the list to retrieve.
        Returns:
        Command Response - The element at index in the list stored at key .
        If index is out of range or if key does not exist, null is returned.
        See Also:
        valkey.io for details.
      • ltrim

        public <ArgType> T ltrim​(@NonNull
                                 ArgType key,
                                 long start,
                                 long end)
        Trims an existing list so that it will contain only the specified range of elements specified.
        The offsets start and end are zero-based indexes, with 0 being the first element of the list, 1 being the next element and so on.
        These offsets can also be negative numbers indicating offsets starting at the end of the list, with -1 being the last element of the list, -2 being the penultimate, and so on.
        Parameters:
        key - The key of the list.
        start - The starting point of the range.
        end - The end of the range.
        Returns:
        Command Response - "OK" response on success.
        If start exceeds the end of the list, or if start is greater than end, the list is emptied and the key is removed.
        If end exceeds the actual end of the list, it will be treated like the last element of the list.
        If key does not exist, OK will be returned without changes to the database.
        See Also:
        valkey.io for details.
      • llen

        public <ArgType> T llen​(@NonNull
                                ArgType key)
        Returns the length of the list stored at key.
        Parameters:
        key - The key of the list.
        Returns:
        Command Response - The length of the list at key.
        If key does not exist, it is interpreted as an empty list and 0 is returned.
        See Also:
        valkey.io for details.
      • lrem

        public <ArgType> T lrem​(@NonNull
                                ArgType key,
                                long count,
                                @NonNull
                                ArgType element)
        Removes the first count occurrences of elements equal to element from the list stored at key.
        Parameters:
        key - The key of the list.
        count - The count of the occurrences of elements equal to element to remove. If count is positive: Removes elements equal to element moving from head to tail.
        If count is negative: Removes elements equal to element moving from tail to head.
        If count is 0 or count is greater than the occurrences of elements equal to element, it removes all elements equal to element .
        element - The element to remove from the list.
        Returns:
        Command Response - The number of the removed elements.
        If key does not exist, 0 is returned.
        See Also:
        valkey.io for details.
      • rpush

        public <ArgType> T rpush​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 @NonNull ArgType[] elements)
        Inserts all the specified values at the tail of the list stored at key.
        elements are inserted one after the other to the tail of the list, from the leftmost element to the rightmost element. If key does not exist, it is created as an empty list before performing the push operations.
        Parameters:
        key - The key of the list.
        elements - The elements to insert at the tail of the list stored at key.
        Returns:
        Command Response - The length of the list after the push operations.
        See Also:
        valkey.io for details.
      • rpop

        public <ArgType> T rpop​(@NonNull
                                ArgType key)
        Removes and returns the last elements of the list stored at key.
        The command pops a single element from the end of the list.
        Parameters:
        key - The key of the list.
        Returns:
        Command Response - The value of the last element.
        If key does not exist, null will be returned.
        See Also:
        valkey.io for details.
      • rpopCount

        public <ArgType> T rpopCount​(@NonNull
                                     ArgType key,
                                     long count)
        Removes and returns up to count elements from the list stored at key, depending on the list's length.
        Parameters:
        count - The count of the elements to pop from the list.
        Returns:
        Command Response - An array of popped elements will be returned depending on the list's length.
        If key does not exist, null will be returned.
        See Also:
        valkey.io for details.
      • sadd

        public <ArgType> T sadd​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull ArgType[] members)
        Adds specified members to the set stored at key. Specified members that are already a member of this set are ignored.
        Parameters:
        key - The key where members will be added to its set.
        members - A list of members to add to the set stored at key.
        Returns:
        Command Response - The number of members that were added to the set, excluding members already present.
        See Also:
        valkey.io for details.
      • sismember

        public <ArgType> T sismember​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     ArgType member)
        Returns if member is a member of the set stored at key.
        Parameters:
        key - The key of the set.
        member - The member to check for existence in the set.
        Returns:
        Command Response - true if the member exists in the set, false otherwise. If key doesn't exist, it is treated as an empty set and the command returns false.
        See Also:
        valkey.io for details.
      • srem

        public <ArgType> T srem​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull ArgType[] members)
        Removes specified members from the set stored at key. Specified members that are not a member of this set are ignored.
        Parameters:
        key - The key from which members will be removed.
        members - A list of members to remove from the set stored at key.
        Returns:
        Command Response - The number of members that were removed from the set, excluding non-existing members.
        See Also:
        valkey.io for details.
      • smembers

        public <ArgType> T smembers​(@NonNull
                                    ArgType key)
        Retrieves all the members of the set value stored at key.
        Parameters:
        key - The key from which to retrieve the set members.
        Returns:
        Command Response - A Set of all members of the set.
        See Also:
        valkey.io for details.
      • scard

        public <ArgType> T scard​(@NonNull
                                 ArgType key)
        Retrieves the set cardinality (number of elements) of the set stored at key.
        Parameters:
        key - The key from which to retrieve the number of set members.
        Returns:
        Command Response - The cardinality (number of elements) of the set, or 0 if the key does not exist.
        See Also:
        valkey.io for details.
      • sdiff

        public <ArgType> T sdiff​(@NonNull
                                 @NonNull ArgType[] keys)
        Computes the difference between the first set and all the successive sets in keys.
        Parameters:
        keys - The keys of the sets to diff.
        Returns:
        Command Response - A Set of elements representing the difference between the sets.
        If the a key does not exist, it is treated as an empty set.
        See Also:
        valkey.io for details.
      • smismember

        public <ArgType> T smismember​(@NonNull
                                      ArgType key,
                                      @NonNull
                                      @NonNull ArgType[] members)
        Checks whether each member is contained in the members of the set stored at key.
        Parameters:
        key - The key of the set to check.
        members - A list of members to check for existence in the set.
        Returns:
        Command Response - An array of Boolean values, each indicating if the respective member exists in the set.
        See Also:
        valkey.io for details.
      • sdiffstore

        public <ArgType> T sdiffstore​(@NonNull
                                      ArgType destination,
                                      @NonNull
                                      @NonNull ArgType[] keys)
        Stores the difference between the first set and all the successive sets in keys into a new set at destination.
        Parameters:
        destination - The key of the destination set.
        keys - The keys of the sets to diff.
        Returns:
        Command Response - The number of elements in the resulting set.
        See Also:
        valkey.io for details.
      • smove

        public <ArgType> T smove​(@NonNull
                                 ArgType source,
                                 @NonNull
                                 ArgType destination,
                                 @NonNull
                                 ArgType member)
        Moves member from the set at source to the set at destination , removing it from the source set. Creates a new destination set if needed. The operation is atomic.
        Parameters:
        source - The key of the set to remove the element from.
        destination - The key of the set to add the element to.
        member - The set element to move.
        Returns:
        Command response - true on success, or false if the source set does not exist or the element is not a member of the source set.
        See Also:
        valkey.io for details.
      • sinter

        public <ArgType> T sinter​(@NonNull
                                  @NonNull ArgType[] keys)
        Gets the intersection of all the given sets.
        Parameters:
        keys - The keys of the sets.
        Returns:
        Command Response - A Set of members which are present in all given sets.
        Missing or empty input sets cause an empty response.
        See Also:
        valkey.io for details.
      • sinterstore

        public <ArgType> T sinterstore​(@NonNull
                                       ArgType destination,
                                       @NonNull
                                       @NonNull ArgType[] keys)
        Stores the members of the intersection of all given sets specified by keys into a new set at destination.
        Parameters:
        destination - The key of the destination set.
        keys - The keys from which to retrieve the set members.
        Returns:
        Command Response - The number of elements in the resulting set.
        See Also:
        valkey.io for details.
      • sintercard

        public <ArgType> T sintercard​(@NonNull
                                      @NonNull ArgType[] keys)
        Gets the cardinality of the intersection of all the given sets.
        Parameters:
        keys - The keys of the sets.
        Returns:
        Command Response - The cardinality of the intersection result. If one or more sets do not exist, 0 is returned.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • sintercard

        public <ArgType> T sintercard​(@NonNull
                                      @NonNull ArgType[] keys,
                                      long limit)
        Gets the cardinality of the intersection of all the given sets.
        Parameters:
        keys - The keys of the sets.
        limit - The limit for the intersection cardinality value.
        Returns:
        Command Response - The cardinality of the intersection result. If one or more sets do not exist, 0 is returned. If the intersection cardinality reaches limit partway through the computation, returns limit as the cardinality.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • sunionstore

        public <ArgType> T sunionstore​(@NonNull
                                       ArgType destination,
                                       @NonNull
                                       @NonNull ArgType[] keys)
        Stores the members of the union of all given sets specified by keys into a new set at destination.
        Parameters:
        destination - The key of the destination set.
        keys - The keys from which to retrieve the set members.
        Returns:
        Command Response - The number of elements in the resulting set.
        See Also:
        valkey.io for details.
      • configGet

        public <ArgType> T configGet​(@NonNull
                                     @NonNull ArgType[] parameters)
        Reads the configuration parameters of the running server.
        Starting from server version 7, command supports multiple parameters.
        Parameters:
        parameters - An array of configuration parameter names to retrieve values for.
        Returns:
        Command response - A map of values corresponding to the configuration parameters.
        See Also:
        valkey.io for details.
      • configSet

        public <ArgType> T configSet​(@NonNull
                                     @NonNull java.util.Map<ArgType,​ArgType> parameters)
        Sets configuration parameters to the specified values.
        Starting from server version 7, command supports multiple parameters.
        Parameters:
        parameters - A map consisting of configuration parameters and their respective values to set.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • exists

        public <ArgType> T exists​(@NonNull
                                  @NonNull ArgType[] keys)
        Returns the number of keys in keys that exist in the database.
        Parameters:
        keys - The keys list to check.
        Returns:
        Command Response - The number of keys that exist. If the same existing key is mentioned in keys multiple times, it will be counted multiple times.
        See Also:
        valkey.io for details.
      • unlink

        public <ArgType> T unlink​(@NonNull
                                  @NonNull ArgType[] keys)
        Unlinks (deletes) multiple keys from the database. A key is ignored if it does not exist. This command, similar to DEL, removes specified keys and ignores non-existent ones. However, this command does not block the server, while DEL does.
        Parameters:
        keys - The list of keys to unlink.
        Returns:
        Command Response - The number of keys that were unlinked.
        See Also:
        valkey.io for details.
      • expire

        public <ArgType> T expire​(@NonNull
                                  ArgType key,
                                  long seconds)
        Sets a timeout on key in seconds. After the timeout has expired, the key will automatically be deleted.
        If key already has an existing expire set, the time to live is updated to the new value.
        If seconds is a non-positive number, the key will be deleted rather than expired.
        The timeout will only be cleared by commands that delete or overwrite the contents of key .
        Parameters:
        key - The key to set timeout on it.
        seconds - The timeout in seconds.
        Returns:
        Command response - true if the timeout was set. false if the timeout was not set. e.g. key doesn't exist.
        See Also:
        valkey.io for details.
      • expire

        public <ArgType> T expire​(@NonNull
                                  ArgType key,
                                  long seconds,
                                  @NonNull
                                  @NonNull ExpireOptions expireOptions)
        Sets a timeout on key in seconds. After the timeout has expired, the key will automatically be deleted.
        If key already has an existing expire set, the time to live is updated to the new value.
        If seconds is a non-positive number, the key will be deleted rather than expired.
        The timeout will only be cleared by commands that delete or overwrite the contents of key .
        Parameters:
        key - The key to set timeout on it.
        seconds - The timeout in seconds.
        expireOptions - The expire options.
        Returns:
        Command response - true if the timeout was set. false if the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
        See Also:
        valkey.io for details.
      • expireAt

        public <ArgType> T expireAt​(@NonNull
                                    ArgType key,
                                    long unixSeconds)
        Sets a timeout on key. It takes an absolute Unix timestamp (seconds since January 1, 1970) instead of specifying the number of seconds.
        A timestamp in the past will delete the key immediately. After the timeout has expired, the key will automatically be deleted.
        If key already has an existing expire set, the time to live is updated to the new value.
        The timeout will only be cleared by commands that delete or overwrite the contents of key .
        Parameters:
        key - The key to set timeout on it.
        unixSeconds - The timeout in an absolute Unix timestamp.
        Returns:
        Command response - true if the timeout was set. false if the timeout was not set. e.g. key doesn't exist.
        See Also:
        valkey.io for details.
      • expireAt

        public <ArgType> T expireAt​(@NonNull
                                    ArgType key,
                                    long unixSeconds,
                                    @NonNull
                                    @NonNull ExpireOptions expireOptions)
        Sets a timeout on key. It takes an absolute Unix timestamp (seconds since January 1, 1970) instead of specifying the number of seconds.
        A timestamp in the past will delete the key immediately. After the timeout has expired, the key will automatically be deleted.
        If key already has an existing expire set, the time to live is updated to the new value.
        The timeout will only be cleared by commands that delete or overwrite the contents of key .
        Parameters:
        key - The key to set timeout on it.
        unixSeconds - The timeout in an absolute Unix timestamp.
        expireOptions - The expire options.
        Returns:
        Command response - true if the timeout was set. false if the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
        See Also:
        valkey.io for details.
      • pexpire

        public <ArgType> T pexpire​(@NonNull
                                   ArgType key,
                                   long milliseconds)
        Sets a timeout on key in milliseconds. After the timeout has expired, the key will automatically be deleted.
        If key already has an existing expire set, the time to live is updated to the new value.
        If milliseconds is a non-positive number, the key will be deleted rather than expired.
        The timeout will only be cleared by commands that delete or overwrite the contents of key .
        Parameters:
        key - The key to set timeout on it.
        milliseconds - The timeout in milliseconds.
        Returns:
        Command response - true if the timeout was set. false if the timeout was not set. e.g. key doesn't exist.
        See Also:
        valkey.io for details.
      • pexpire

        public <ArgType> T pexpire​(@NonNull
                                   ArgType key,
                                   long milliseconds,
                                   @NonNull
                                   @NonNull ExpireOptions expireOptions)
        Sets a timeout on key in milliseconds. After the timeout has expired, the key will automatically be deleted.
        If key already has an existing expire set, the time to live is updated to the new value.
        If milliseconds is a non-positive number, the key will be deleted rather than expired.
        The timeout will only be cleared by commands that delete or overwrite the contents of key .
        Parameters:
        key - The key to set timeout on it.
        milliseconds - The timeout in milliseconds.
        expireOptions - The expire options.
        Returns:
        Command response - true if the timeout was set. false if the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
        See Also:
        valkey.io for details.
      • pexpireAt

        public <ArgType> T pexpireAt​(@NonNull
                                     ArgType key,
                                     long unixMilliseconds)
        Sets a timeout on key. It takes an absolute Unix timestamp (milliseconds since January 1, 1970) instead of specifying the number of milliseconds.
        A timestamp in the past will delete the key immediately. After the timeout has expired, the key will automatically be deleted.
        If key already has an existing expire set, the time to live is updated to the new value.
        The timeout will only be cleared by commands that delete or overwrite the contents of key .
        Parameters:
        key - The key to set timeout on it.
        unixMilliseconds - The timeout in an absolute Unix timestamp.
        Returns:
        Command response - true if the timeout was set. false if the timeout was not set. e.g. key doesn't exist.
        See Also:
        valkey.io for details.
      • pexpireAt

        public <ArgType> T pexpireAt​(@NonNull
                                     ArgType key,
                                     long unixMilliseconds,
                                     @NonNull
                                     @NonNull ExpireOptions expireOptions)
        Sets a timeout on key. It takes an absolute Unix timestamp (milliseconds since January 1, 1970) instead of specifying the number of milliseconds.
        A timestamp in the past will delete the key immediately. After the timeout has expired, the key will automatically be deleted.
        If key already has an existing expire set, the time to live is updated to the new value.
        The timeout will only be cleared by commands that delete or overwrite the contents of key .
        Parameters:
        key - The key to set timeout on it.
        unixMilliseconds - The timeout in an absolute Unix timestamp.
        expireOptions - The expiration option.
        Returns:
        Command response - true if the timeout was set. false if the timeout was not set. e.g. key doesn't exist, or operation skipped due to the provided arguments.
        See Also:
        valkey.io for details.
      • ttl

        public <ArgType> T ttl​(@NonNull
                               ArgType key)
        Returns the remaining time to live of key that has a timeout.
        Parameters:
        key - The key to return its timeout.
        Returns:
        Command response - TTL in seconds, -2 if key does not exist, or -1 if key exists but has no associated expire.
        See Also:
        valkey.io for details.
      • expiretime

        public <ArgType> T expiretime​(@NonNull
                                      ArgType key)
        Returns the absolute Unix timestamp (since January 1, 1970) at which the given key will expire, in seconds.
        To get the expiration with millisecond precision, use #pexpiretime(ArgType).
        Parameters:
        key - The key to determine the expiration value of.
        Returns:
        Command response - The expiration Unix timestamp in seconds, -2 if key does not exist, or -1 if key exists but has no associated expiration.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • pexpiretime

        public <ArgType> T pexpiretime​(@NonNull
                                       ArgType key)
        Returns the absolute Unix timestamp (since January 1, 1970) at which the given key will expire, in milliseconds.
        Parameters:
        key - The key to determine the expiration value of.
        Returns:
        Command response - The expiration Unix timestamp in milliseconds, -2 if key does not exist, or -1 if key exists but has no associated expiration.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • clientId

        public T clientId()
        Gets the current connection id.
        Returns:
        Command response - The id of the client.
        See Also:
        valkey.io for details.
      • clientGetName

        public T clientGetName()
        Gets the name of the current connection.
        Returns:
        Command response - The name of the client connection as a string if a name is set, or null if no name is assigned.
        See Also:
        valkey.io for details.
      • clientPause

        public T clientPause​(long timeout)
        Suspends all clients for the specified timeout.
        Parameters:
        timeout - The time in milliseconds to pause clients.
        Returns:
        Command Response - "OK" on success.
        See Also:
        valkey.io for details.
      • clientPause

        public T clientPause​(long timeout,
                             @NonNull
                             @NonNull ClientPauseMode mode)
        Suspends all clients for the specified timeout.
        Parameters:
        timeout - The time in milliseconds to pause clients.
        mode - The pause mode to use.
        Returns:
        Command Response - "OK" on success.
        See Also:
        valkey.io for details.
      • clientUnpause

        public T clientUnpause()
        Resumes processing commands on all clients.
        Returns:
        Command Response - "OK" on success.
        See Also:
        valkey.io for details.
      • configRewrite

        public T configRewrite()
        Rewrites the configuration file with the current configuration.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • configResetStat

        public T configResetStat()
        Resets the statistics reported by the server using the INFO and LATENCY HISTOGRAM commands.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • zadd

        public <ArgType> T zadd​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull java.util.Map<ArgType,​java.lang.Double> membersScoresMap,
                                @NonNull
                                @NonNull ZAddOptions options,
                                boolean changed)
        Adds members with their scores to the sorted set stored at key.
        If a member is already a part of the sorted set, its score is updated.
        Parameters:
        key - The key of the sorted set.
        membersScoresMap - A Map of members to their corresponding scores.
        options - The ZAdd options.
        changed - Modify the return value from the number of new elements added, to the total number of elements changed.
        Returns:
        Command Response - The number of elements added to the sorted set.
        If changed is set, returns the number of elements updated in the sorted set.
        See Also:
        valkey.io for more details.
      • zadd

        public <ArgType> T zadd​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull java.util.Map<ArgType,​java.lang.Double> membersScoresMap,
                                @NonNull
                                @NonNull ZAddOptions options)
        Adds members with their scores to the sorted set stored at key.
        If a member is already a part of the sorted set, its score is updated.
        Parameters:
        key - The key of the sorted set.
        membersScoresMap - A Map of members to their corresponding scores.
        options - The ZAdd options.
        Returns:
        Command Response - The number of elements added to the sorted set.
        See Also:
        valkey.io for more details.
      • zadd

        public <ArgType> T zadd​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull java.util.Map<ArgType,​java.lang.Double> membersScoresMap,
                                boolean changed)
        Adds members with their scores to the sorted set stored at key.
        If a member is already a part of the sorted set, its score is updated.
        Parameters:
        key - The key of the sorted set.
        membersScoresMap - A Map of members to their corresponding scores.
        changed - Modify the return value from the number of new elements added, to the total number of elements changed.
        Returns:
        Command Response - The number of elements added to the sorted set.
        If changed is set, returns the number of elements updated in the sorted set.
        See Also:
        valkey.io for more details.
      • zadd

        public <ArgType> T zadd​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull java.util.Map<ArgType,​java.lang.Double> membersScoresMap)
        Adds members with their scores to the sorted set stored at key.
        If a member is already a part of the sorted set, its score is updated.
        Parameters:
        key - The key of the sorted set.
        membersScoresMap - A Map of members to their corresponding scores.
        Returns:
        Command Response - The number of elements added to the sorted set.
        See Also:
        valkey.io for more details.
      • zaddIncr

        public <ArgType> T zaddIncr​(@NonNull
                                    ArgType key,
                                    @NonNull
                                    ArgType member,
                                    double increment,
                                    @NonNull
                                    @NonNull ZAddOptions options)
        Increments the score of member in the sorted set stored at key by increment .
        If member does not exist in the sorted set, it is added with increment as its score (as if its previous score was 0.0).
        If key does not exist, a new sorted set with the specified member as its sole member is created.
        zaddIncr with empty option acts as #zincrby(ArgType, double, ArgType).
        Parameters:
        key - The key of the sorted set.
        member - A member in the sorted set to increment.
        increment - The score to increment the member.
        options - The ZAdd options.
        Returns:
        Command Response - The score of the member.
        If there was a conflict with the options, the operation aborts and null is returned.
        See Also:
        valkey.io for more details.
      • zaddIncr

        public <ArgType> T zaddIncr​(@NonNull
                                    ArgType key,
                                    @NonNull
                                    ArgType member,
                                    double increment)
        Increments the score of member in the sorted set stored at key by increment .
        If member does not exist in the sorted set, it is added with increment as its score (as if its previous score was 0.0).
        If key does not exist, a new sorted set with the specified member as its sole member is created.
        Parameters:
        key - The key of the sorted set.
        member - A member in the sorted set to increment.
        increment - The score to increment the member.
        Returns:
        Command Response - The score of the member.
        See Also:
        valkey.io for more details.
      • zrem

        public <ArgType> T zrem​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull ArgType[] members)
        Removes the specified members from the sorted set stored at key.
        Specified members that are not a member of this set are ignored.
        Parameters:
        key - The key of the sorted set.
        members - An array of members to remove from the sorted set.
        Returns:
        Command Response - The number of members that were removed from the sorted set, not including non-existing members.
        If key does not exist, it is treated as an empty sorted set, and this command returns 0.
        See Also:
        valkey.io for more details.
      • zcard

        public <ArgType> T zcard​(@NonNull
                                 ArgType key)
        Returns the cardinality (number of elements) of the sorted set stored at key.
        Parameters:
        key - The key of the sorted set.
        Returns:
        Command Response - The number of elements in the sorted set.
        If key does not exist, it is treated as an empty sorted set, and this command return 0.
        See Also:
        valkey.io for more details.
      • zpopmin

        public <ArgType> T zpopmin​(@NonNull
                                   ArgType key,
                                   long count)
        Removes and returns up to count members with the lowest scores from the sorted set stored at the specified key.
        Parameters:
        key - The key of the sorted set.
        count - Specifies the quantity of members to pop.
        If count is higher than the sorted set's cardinality, returns all members and their scores, ordered from lowest to highest.
        Returns:
        Command Response - A map of the removed members and their scores, ordered from the one with the lowest score to the one with the highest.
        If key doesn't exist, it will be treated as an empty sorted set and the command returns an empty Map.
        See Also:
        valkey.io for more details.
      • zpopmin

        public <ArgType> T zpopmin​(@NonNull
                                   ArgType key)
        Removes and returns the member with the lowest score from the sorted set stored at the specified key.
        Parameters:
        key - The key of the sorted set.
        Returns:
        Command Response - A map containing the removed member and its corresponding score.
        If key doesn't exist, it will be treated as an empty sorted set and the command returns an empty Map.
        See Also:
        valkey.io for more details.
      • zrandmember

        public <ArgType> T zrandmember​(@NonNull
                                       ArgType key)
        Returns a random element from the sorted set stored at key.
        Parameters:
        key - The key of the sorted set.
        Returns:
        Command Response - A String representing a random element from the sorted set.
        If the sorted set does not exist or is empty, the response will be null.
        See Also:
        valkey.io for more details.
      • zrandmemberWithCount

        public <ArgType> T zrandmemberWithCount​(@NonNull
                                                ArgType key,
                                                long count)
        Retrieves random elements from the sorted set stored at key.
        Parameters:
        key - The key of the sorted set.
        count - The number of elements to return.
        If count is positive, returns unique elements.
        If negative, allows for duplicates.
        Returns:
        Command Response - An array of elements from the sorted set.
        If the sorted set does not exist or is empty, the response will be an empty array .
        See Also:
        valkey.io for more details.
      • zrandmemberWithCountWithScores

        public <ArgType> T zrandmemberWithCountWithScores​(ArgType key,
                                                          long count)
        Retrieves random elements along with their scores from the sorted set stored at key .
        Parameters:
        key - The key of the sorted set.
        count - The number of elements to return.
        If count is positive, returns unique elements.
        If negative, allows duplicates.
        Returns:
        Command Response - An array of [element, score] arrays , where element is a String and score is a Double.
        If the sorted set does not exist or is empty, the response will be an empty array .
        See Also:
        valkey.io for more details.
      • zincrby

        public <ArgType> T zincrby​(@NonNull
                                   ArgType key,
                                   double increment,
                                   @NonNull
                                   ArgType member)
        Increments the score of member in the sorted set stored at key by increment.
        If member does not exist in the sorted set, it is added with increment as its score. If key does not exist, a new sorted set with the specified member as its sole member is created.
        Parameters:
        key - The key of the sorted set.
        increment - The score increment.
        member - A member of the sorted set.
        Returns:
        Command Response - The new score of member.
        See Also:
        valkey.io for more details.
      • bzpopmin

        public <ArgType> T bzpopmin​(@NonNull
                                    @NonNull ArgType[] keys,
                                    double timeout)
        Blocks the connection until it removes and returns a member with the lowest score from the sorted sets stored at the specified keys. The sorted sets are checked in the order they are provided.
        BZPOPMIN is the blocking variant of #zpopmin(ArgType).
        Parameters:
        keys - The keys of the sorted sets.
        timeout - The number of seconds to wait for a blocking operation to complete. A value of 0 will block indefinitely.
        Returns:
        Command Response - An array containing the key where the member was popped out, the member itself, and the member score.
        If no member could be popped and the timeout expired, returns null .
        See Also:
        valkey.io for more details.
      • zpopmax

        public <ArgType> T zpopmax​(@NonNull
                                   ArgType key,
                                   long count)
        Removes and returns up to count members with the highest scores from the sorted set stored at the specified key.
        Parameters:
        key - The key of the sorted set.
        count - Specifies the quantity of members to pop.
        If count is higher than the sorted set's cardinality, returns all members and their scores, ordered from highest to lowest.
        Returns:
        Command Response - A map of the removed members and their scores, ordered from the one with the highest score to the one with the lowest.
        If key doesn't exist, it will be treated as an empty sorted set and the command returns an empty Map.
        See Also:
        valkey.io for more details.
      • zpopmax

        public <ArgType> T zpopmax​(@NonNull
                                   ArgType key)
        Removes and returns the member with the highest score from the sorted set stored at the specified key.
        Parameters:
        key - The key of the sorted set.
        Returns:
        Command Response - A map containing the removed member and its corresponding score.
        If key doesn't exist, it will be treated as an empty sorted set and the command returns an empty Map.
        See Also:
        valkey.io for more details.
      • bzpopmax

        public <ArgType> T bzpopmax​(@NonNull
                                    @NonNull ArgType[] keys,
                                    double timeout)
        Blocks the connection until it removes and returns a member with the highest score from the sorted sets stored at the specified keys. The sorted sets are checked in the order they are provided.
        BZPOPMAX is the blocking variant of #zpopmax(ArgType).
        Parameters:
        keys - The keys of the sorted sets.
        timeout - The number of seconds to wait for a blocking operation to complete. A value of 0 will block indefinitely.
        Returns:
        Command Response - An array containing the key where the member was popped out, the member itself, and the member score.
        If no member could be popped and the timeout expired, returns null .
        See Also:
        valkey.io for more details.
      • zscore

        public <ArgType> T zscore​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  ArgType member)
        Returns the score of member in the sorted set stored at key.
        Parameters:
        key - The key of the sorted set.
        member - The member whose score is to be retrieved.
        Returns:
        Command Response - The score of the member.
        If member does not exist in the sorted set, null is returned.
        If key does not exist, null is returned.
        See Also:
        valkey.io for more details.
      • zrank

        public <ArgType> T zrank​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 ArgType member)
        Returns the rank of member in the sorted set stored at key, with scores ordered from low to high, starting from 0.
        To get the rank of member with its score, see zrankWithScore(ArgType, ArgType).
        Parameters:
        key - The key of the sorted set.
        member - The member whose rank is to be retrieved.
        Returns:
        Command Response - The rank of member in the sorted set.
        If key doesn't exist, or if member is not present in the set, null will be returned.
        See Also:
        valkey.io for more details.
      • zrankWithScore

        public <ArgType> T zrankWithScore​(@NonNull
                                          ArgType key,
                                          @NonNull
                                          ArgType member)
        Returns the rank of member in the sorted set stored at key with its score, where scores are ordered from the lowest to highest, starting from 0.
        Parameters:
        key - The key of the sorted set.
        member - The member whose rank is to be retrieved.
        Returns:
        Command Response - An array containing the rank (as Long) and score (as Double) of member in the sorted set.
        If key doesn't exist, or if member is not present in the set, null will be returned.
        Since:
        Valkey 7.2.0 and above.
        See Also:
        valkey.io for more details.
      • zrevrank

        public <ArgType> T zrevrank​(@NonNull
                                    ArgType key,
                                    @NonNull
                                    ArgType member)
        Returns the rank of member in the sorted set stored at key, where scores are ordered from the highest to lowest, starting from 0.
        To get the rank of member with its score, see zrevrankWithScore(ArgType, ArgType).
        Parameters:
        key - The key of the sorted set.
        member - The member whose rank is to be retrieved.
        Returns:
        Command Response - The rank of member in the sorted set, where ranks are ordered from high to low based on scores.
        If key doesn't exist, or if member is not present in the set, null will be returned.
        See Also:
        valkey.io for more details.
      • zrevrankWithScore

        public <ArgType> T zrevrankWithScore​(@NonNull
                                             ArgType key,
                                             @NonNull
                                             ArgType member)
        Returns the rank of member in the sorted set stored at key with its score, where scores are ordered from the highest to lowest, starting from 0.
        Parameters:
        key - The key of the sorted set.
        member - The member whose rank is to be retrieved.
        Returns:
        Command Response - An array containing the rank (as Long) and score (as Double) of member in the sorted set, where ranks are ordered from high to low based on scores.
        If key doesn't exist, or if member is not present in the set, null will be returned.
        Since:
        Valkey 7.2.0 and above.
        See Also:
        valkey.io for more details.
      • zmscore

        public <ArgType> T zmscore​(@NonNull
                                   ArgType key,
                                   @NonNull
                                   @NonNull ArgType[] members)
        Returns the scores associated with the specified members in the sorted set stored at key.
        Parameters:
        key - The key of the sorted set.
        members - An array of members in the sorted set.
        Returns:
        Command Response - An Array of scores of the members.
        If a member does not exist, the corresponding value in the Array will be null.
        See Also:
        valkey.io for more details.
      • zdiff

        public <ArgType> T zdiff​(@NonNull
                                 @NonNull ArgType[] keys)
        Returns the difference between the first sorted set and all the successive sorted sets.
        To get the elements with their scores, see zdiffWithScores(ArgType[]).
        Parameters:
        keys - The keys of the sorted sets.
        Returns:
        Command Response - An array of elements representing the difference between the sorted sets.
        If the first key does not exist, it is treated as an empty sorted set, and the command returns an empty array.
        Since:
        Valkey 6.2 and above.
        See Also:
        valkey.io for more details.
      • zdiffWithScores

        public <ArgType> T zdiffWithScores​(@NonNull
                                           @NonNull ArgType[] keys)
        Returns the difference between the first sorted set and all the successive sorted sets.
        Parameters:
        keys - The keys of the sorted sets.
        Returns:
        Command Response - A Map of elements and their scores representing the difference between the sorted sets.
        If the first key does not exist, it is treated as an empty sorted set, and the command returns an empty Map.
        Since:
        Valkey 6.2 and above.
        See Also:
        valkey.io for more details.
      • zdiffstore

        public <ArgType> T zdiffstore​(@NonNull
                                      ArgType destination,
                                      @NonNull
                                      @NonNull ArgType[] keys)
        Calculates the difference between the first sorted set and all the successive sorted sets at keys and stores the difference as a sorted set to destination, overwriting it if it already exists. Non-existent keys are treated as empty sets.
        Parameters:
        destination - The key for the resulting sorted set.
        keys - The keys of the sorted sets to compare.
        Returns:
        Command Response - The number of members in the resulting sorted set stored at destination.
        Since:
        Valkey 6.2 and above.
        See Also:
        valkey.io for more details.
      • zcount

        public <ArgType> T zcount​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  @NonNull RangeOptions.ScoreRange minScore,
                                  @NonNull
                                  @NonNull RangeOptions.ScoreRange maxScore)
        Returns the number of members in the sorted set stored at key with scores between minScore and maxScore.
        Parameters:
        key - The key of the sorted set.
        minScore - The minimum score to count from. Can be an implementation of RangeOptions.InfScoreBound representing positive/negative infinity, or RangeOptions.ScoreBoundary representing a specific score and inclusivity.
        maxScore - The maximum score to count up to. Can be an implementation of RangeOptions.InfScoreBound representing positive/negative infinity, or RangeOptions.ScoreBoundary representing a specific score and inclusivity.
        Returns:
        Command Response - The number of members in the specified score range.
        If key does not exist, it is treated as an empty sorted set, and the command returns 0.
        If maxScore < minScore, 0 is returned.
        See Also:
        valkey.io for more details.
      • zremrangebyrank

        public <ArgType> T zremrangebyrank​(@NonNull
                                           ArgType key,
                                           long start,
                                           long end)
        Removes all elements in the sorted set stored at key with rank between start and end. Both start and end are zero-based indexes with 0 being the element with the lowest score. These indexes can be negative numbers, where they indicate offsets starting at the element with the highest score.
        Parameters:
        key - The key of the sorted set.
        start - The starting point of the range.
        end - The end of the range.
        Returns:
        Command Response - The number of elements removed.
        If start exceeds the end of the sorted set, or if start is greater than end, 0 returned.
        If end exceeds the actual end of the sorted set, the range will stop at the actual end of the sorted set.
        If key does not exist 0 will be returned.
        See Also:
        valkey.io for more details.
      • zrangestore

        public <ArgType> T zrangestore​(@NonNull
                                       ArgType destination,
                                       @NonNull
                                       ArgType source,
                                       @NonNull
                                       @NonNull RangeOptions.RangeQuery rangeQuery,
                                       boolean reverse)
        Stores a specified range of elements from the sorted set at source, into a new sorted set at destination. If destination doesn't exist, a new sorted set is created; if it exists, it's overwritten.
        Parameters:
        destination - The key for the destination sorted set.
        source - The key of the source sorted set.
        rangeQuery - The range query object representing the type of range query to perform.
        reverse - If true, reverses the sorted set, with index 0 as the element with the highest score.
        Returns:
        Command Response - The number of elements in the resulting sorted set.
        See Also:
        valkey.io for more details.
      • zrangestore

        public <ArgType> T zrangestore​(@NonNull
                                       ArgType destination,
                                       @NonNull
                                       ArgType source,
                                       @NonNull
                                       @NonNull RangeOptions.RangeQuery rangeQuery)
        Stores a specified range of elements from the sorted set at source, into a new sorted set at destination. If destination doesn't exist, a new sorted set is created; if it exists, it's overwritten.
        Parameters:
        destination - The key for the destination sorted set.
        source - The key of the source sorted set.
        rangeQuery - The range query object representing the type of range query to perform.
        Returns:
        Command Response - The number of elements in the resulting sorted set.
        See Also:
        valkey.io for more details.
      • zremrangebylex

        public <ArgType> T zremrangebylex​(@NonNull
                                          ArgType key,
                                          @NonNull
                                          @NonNull RangeOptions.LexRange minLex,
                                          @NonNull
                                          @NonNull RangeOptions.LexRange maxLex)
        Removes all elements in the sorted set stored at key with a lexicographical order between minLex and maxLex.
        Parameters:
        key - The key of the sorted set.
        minLex - The minimum bound of the lexicographical range. Can be an implementation of RangeOptions.InfLexBound representing positive/negative infinity, or RangeOptions.LexBoundary representing a specific lex and inclusivity.
        maxLex - The maximum bound of the lexicographical range. Can be an implementation of RangeOptions.InfLexBound representing positive/negative infinity, or RangeOptions.LexBoundary representing a specific lex and inclusivity.
        Returns:
        Command Response - The number of members removed from the sorted set.
        If key does not exist, it is treated as an empty sorted set, and the command returns 0.
        If minLex is greater than maxLex, 0 is returned.
        See Also:
        valkey.io for more details.
      • zremrangebyscore

        public <ArgType> T zremrangebyscore​(@NonNull
                                            ArgType key,
                                            @NonNull
                                            @NonNull RangeOptions.ScoreRange minScore,
                                            @NonNull
                                            @NonNull RangeOptions.ScoreRange maxScore)
        Removes all elements in the sorted set stored at key with a score between minScore and maxScore.
        Parameters:
        key - The key of the sorted set.
        minScore - The minimum score to remove from. Can be an implementation of RangeOptions.InfScoreBound representing positive/negative infinity, or RangeOptions.ScoreBoundary representing a specific score and inclusivity.
        maxScore - The maximum score to remove to. Can be an implementation of RangeOptions.InfScoreBound representing positive/negative infinity, or RangeOptions.ScoreBoundary representing a specific score and inclusivity.
        Returns:
        Command Response - The number of members removed.
        If key does not exist, it is treated as an empty sorted set, and the command returns 0.
        If minScore is greater than maxScore, 0 is returned.
        See Also:
        valkey.io for more details.
      • zlexcount

        public <ArgType> T zlexcount​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     @NonNull RangeOptions.LexRange minLex,
                                     @NonNull
                                     @NonNull RangeOptions.LexRange maxLex)
        Returns the number of members in the sorted set stored at key with scores between minLex and maxLex.
        Parameters:
        key - The key of the sorted set.
        minLex - The minimum lex to count from. Can be an implementation of RangeOptions.InfLexBound representing positive/negative infinity, or RangeOptions.LexBoundary representing a specific lex and inclusivity.
        maxLex - The maximum lex to count up to. Can be an implementation of RangeOptions.InfLexBound representing positive/negative infinity, or RangeOptions.LexBoundary representing a specific lex and inclusivity.
        Returns:
        Command Response - The number of members in the specified lex range.
        If key does not exist, it is treated as an empty sorted set, and the command returns 0.
        If maxLex < minLex, 0 is returned.
        See Also:
        valkey.io for more details.
      • zunionstore

        public T zunionstore​(@NonNull
                             @NonNull java.lang.String destination,
                             @NonNull
                             @NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys,
                             @NonNull
                             @NonNull WeightAggregateOptions.Aggregate aggregate)
        Computes the union of sorted sets given by the specified KeysOrWeightedKeys, and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created.
        Parameters:
        destination - The key of the destination sorted set.
        keysOrWeightedKeys - The keys of the sorted sets with possible formats:
        aggregate - Specifies the aggregation strategy to apply when combining the scores of elements.
        Returns:
        Command Response - The number of elements in the resulting sorted set stored at destination.
        See Also:
        valkey.io for more details.
      • zunionstore

        public T zunionstore​(@NonNull
                             @NonNull GlideString destination,
                             @NonNull
                             @NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys,
                             @NonNull
                             @NonNull WeightAggregateOptions.Aggregate aggregate)
        Computes the union of sorted sets given by the specified KeysOrWeightedKeys, and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created.
        Parameters:
        destination - The key of the destination sorted set.
        keysOrWeightedKeys - The keys of the sorted sets with possible formats:
        aggregate - Specifies the aggregation strategy to apply when combining the scores of elements.
        Returns:
        Command Response - The number of elements in the resulting sorted set stored at destination.
        See Also:
        valkey.io for more details.
      • zunionstore

        public T zunionstore​(@NonNull
                             @NonNull java.lang.String destination,
                             @NonNull
                             @NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys)
        Computes the union of sorted sets given by the specified KeysOrWeightedKeys, and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created.
        Parameters:
        destination - The key of the destination sorted set.
        keysOrWeightedKeys - The keys of the sorted sets with possible formats:
        Returns:
        Command Response - The number of elements in the resulting sorted set stored at destination.
        See Also:
        valkey.io for more details.
      • zunionstore

        public T zunionstore​(@NonNull
                             @NonNull GlideString destination,
                             @NonNull
                             @NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys)
        Computes the union of sorted sets given by the specified KeysOrWeightedKeys, and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created.
        Parameters:
        destination - The key of the destination sorted set.
        keysOrWeightedKeys - The keys of the sorted sets with possible formats:
        Returns:
        Command Response - The number of elements in the resulting sorted set stored at destination.
        See Also:
        valkey.io for more details.
      • zinterstore

        public T zinterstore​(@NonNull
                             @NonNull java.lang.String destination,
                             @NonNull
                             @NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys,
                             @NonNull
                             @NonNull WeightAggregateOptions.Aggregate aggregate)
        Computes the intersection of sorted sets given by the specified keysOrWeightedKeys , and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created.
        Parameters:
        destination - The key of the destination sorted set.
        keysOrWeightedKeys - The keys of the sorted sets with possible formats:
        aggregate - Specifies the aggregation strategy to apply when combining the scores of elements.
        Returns:
        Command Response - The number of elements in the resulting sorted set stored at destination.
        See Also:
        valkey.io for more details.
      • zinterstore

        public T zinterstore​(@NonNull
                             @NonNull GlideString destination,
                             @NonNull
                             @NonNull WeightAggregateOptions.KeysOrWeightedKeysBinary keysOrWeightedKeys,
                             @NonNull
                             @NonNull WeightAggregateOptions.Aggregate aggregate)
        Computes the intersection of sorted sets given by the specified keysOrWeightedKeys , and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created.
        Parameters:
        destination - The key of the destination sorted set.
        keysOrWeightedKeys - The keys of the sorted sets with possible formats:
        aggregate - Specifies the aggregation strategy to apply when combining the scores of elements.
        Returns:
        Command Response - The number of elements in the resulting sorted set stored at destination.
        See Also:
        valkey.io for more details.
      • zintercard

        public <ArgType> T zintercard​(@NonNull
                                      @NonNull ArgType[] keys)
        Returns the cardinality of the intersection of the sorted sets specified by keys.
        Parameters:
        keys - The keys of the sorted sets to intersect.
        Returns:
        Command Response - The cardinality of the intersection of the given sorted sets.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for more details.
      • zintercard

        public <ArgType> T zintercard​(@NonNull
                                      @NonNull ArgType[] keys,
                                      long limit)
        Returns the cardinality of the intersection of the sorted sets specified by keys. If the intersection cardinality reaches limit partway through the computation, the algorithm will exit early and yield limit as the cardinality.
        Parameters:
        keys - The keys of the sorted sets to intersect.
        limit - Specifies a maximum number for the intersection cardinality. If limit is set to 0 the range will be unlimited.
        Returns:
        Command Response - The cardinality of the intersection of the given sorted sets, or the limit if reached.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for more details.
      • zinterstore

        public T zinterstore​(@NonNull
                             @NonNull java.lang.String destination,
                             @NonNull
                             @NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys)
        Computes the intersection of sorted sets given by the specified KeysOrWeightedKeys , and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created.
        To perform a zinterstore operation while specifying aggregation settings, use zinterstore(String, KeysOrWeightedKeys, Aggregate).
        Parameters:
        destination - The key of the destination sorted set.
        keysOrWeightedKeys - The keys of the sorted sets with possible formats:
        Returns:
        Command Response - The number of elements in the resulting sorted set stored at destination.
        See Also:
        valkey.io for more details.
      • zunionWithScores

        public T zunionWithScores​(@NonNull
                                  @NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys,
                                  @NonNull
                                  @NonNull WeightAggregateOptions.Aggregate aggregate)
        Returns the union of members and their scores from sorted sets specified by the given keysOrWeightedKeys.
        Parameters:
        keysOrWeightedKeys - The keys of the sorted sets with possible formats:
        aggregate - Specifies the aggregation strategy to apply when combining the scores of elements.
        Returns:
        Command Response - The resulting sorted set from the union.
        Since:
        Valkey 6.2 and above.
        See Also:
        valkey.io for more details.
      • zinterWithScores

        public T zinterWithScores​(@NonNull
                                  @NonNull WeightAggregateOptions.KeysOrWeightedKeys keysOrWeightedKeys,
                                  @NonNull
                                  @NonNull WeightAggregateOptions.Aggregate aggregate)
        Returns the intersection of members and their scores from sorted sets specified by the given keysOrWeightedKeys.
        Parameters:
        keysOrWeightedKeys - The keys of the sorted sets with possible formats:
        aggregate - Specifies the aggregation strategy to apply when combining the scores of elements.
        Returns:
        Command Response - The resulting sorted set from the intersection.
        Since:
        Valkey 6.2 and above.
        See Also:
        valkey.io for more details.
      • xadd

        public <ArgType> T xadd​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull java.util.Map<ArgType,​ArgType> values)
        Adds an entry to the specified stream stored at key.
        If the key doesn't exist, the stream is created. To add entries with duplicate keys, use #xadd(ArgType, ArgType[][]).
        Parameters:
        key - The key of the stream.
        values - Field-value pairs to be added to the entry.
        Returns:
        Command Response - The id of the added entry.
        See Also:
        valkey.io for details.
      • xadd

        public <ArgType> T xadd​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull ArgType[][] values)
        Adds an entry to the specified stream stored at key.
        If the key doesn't exist, the stream is created. This method overload allows entries with duplicate keys to be added.
        Parameters:
        key - The key of the stream.
        values - Field-value pairs to be added to the entry.
        Returns:
        Command Response - The id of the added entry.
        See Also:
        valkey.io for details.
      • xadd

        public <ArgType> T xadd​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull java.util.Map<ArgType,​ArgType> values,
                                @NonNull
                                @NonNull StreamAddOptions options)
        Adds an entry to the specified stream stored at key.
        If the key doesn't exist, the stream is created. To add entries with duplicate keys, use #xadd(ArgType, ArgType[][], StreamAddOptions).
        Parameters:
        key - The key of the stream.
        values - Field-value pairs to be added to the entry.
        options - Stream add options StreamAddOptions.
        Returns:
        Command Response - The id of the added entry, or null if StreamAddOptions.StreamAddOptionsBuilder.makeStream(Boolean) is set to false and no stream with the matching key exists.
        See Also:
        valkey.io for details.
      • xadd

        public <ArgType> T xadd​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull ArgType[][] values,
                                @NonNull
                                @NonNull StreamAddOptions options)
        Adds an entry to the specified stream stored at key.
        If the key doesn't exist, the stream is created. This method overload allows entries with duplicate keys to be added.
        Parameters:
        key - The key of the stream.
        values - Field-value pairs to be added to the entry.
        options - Stream add options StreamAddOptions.
        Returns:
        Command Response - The id of the added entry, or null if StreamAddOptions.StreamAddOptionsBuilder.makeStream(Boolean) is set to false and no stream with the matching key exists.
        See Also:
        valkey.io for details.
      • xread

        public <ArgType> T xread​(@NonNull
                                 @NonNull java.util.Map<ArgType,​ArgType> keysAndIds)
        Reads entries from the given streams.
        Parameters:
        keysAndIds - A Map of keys and entry IDs to read from.
        Returns:
        Command Response - A Map<String, Map<String, String[][]>> with stream keys, to Map of stream entry IDs, to an array of pairings with format [[field, entry], [field, entry], ...].
        See Also:
        valkey.io for details.
      • xread

        public <ArgType> T xread​(@NonNull
                                 @NonNull java.util.Map<ArgType,​ArgType> keysAndIds,
                                 @NonNull
                                 @NonNull StreamReadOptions options)
        Reads entries from the given streams.
        Parameters:
        keysAndIds - A Map of keys and entry IDs to read from.
        options - options detailing how to read the stream StreamReadOptions.
        Returns:
        Command Response - A Map<String, Map<String, String[][]>> with stream keys, to Map of stream entry IDs, to an array of pairings with format [[field, entry], [field, entry], ...]. Returns null if all key-ID pairs in keys_and_ids have either a non-existing key or a non-existing ID, or there are no entries after the given ID, or a timeout is hit in the block option.
        See Also:
        valkey.io for details.
      • xtrim

        public <ArgType> T xtrim​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 @NonNull StreamTrimOptions options)
        Trims the stream by evicting older entries.
        Parameters:
        key - The key of the stream.
        options - Stream trim options StreamTrimOptions.
        Returns:
        Command Response - The number of entries deleted from the stream.
        See Also:
        valkey.io for details.
      • xlen

        public <ArgType> T xlen​(@NonNull
                                ArgType key)
        Returns the number of entries in the stream stored at key.
        Parameters:
        key - The key of the stream.
        Returns:
        Command Response - The number of entries in the stream. If key does not exist, return 0.
        See Also:
        valkey.io for details.
      • xdel

        public <ArgType> T xdel​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull ArgType[] ids)
        Removes the specified entries by id from a stream, and returns the number of entries deleted.
        Parameters:
        key - The key of the stream.
        ids - An array of entry ids.
        Returns:
        Command Response - The number of entries removed from the stream. This number may be less than the number of entries in ids, if the specified ids don't exist in the stream.
        See Also:
        valkey.io for details.
      • xrevrange

        public <ArgType> T xrevrange​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     @NonNull StreamRange end,
                                     @NonNull
                                     @NonNull StreamRange start,
                                     long count)
        Returns stream entries matching a given range of IDs in reverse order.
        Equivalent to #xrange(ArgType, StreamRange, StreamRange, long) but returns the entries in reverse order.
        Parameters:
        key - The key of the stream.
        start - Starting stream entry IDs bound for range.
        end - Ending stream entry IDs bound for range.
        count - Maximum count of stream entries to return.
        Returns:
        Command Response - A Map of key to stream entry data, where entry data is an array of pairings with format [[field, entry], [field, entry], ...]. Returns or null if count is non-positive.
        See Also:
        valkey.io for details.
      • xgroupCreate

        public <ArgType> T xgroupCreate​(@NonNull
                                        ArgType key,
                                        @NonNull
                                        ArgType groupName,
                                        @NonNull
                                        ArgType id)
        Creates a new consumer group uniquely identified by groupname for the stream stored at key.
        Parameters:
        key - The key of the stream.
        groupName - The newly created consumer group name.
        id - Stream entry ID that specifies the last delivered entry in the stream from the new group's perspective. The special ID "$" can be used to specify the last entry in the stream.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • xgroupCreate

        public <ArgType> T xgroupCreate​(@NonNull
                                        ArgType key,
                                        @NonNull
                                        ArgType groupName,
                                        @NonNull
                                        ArgType id,
                                        @NonNull
                                        @NonNull StreamGroupOptions options)
        Creates a new consumer group uniquely identified by groupname for the stream stored at key.
        Parameters:
        key - The key of the stream.
        groupName - The newly created consumer group name.
        id - Stream entry ID that specifies the last delivered entry in the stream from the new group's perspective. The special ID "$" can be used to specify the last entry in the stream.
        options - The group options StreamGroupOptions.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • xgroupDestroy

        public <ArgType> T xgroupDestroy​(@NonNull
                                         ArgType key,
                                         @NonNull
                                         ArgType groupName)
        Destroys the consumer group groupName for the stream stored at key.
        Parameters:
        key - The key of the stream.
        groupName - The newly created consumer group name.
        Returns:
        Command Response - true if the consumer group is destroyed. Otherwise, false.
        See Also:
        valkey.io for details.
      • xgroupCreateConsumer

        public <ArgType> T xgroupCreateConsumer​(@NonNull
                                                ArgType key,
                                                @NonNull
                                                ArgType group,
                                                @NonNull
                                                ArgType consumer)
        Creates a consumer named consumer in the consumer group group for the stream stored at key.
        Parameters:
        key - The key of the stream.
        group - The consumer group name.
        consumer - The newly created consumer.
        Returns:
        Command Response - true if the consumer is created. Otherwise, false .
        See Also:
        valkey.io for details.
      • xgroupDelConsumer

        public <ArgType> T xgroupDelConsumer​(@NonNull
                                             ArgType key,
                                             @NonNull
                                             ArgType group,
                                             @NonNull
                                             ArgType consumer)
        Deletes a consumer named consumer in the consumer group group.
        Parameters:
        key - The key of the stream.
        group - The consumer group name.
        consumer - The newly created consumer.
        Returns:
        Command Response - The number of pending messages the consumer had before it was deleted.
        See Also:
        valkey.io for details.
      • xgroupSetId

        public <ArgType> T xgroupSetId​(@NonNull
                                       ArgType key,
                                       @NonNull
                                       ArgType groupName,
                                       @NonNull
                                       ArgType id)
        Sets the last delivered ID for a consumer group.
        Parameters:
        key - The key of the stream.
        groupName - The consumer group name.
        id - The stream entry ID that should be set as the last delivered ID for the consumer group.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • xgroupSetId

        public <ArgType> T xgroupSetId​(@NonNull
                                       ArgType key,
                                       @NonNull
                                       ArgType groupName,
                                       @NonNull
                                       ArgType id,
                                       long entriesRead)
        Sets the last delivered ID for a consumer group.
        Parameters:
        key - The key of the stream.
        groupName - The consumer group name.
        id - The stream entry ID that should be set as the last delivered ID for the consumer group.
        entriesRead - A value representing the number of stream entries already read by the group.
        Returns:
        Command Response - "OK" response on success.
        Since:
        Valkey 7.0 and above
        See Also:
        valkey.io for details.
      • xreadgroup

        public <ArgType> T xreadgroup​(@NonNull
                                      @NonNull java.util.Map<ArgType,​ArgType> keysAndIds,
                                      @NonNull
                                      ArgType group,
                                      @NonNull
                                      ArgType consumer)
        Reads entries from the given streams owned by a consumer group.
        Parameters:
        keysAndIds - A Map of keys and entry IDs to read from.
        Use the special ID of ">" to receive only new messages.
        group - The consumer group name.
        consumer - The newly created consumer.
        Returns:
        Command Response - A Map<String, Map<String, String[][]>> with stream keys, to Map of stream entry IDs, to an array of pairings with format [[field, entry], [field, entry], ...]. Returns null if there is no stream that can be served.
        See Also:
        valkey.io for details.
      • xreadgroup

        public <ArgType> T xreadgroup​(@NonNull
                                      @NonNull java.util.Map<ArgType,​ArgType> keysAndIds,
                                      @NonNull
                                      ArgType group,
                                      @NonNull
                                      ArgType consumer,
                                      @NonNull
                                      @NonNull StreamReadGroupOptions options)
        Reads entries from the given streams owned by a consumer group.
        Parameters:
        keysAndIds - A Map of keys and entry IDs to read from.
        Use the special ID of ">" to receive only new messages.
        group - The consumer group name.
        consumer - The newly created consumer.
        options - Options detailing how to read the stream StreamReadGroupOptions.
        Returns:
        Command Response - A Map<String, Map<String, String[][]>> with stream keys, to Map of stream entry IDs, to an array of pairings with format [[field, entry], [field, entry], ...]. Returns null if there is no stream that can be served.
        See Also:
        valkey.io for details.
      • xack

        public <ArgType> T xack​(@NonNull
                                ArgType key,
                                @NonNull
                                ArgType group,
                                @NonNull
                                @NonNull ArgType[] ids)
        Returns the number of messages that were successfully acknowledged by the consumer group member of a stream. This command should be called on a pending message so that such message does not get processed again.
        Parameters:
        key - The key of the stream.
        group - The consumer group name.
        ids - Stream entry ID to acknowledge and purge messages.
        Returns:
        Command Response - The number of messages that were successfully acknowledged.
      • xpending

        public <ArgType> T xpending​(@NonNull
                                    ArgType key,
                                    @NonNull
                                    ArgType group)
        Returns stream message summary information for pending messages matching a given range of IDs.
        Parameters:
        key - The key of the stream.
        group - The consumer group name.
        Returns:
        Command Response - A 2D-array that includes the summary of pending messages, with the format [NumOfMessages, StartId, EndId, [[Consumer, NumOfMessages], ...], where:
        • NumOfMessages: The total number of pending messages for this consumer group.
        • StartId: The smallest ID among the pending messages.
        • EndId: The greatest ID among the pending messages.
        • [[Consumer, NumOfMessages], ...]: A 2D-array of every consumer in the consumer group with at least one pending message, and the number of pending messages it has.
        See Also:
        valkey.io for details.
      • xpending

        public <ArgType> T xpending​(@NonNull
                                    ArgType key,
                                    @NonNull
                                    ArgType group,
                                    @NonNull
                                    @NonNull StreamRange start,
                                    @NonNull
                                    @NonNull StreamRange end,
                                    long count)
        Returns an extended form of stream message information for pending messages matching a given range of IDs.
        Parameters:
        key - The key of the stream.
        group - The consumer group name.
        start - Starting stream entry IDs bound for range.
        end - Ending stream entry IDs bound for range.
        count - Limits the number of messages returned.
        Returns:
        Command Response - A 2D-array of 4-tuples containing extended message information with the format [[ID, Consumer, TimeElapsed, NumOfDelivered], ... ] , where:
        • ID: The ID of the message.
        • Consumer: The name of the consumer that fetched the message and has still to acknowledge it. We call it the current owner of the message.
        • TimeElapsed: The number of milliseconds that elapsed since the last time this message was delivered to this consumer.
        • NumOfDelivered: The number of times this message was delivered.
        See Also:
        valkey.io for details.
      • xpending

        public <ArgType> T xpending​(@NonNull
                                    ArgType key,
                                    @NonNull
                                    ArgType group,
                                    @NonNull
                                    @NonNull StreamRange start,
                                    @NonNull
                                    @NonNull StreamRange end,
                                    long count,
                                    @NonNull
                                    @NonNull StreamPendingOptions options)
        Returns an extended form of stream message information for pending messages matching a given range of IDs.
        Parameters:
        key - The key of the stream.
        group - The consumer group name.
        start - Starting stream entry IDs bound for range.
        end - Ending stream entry IDs bound for range.
        count - Limits the number of messages returned.
        options - Stream add options StreamPendingOptions.
        Returns:
        Command Response - A 2D-array of 4-tuples containing extended message information with the format [[ID, Consumer, TimeElapsed, NumOfDelivered], ... ] , where:
        • ID: The ID of the message.
        • Consumer: The name of the consumer that fetched the message and has still to acknowledge it. We call it the current owner of the message.
        • TimeElapsed: The number of milliseconds that elapsed since the last time this message was delivered to this consumer.
        • NumOfDelivered: The number of times this message was delivered.
        See Also:
        valkey.io for details.
      • xinfoStream

        public <ArgType> T xinfoStream​(@NonNull
                                       ArgType key)
        Returns information about the stream stored at key key.
        To get more detailed information use #xinfoStreamFull(ArgType) or #xinfoStreamFull(ArgType, int).
        Parameters:
        key - The key of the stream.
        Returns:
        Command Response - A Map of stream information for the given key .
        See Also:
        valkey.io for details.
      • xinfoStreamFull

        public <ArgType> T xinfoStreamFull​(@NonNull
                                           ArgType key)
        Returns verbose information about the stream stored at key key.
        The output is limited by first 10 PEL entries.
        Parameters:
        key - The key of the stream.
        Returns:
        Command Response - A Map of detailed stream information for the given key.
        Since:
        Valkey 6.0 and above.
        See Also:
        valkey.io for details.
      • xinfoStreamFull

        public <ArgType> T xinfoStreamFull​(@NonNull
                                           ArgType key,
                                           int count)
        Returns verbose information about the stream stored at key key.
        The output is limited by first 10 PEL entries.
        Parameters:
        key - The key of the stream.
        count - The number of stream and PEL entries that are returned. Value of 0 means that all entries will be returned.
        Returns:
        Command Response - A Map of detailed stream information for the given key.
        Since:
        Valkey 6.0 and above.
        See Also:
        valkey.io for details.
      • xclaim

        public <ArgType> T xclaim​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  ArgType group,
                                  @NonNull
                                  ArgType consumer,
                                  long minIdleTime,
                                  @NonNull
                                  @NonNull ArgType[] ids)
        Changes the ownership of a pending message.
        Parameters:
        key - The key of the stream.
        group - The consumer group name.
        consumer - The group consumer.
        minIdleTime - The minimum idle time for the message to be claimed.
        ids - An array of entry ids.
        Returns:
        Command Response - A Map of message entries with the format {"entryId": [["entry", "data"], ...], ...} that are claimed by the consumer.
        See Also:
        valkey.io for details.
      • xclaim

        public <ArgType> T xclaim​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  ArgType group,
                                  @NonNull
                                  ArgType consumer,
                                  long minIdleTime,
                                  @NonNull
                                  @NonNull ArgType[] ids,
                                  @NonNull
                                  @NonNull StreamClaimOptions options)
        Changes the ownership of a pending message.
        Parameters:
        key - The key of the stream.
        group - The consumer group name.
        consumer - The group consumer.
        minIdleTime - The minimum idle time for the message to be claimed.
        ids - An array of entry ids.
        options - Stream claim options StreamClaimOptions.
        Returns:
        Command Response - A Map of message entries with the format {"entryId": [["entry", "data"], ...], ...} that are claimed by the consumer.
        See Also:
        valkey.io for details.
      • xclaimJustId

        public <ArgType> T xclaimJustId​(@NonNull
                                        ArgType key,
                                        @NonNull
                                        ArgType group,
                                        @NonNull
                                        ArgType consumer,
                                        long minIdleTime,
                                        @NonNull
                                        @NonNull ArgType[] ids)
        Changes the ownership of a pending message. This function returns an array with only the message/entry IDs, and is equivalent to using JUSTID in the Valkey API.
        Parameters:
        key - The key of the stream.
        group - The consumer group name.
        consumer - The group consumer.
        minIdleTime - The minimum idle time for the message to be claimed.
        ids - An array of entry ids.
        Returns:
        Command Response - An array of message ids claimed by the consumer.
        See Also:
        valkey.io for details.
      • xclaimJustId

        public <ArgType> T xclaimJustId​(@NonNull
                                        ArgType key,
                                        @NonNull
                                        ArgType group,
                                        @NonNull
                                        ArgType consumer,
                                        long minIdleTime,
                                        @NonNull
                                        @NonNull ArgType[] ids,
                                        @NonNull
                                        @NonNull StreamClaimOptions options)
        Changes the ownership of a pending message. This function returns an array with only the message/entry IDs, and is equivalent to using JUSTID in the Valkey API.
        Parameters:
        key - The key of the stream.
        group - The consumer group name.
        consumer - The group consumer.
        minIdleTime - The minimum idle time for the message to be claimed.
        ids - An array of entry ids.
        options - Stream claim options StreamClaimOptions.
        Returns:
        Command Response - An array of message ids claimed by the consumer.
        See Also:
        valkey.io for details.
      • xinfoGroups

        public <ArgType> T xinfoGroups​(@NonNull
                                       ArgType key)
        Returns the list of all consumer groups and their attributes for the stream stored at key .
        Parameters:
        key - The key of the stream.
        Returns:
        Command Response - An Array of Maps, where each mapping represents the attributes of a consumer group for the stream at key.
        See Also:
        valkey.io for details.
      • xinfoConsumers

        public <ArgType> T xinfoConsumers​(@NonNull
                                          ArgType key,
                                          @NonNull
                                          ArgType groupName)
        Returns the list of all consumers and their attributes for the given consumer group of the stream stored at key.
        Parameters:
        key - The key of the stream.
        groupName - The consumer group name.
        Returns:
        Command Response - An Array of Maps, where each mapping contains the attributes of a consumer for the given consumer group of the stream at key.
        See Also:
        valkey.io for details.
      • xautoclaim

        public <ArgType> T xautoclaim​(@NonNull
                                      ArgType key,
                                      @NonNull
                                      ArgType group,
                                      @NonNull
                                      ArgType consumer,
                                      long minIdleTime,
                                      @NonNull
                                      ArgType start)
        Transfers ownership of pending stream entries that match the specified criteria.
        Parameters:
        key - The key of the stream.
        group - The consumer group name
        consumer - The group consumer.
        minIdleTime - The minimum idle time for the message to be claimed.
        start - Filters the claimed entries to those that have an ID equal or greater than the specified value.
        Returns:
        Command Response - An array containing the following elements:
        • A stream entry IDs to be used as the start argument for the next call to XAUTOCLAIM . This ID is equivalent to the next ID in the stream after the entries that were scanned, or "0-0" if the entire stream was scanned.
        • A mapping of the claimed entries, with the keys being the claimed entry IDs and the values being a 2D list of the field-value pairs in the format [[field1, value1], [field2, value2], ...].
        • If you are using Valkey 7.0.0 or above, the response list will also include a list containing the message IDs that were in the Pending Entries List but no longer exist in the stream. These IDs are deleted from the Pending Entries List.
        See Also:
        valkey.io for details.
      • xautoclaim

        public <ArgType> T xautoclaim​(@NonNull
                                      ArgType key,
                                      @NonNull
                                      ArgType group,
                                      @NonNull
                                      ArgType consumer,
                                      long minIdleTime,
                                      @NonNull
                                      ArgType start,
                                      long count)
        Transfers ownership of pending stream entries that match the specified criteria.
        Parameters:
        key - The key of the stream.
        group - The consumer group name
        consumer - The group consumer.
        minIdleTime - The minimum idle time for the message to be claimed.
        start - Filters the claimed entries to those that have an ID equal or greater than the specified value.
        count - Limits the number of claimed entries to the specified value. Default value is 100.
        Returns:
        Command Response - An array containing the following elements:
        • A stream entry IDs to be used as the start argument for the next call to XAUTOCLAIM . This ID is equivalent to the next ID in the stream after the entries that were scanned, or "0-0" if the entire stream was scanned.
        • A mapping of the claimed entries, with the keys being the claimed entry IDs and the values being a 2D list of the field-value pairs in the format [[field1, value1], [field2, value2], ...].
        • If you are using Valkey 7.0.0 or above, the response list will also include a list containing the message IDs that were in the Pending Entries List but no longer exist in the stream. These IDs are deleted from the Pending Entries List.
        See Also:
        valkey.io for details.
      • xautoclaimJustId

        public <ArgType> T xautoclaimJustId​(@NonNull
                                            ArgType key,
                                            @NonNull
                                            ArgType group,
                                            @NonNull
                                            ArgType consumer,
                                            long minIdleTime,
                                            @NonNull
                                            ArgType start)
        Transfers ownership of pending stream entries that match the specified criteria. This command uses the JUSTID argument to further specify that the return value should contain a list of claimed IDs without their field-value info.
        Parameters:
        key - The key of the stream.
        group - The consumer group name
        consumer - The group consumer.
        minIdleTime - The minimum idle time for the message to be claimed.
        start - Filters the claimed entries to those that have an ID equal or greater than the specified value.
        Returns:
        Command Response - An array containing the following elements:
        • A stream entry IDs to be used as the start argument for the next call to XAUTOCLAIM . This ID is equivalent to the next ID in the stream after the entries that were scanned, or "0-0" if the entire stream was scanned.
        • A list of the IDs for the claimed entries.
        • If you are using Valkey 7.0.0 or above, the response list will also include a list containing the message IDs that were in the Pending Entries List but no longer exist in the stream. These IDs are deleted from the Pending Entries List.
        See Also:
        valkey.io for details.
      • xautoclaimJustId

        public <ArgType> T xautoclaimJustId​(@NonNull
                                            ArgType key,
                                            @NonNull
                                            ArgType group,
                                            @NonNull
                                            ArgType consumer,
                                            long minIdleTime,
                                            @NonNull
                                            ArgType start,
                                            long count)
        Transfers ownership of pending stream entries that match the specified criteria. This command uses the JUSTID argument to further specify that the return value should contain a list of claimed IDs without their field-value info.
        Parameters:
        key - The key of the stream.
        group - The consumer group name
        consumer - The group consumer.
        minIdleTime - The minimum idle time for the message to be claimed.
        start - Filters the claimed entries to those that have an ID equal or greater than the specified value.
        count - Limits the number of claimed entries to the specified value. Default value is 100.
        Returns:
        Command Response - An array containing the following elements:
        • A stream entry IDs to be used as the start argument for the next call to XAUTOCLAIM . This ID is equivalent to the next ID in the stream after the entries that were scanned, or "0-0" if the entire stream was scanned.
        • A list of the IDs for the claimed entries.
        • If you are using Valkey 7.0.0 or above, the response list will also include a list containing the message IDs that were in the Pending Entries List but no longer exist in the stream. These IDs are deleted from the Pending Entries List.
        See Also:
        valkey.io for details.
      • pttl

        public <ArgType> T pttl​(@NonNull
                                ArgType key)
        Returns the remaining time to live of key that has a timeout, in milliseconds.
        Parameters:
        key - The key to return its timeout.
        Returns:
        Command Response - TTL in milliseconds. -2 if key does not exist, -1 if key exists but has no associated expire.
        See Also:
        valkey.io for details.
      • persist

        public <ArgType> T persist​(@NonNull
                                   ArgType key)
        Removes the existing timeout on key, turning the key from volatile (a key with an expire set) to persistent (a key that will never expire as no timeout is associated).
        Parameters:
        key - The key to remove the existing timeout on.
        Returns:
        Command Response - false if key does not exist or does not have an associated timeout, true if the timeout has been removed.
        See Also:
        valkey.io for details.
      • time

        public T time()
        Returns the server time.
        Returns:
        Command Response - The current server time as a String array with two elements: A UNIX TIME and the amount of microseconds already elapsed in the current second. The returned array is in a [UNIX TIME, Microseconds already elapsed] format.
        See Also:
        valkey.io for details.
      • lastsave

        public T lastsave()
        Returns UNIX TIME of the last DB save timestamp or startup timestamp if no save was made since then.
        Returns:
        Command Response - UNIX TIME of the last DB save executed with success.
        See Also:
        valkey.io for details.
      • flushall

        public T flushall()
        Deletes all the keys of all the existing databases. This command never fails.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • flushall

        public T flushall​(FlushMode mode)
        Deletes all the keys of all the existing databases. This command never fails.
        Parameters:
        mode - The flushing mode, could be either FlushMode.SYNC or FlushMode.ASYNC.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • flushdb

        public T flushdb()
        Deletes all the keys of the currently selected database. This command never fails.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • flushdb

        public T flushdb​(FlushMode mode)
        Deletes all the keys of the currently selected database. This command never fails.
        Parameters:
        mode - The flushing mode, could be either FlushMode.SYNC or FlushMode.ASYNC.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • lolwut

        public T lolwut()
        Displays a piece of generative computer art and the server version.
        Returns:
        Command Response - A piece of generative computer art along with the current Valkey version.
        See Also:
        valkey.io for details.
      • lolwut

        public T lolwut​(int @NonNull [] parameters)
        Displays a piece of generative computer art and the server version.
        Parameters:
        parameters - Additional set of arguments in order to change the output:
        • On the server version 5, those are length of the line, number of squares per row, and number of squares per column.
        • On the server version 6, those are number of columns and number of lines.
        • On other versions parameters are ignored.
        Returns:
        Command Response - A piece of generative computer art along with the current Valkey version.
        See Also:
        valkey.io for details.
      • lolwut

        public T lolwut​(int version)
        Displays a piece of generative computer art and the server version.
        Parameters:
        version - Version of computer art to generate.
        Returns:
        Command Response - A piece of generative computer art along with the current Valkey version.
        See Also:
        valkey.io for details.
      • lolwut

        public T lolwut​(int version,
                        int @NonNull [] parameters)
        Displays a piece of generative computer art and the server version.
        Parameters:
        version - Version of computer art to generate.
        parameters - Additional set of arguments in order to change the output:
        • For version 5, those are length of the line, number of squares per row, and number of squares per column.
        • For version 6, those are number of columns and number of lines.
        Returns:
        Command Response - A piece of generative computer art along with the current Valkey version.
        See Also:
        valkey.io for details.
      • dbsize

        public T dbsize()
        Returns the number of keys in the currently selected database.
        Returns:
        Command Response - The number of keys in the currently selected database.
        See Also:
        valkey.io for details.
      • type

        public <ArgType> T type​(@NonNull
                                ArgType key)
        Returns the string representation of the type of the value stored at key.
        Parameters:
        key - The key to check its data type.
        Returns:
        Command Response - If the key exists, the type of the stored value is returned. Otherwise, a "none" string is returned.
        See Also:
        valkey.io for details.
      • randomKey

        public T randomKey()
        Returns a random key from the currently selected database. *
        Returns:
        Command Response - A random key from the database.
        See Also:
        valkey.io for details.
      • rename

        public <ArgType> T rename​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  ArgType newKey)
        Renames key to newKey.
        If newKey already exists it is overwritten.
        Parameters:
        key - The key to rename.
        newKey - The new name of the key.
        Returns:
        Command Response - If the key was successfully renamed, returns OK . If key does not exist, the command fails with an error.
        See Also:
        valkey.io for details.
      • renamenx

        public <ArgType> T renamenx​(@NonNull
                                    ArgType key,
                                    @NonNull
                                    ArgType newKey)
        Renames key to newKey if newKey does not yet exist.
        Parameters:
        key - The key to rename.
        newKey - The new key name.
        Returns:
        Command Response - true if key was renamed to newKey , false if newKey already exists.
        See Also:
        valkey.io for details.
      • linsert

        public <ArgType> T linsert​(@NonNull
                                   ArgType key,
                                   @NonNull
                                   @NonNull LInsertOptions.InsertPosition position,
                                   @NonNull
                                   ArgType pivot,
                                   @NonNull
                                   ArgType element)
        Inserts element in the list at key either before or after the pivot.
        Parameters:
        key - The key of the list.
        position - The relative position to insert into - either LInsertOptions.InsertPosition.BEFORE or LInsertOptions.InsertPosition.AFTER the pivot.
        pivot - An element of the list.
        element - The new element to insert.
        Returns:
        Command Response - The list length after a successful insert operation.
        If the key doesn't exist returns -1.
        If the pivot wasn't found, returns 0.
        See Also:
        valkey.io for details.
      • brpop

        public <ArgType> T brpop​(@NonNull
                                 @NonNull ArgType[] keys,
                                 double timeout)
        Pops an element from the tail of the first list that is non-empty, with the given keys being checked in the order that they are given.
        Blocks the connection when there are no elements to pop from any of the given lists.
        Parameters:
        keys - The keys of the lists to pop from.
        timeout - The number of seconds to wait for a blocking operation to complete. A value of 0 will block indefinitely.
        Returns:
        Command Response - A two-element array containing the key from which the element was popped and the value of the popped element, formatted as [key, value]. If no element could be popped and the timeout expired, returns null.
        See Also:
        valkey.io for details.
      • lpushx

        public <ArgType> T lpushx​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  @NonNull ArgType[] elements)
        Inserts all the specified values at the head of the list stored at key, only if key exists and holds a list. If key is not a list, this performs no operation.
        Parameters:
        key - The key of the list.
        elements - The elements to insert at the head of the list stored at key.
        Returns:
        Command Response - The length of the list after the push operation.
        See Also:
        valkey.io for details.
      • rpushx

        public <ArgType> T rpushx​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  @NonNull ArgType[] elements)
        Inserts all the specified values at the tail of the list stored at key, only if key exists and holds a list. If key is not a list, this performs no operation.
        Parameters:
        key - The key of the list.
        elements - The elements to insert at the tail of the list stored at key.
        Returns:
        Command Response - The length of the list after the push operation.
        See Also:
        valkey.io for details.
      • blpop

        public <ArgType> T blpop​(@NonNull
                                 @NonNull ArgType[] keys,
                                 double timeout)
        Pops an element from the head of the first list that is non-empty, with the given keys being checked in the order that they are given.
        Blocks the connection when there are no elements to pop from any of the given lists.
        Parameters:
        keys - The keys of the lists to pop from.
        timeout - The number of seconds to wait for a blocking operation to complete. A value of 0 will block indefinitely.
        Returns:
        Command Response - A two-element array containing the key from which the element was popped and the value of the popped element, formatted as [key, value]. If no element could be popped and the timeout expired, returns null.
        See Also:
        valkey.io for details.
      • zrange

        public <ArgType> T zrange​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  @NonNull RangeOptions.RangeQuery rangeQuery,
                                  boolean reverse)
        Returns the specified range of elements in the sorted set stored at key.
        ZRANGE can perform different types of range queries: by index (rank), by the score, or by lexicographical order.
        To get the elements with their scores, see zrangeWithScores(ArgType, glide.api.models.commands.RangeOptions.ScoredRangeQuery, boolean).
        Parameters:
        key - The key of the sorted set.
        rangeQuery - The range query object representing the type of range query to perform.
        reverse - If true, reverses the sorted set, with index 0 as the element with the highest score.
        Returns:
        Command Response - An array of elements within the specified range. If key does not exist, it is treated as an empty sorted set, and the command returns an empty array.
        See Also:
        valkey.io for more details.
      • zrangeWithScores

        public <ArgType> T zrangeWithScores​(@NonNull
                                            ArgType key,
                                            @NonNull
                                            @NonNull RangeOptions.ScoredRangeQuery rangeQuery,
                                            boolean reverse)
        Returns the specified range of elements with their scores in the sorted set stored at key . Similar to zrange(ArgType, glide.api.models.commands.RangeOptions.RangeQuery, boolean) but with a WITHSCORE flag.
        Parameters:
        key - The key of the sorted set.
        rangeQuery - The range query object representing the type of range query to perform.
        reverse - If true, reverses the sorted set, with index 0 as the element with the highest score.
        Returns:
        Command Response - A Map of elements and their scores within the specified range. If key does not exist, it is treated as an empty sorted set, and the command returns an empty Map.
        See Also:
        valkey.io for more details.
      • zrangeWithScores

        public <ArgType> T zrangeWithScores​(@NonNull
                                            ArgType key,
                                            @NonNull
                                            @NonNull RangeOptions.ScoredRangeQuery rangeQuery)
        Returns the specified range of elements with their scores in the sorted set stored at key . Similar to zrange(ArgType, glide.api.models.commands.RangeOptions.RangeQuery, boolean) but with a WITHSCORE flag.
        Parameters:
        key - The key of the sorted set.
        rangeQuery - The range query object representing the type of range query to perform.
        Returns:
        Command Response - A Map of elements and their scores within the specified range. If key does not exist, it is treated as an empty sorted set, and the command returns an empty Map.
        See Also:
        valkey.io for more details.
      • zmpop

        public <ArgType> T zmpop​(@NonNull
                                 @NonNull ArgType[] keys,
                                 @NonNull
                                 @NonNull ScoreFilter modifier)
        Pops a member-score pair from the first non-empty sorted set, with the given keys being checked in the order they are provided.
        Parameters:
        keys - The keys of the sorted sets.
        modifier - The element pop criteria - either ScoreFilter.MIN or ScoreFilter.MAX to pop the member with the lowest/highest score accordingly.
        Returns:
        Command Response - A two-element array containing the key name of the set from which the element was popped, and a member-score Map of the popped element.
        If no member could be popped, returns null.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for more details.
      • zmpop

        public <ArgType> T zmpop​(@NonNull
                                 @NonNull ArgType[] keys,
                                 @NonNull
                                 @NonNull ScoreFilter modifier,
                                 long count)
        Pops multiple member-score pairs from the first non-empty sorted set, with the given keys being checked in the order they are provided.
        Parameters:
        keys - The keys of the sorted sets.
        modifier - The element pop criteria - either ScoreFilter.MIN or ScoreFilter.MAX to pop members with the lowest/highest scores accordingly.
        count - The number of elements to pop.
        Returns:
        Command Response - A two-element array containing the key name of the set from which elements were popped, and a member-score Map of the popped elements.
        If no member could be popped, returns null.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for more details.
      • bzmpop

        public <ArgType> T bzmpop​(@NonNull
                                  @NonNull ArgType[] keys,
                                  @NonNull
                                  @NonNull ScoreFilter modifier,
                                  double timeout)
        Blocks the connection until it pops and returns a member-score pair from the first non-empty sorted set, with the given keys being checked in the order they are provided.
        BZMPOP is the blocking variant of #zmpop(ArgType[], ScoreFilter).
        Parameters:
        keys - The keys of the sorted sets.
        modifier - The element pop criteria - either ScoreFilter.MIN or ScoreFilter.MAX to pop members with the lowest/highest scores accordingly.
        timeout - The number of seconds to wait for a blocking operation to complete. A value of 0 will block indefinitely.
        Returns:
        Command Response - A two-element array containing the key name of the set from which an element was popped, and a member-score Map of the popped elements.
        If no member could be popped and the timeout expired, returns null.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for more details.
      • bzmpop

        public <ArgType> T bzmpop​(@NonNull
                                  @NonNull ArgType[] keys,
                                  @NonNull
                                  @NonNull ScoreFilter modifier,
                                  double timeout,
                                  long count)
        Blocks the connection until it pops and returns multiple member-score pairs from the first non-empty sorted set, with the given keys being checked in the order they are provided.
        BZMPOP is the blocking variant of #zmpop(ArgType[], ScoreFilter, long).
        Parameters:
        keys - The keys of the sorted sets.
        modifier - The element pop criteria - either ScoreFilter.MIN or ScoreFilter.MAX to pop members with the lowest/highest scores accordingly.
        timeout - The number of seconds to wait for a blocking operation to complete. A value of 0 will block indefinitely.
        count - The number of elements to pop.
        Returns:
        Command Response - A two-element array containing the key name of the set from which elements were popped, and a member-score Map of the popped elements.
        If no members could be popped and the timeout expired, returns null.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for more details.
      • pfadd

        public <ArgType> T pfadd​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 @NonNull ArgType[] elements)
        Adds all elements to the HyperLogLog data structure stored at the specified key.
        Creates a new structure if the key does not exist.

        When no elements are provided, and key exists and is a HyperLogLog, then no operation is performed. If key does not exist, then the HyperLogLog structure is created.

        Parameters:
        key - The key of the HyperLogLog data structure to add elements into.
        elements - An array of members to add to the HyperLogLog stored at key .
        Returns:
        Command Response - If the HyperLogLog is newly created, or if the HyperLogLog approximated cardinality is altered, then returns true. Otherwise, returns false.
        See Also:
        valkey.io for details.
      • pfcount

        public <ArgType> T pfcount​(@NonNull
                                   @NonNull ArgType[] keys)
        Estimates the cardinality of the data stored in a HyperLogLog structure for a single key or calculates the combined cardinality of multiple keys by merging their HyperLogLogs temporarily.
        Parameters:
        keys - The keys of the HyperLogLog data structures to be analyzed.
        Returns:
        Command Response - The approximated cardinality of given HyperLogLog data structures.
        The cardinality of a key that does not exist is 0.
        See Also:
        valkey.io for details.
      • pfmerge

        public <ArgType> T pfmerge​(@NonNull
                                   ArgType destination,
                                   @NonNull
                                   @NonNull ArgType[] sourceKeys)
        Merges multiple HyperLogLog values into a unique value.
        If the destination variable exists, it is treated as one of the source HyperLogLog data sets, otherwise a new HyperLogLog is created.
        Parameters:
        destination - The key of the destination HyperLogLog where the merged data sets will be stored.
        sourceKeys - The keys of the HyperLogLog structures to be merged.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • objectEncoding

        public <ArgType> T objectEncoding​(@NonNull
                                          ArgType key)
        Returns the internal encoding for the server object stored at key.
        Parameters:
        key - The key of the object to get the internal encoding of.
        Returns:
        Command response - If key exists, returns the internal encoding of the object stored at key as a String. Otherwise, return null .
        See Also:
        valkey.io for details.
      • objectFreq

        public <ArgType> T objectFreq​(@NonNull
                                      ArgType key)
        Returns the logarithmic access frequency counter of a server object stored at key.
        Parameters:
        key - The key of the object to get the logarithmic access frequency counter of.
        Returns:
        Command response - If key exists, returns the logarithmic access frequency counter of the object stored at key as a Long. Otherwise, returns null.
        See Also:
        valkey.io for details.
      • objectIdletime

        public <ArgType> T objectIdletime​(@NonNull
                                          ArgType key)
        Returns the time in seconds since the last access to the value stored at key.
        Parameters:
        key - The key of the object to get the idle time of.
        Returns:
        Command response - If key exists, returns the idle time in seconds. Otherwise, returns null.
        See Also:
        valkey.io for details.
      • objectRefcount

        public <ArgType> T objectRefcount​(@NonNull
                                          ArgType key)
        Returns the reference count of the object stored at key.
        Parameters:
        key - The key of the object to get the reference count of.
        Returns:
        Command response - If key exists, returns the reference count of the object stored at key as a Long. Otherwise, returns null .
        See Also:
        valkey.io for details.
      • touch

        public <ArgType> T touch​(@NonNull
                                 @NonNull ArgType[] keys)
        Updates the last access time of specified keys.
        Parameters:
        keys - The keys to update last access time.
        Returns:
        Command Response - The number of keys that were updated.
        See Also:
        valkey.io for details.
      • copy

        public <ArgType> T copy​(@NonNull
                                ArgType source,
                                @NonNull
                                ArgType destination,
                                boolean replace)
        Copies the value stored at the source to the destination key. When replace is true, removes the destination key first if it already exists, otherwise performs no action.
        Parameters:
        source - The key to the source value.
        destination - The key where the value should be copied to.
        replace - If the destination key should be removed before copying the value to it.
        Returns:
        Command Response - true if source was copied, false if source was not copied.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for details.
      • copy

        public <ArgType> T copy​(@NonNull
                                ArgType source,
                                @NonNull
                                ArgType destination)
        Copies the value stored at the source to the destination key if the destination key does not yet exist.
        Parameters:
        source - The key to the source value.
        destination - The key where the value should be copied to.
        Returns:
        Command Response - true if source was copied, false if source was not copied.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for details.
      • copy

        public <ArgType> T copy​(@NonNull
                                ArgType source,
                                @NonNull
                                ArgType destination,
                                long destinationDB)
        Copies the value stored at the source to the destination key on destinationDB. When replace is true, removes the destination key first if it already exists, otherwise performs no action.
        Parameters:
        source - The key to the source value.
        destination - The key where the value should be copied to.
        destinationDB - The alternative logical database index for the destination key.
        Returns:
        Command Response - true if source was copied, false if source was not copied.
        Since:
        Valkey 6.2.0 and above for standalone Client., Valkey 9.0.0 and above for standaloneClient.
        See Also:
        valkey.io for details.
      • copy

        public <ArgType> T copy​(@NonNull
                                ArgType source,
                                @NonNull
                                ArgType destination,
                                long destinationDB,
                                boolean replace)
        Copies the value stored at the source to the destination key on destinationDB. When replace is true, removes the destination key first if it already exists, otherwise performs no action.
        Parameters:
        source - The key to the source value.
        destination - The key where the value should be copied to.
        destinationDB - The alternative logical database index for the destination key.
        replace - If the destination key should be removed before copying the value to it.
        Returns:
        Command Response - true if source was copied, false if source was not copied.
        Since:
        Valkey 6.2.0 and above for standalone Client., Valkey 9.0.0 and above for standaloneClient.
        See Also:
        valkey.io for details.
      • dump

        public <ArgType> T dump​(@NonNull
                                ArgType key)
        Serialize the value stored at key in a Valkey-specific format and return it to the user.
        Parameters:
        key - The key to serialize.
        Returns:
        Command Response - The serialized value of the data stored at key.
        If key does not exist, null will be returned.
        See Also:
        valkey.io for details.
      • restore

        public <ArgType> T restore​(@NonNull
                                   ArgType key,
                                   long ttl,
                                   @NonNull
                                   @lombok.NonNull byte[] value)
        Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via dump(ArgType)).
        Parameters:
        key - The key to create.
        ttl - The expiry time (in milliseconds). If 0, the key will persist.
        value - The serialized value to deserialize and assign to key.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • restore

        public <ArgType> T restore​(@NonNull
                                   ArgType key,
                                   long ttl,
                                   @NonNull
                                   @lombok.NonNull byte[] value,
                                   @NonNull
                                   @NonNull RestoreOptions restoreOptions)
        Create a key associated with a value that is obtained by deserializing the provided serialized value (obtained via dump(ArgType)).
        Parameters:
        key - The key to create.
        ttl - The expiry time (in milliseconds). If 0, the key will persist.
        value - The serialized value to deserialize and assign to key.
        restoreOptions - The restore options. See RestoreOptions.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • bitcount

        public <ArgType> T bitcount​(@NonNull
                                    ArgType key)
        Counts the number of set bits (population counting) in a string stored at key.
        Parameters:
        key - The key for the string to count the set bits of.
        Returns:
        Command Response - The number of set bits in the string. Returns zero if the key is missing as it is treated as an empty string.
        See Also:
        valkey.io for details.
      • bitcount

        public <ArgType> T bitcount​(@NonNull
                                    ArgType key,
                                    long start)
        Counts the number of set bits (population counting) in a string stored at key. The offset start is a zero-based index, with 0 being the first byte of the list, 1 being the next byte and so on. This offset can also be a negative number indicating offsets starting at the end of the list, with -1 being the last byte of the list, -2 being the penultimate, and so on.
        Parameters:
        key - The key for the string to count the set bits of.
        start - The starting offset byte index.
        Returns:
        Command Response - The number of set bits in the string byte interval specified by start to the last byte. Returns zero if the key is missing as it is treated as an empty string.
        See Also:
        valkey.io for details.
      • bitcount

        public <ArgType> T bitcount​(@NonNull
                                    ArgType key,
                                    long start,
                                    long end)
        Counts the number of set bits (population counting) in a string stored at key. The offsets start and end are zero-based indexes, with 0 being the first element of the list, 1 being the next element and so on. These offsets can also be negative numbers indicating offsets starting at the end of the list, with -1 being the last element of the list, -2 being the penultimate, and so on.
        Parameters:
        key - The key for the string to count the set bits of.
        start - The starting byte offset.
        end - The ending byte offset.
        Returns:
        Command Response - The number of set bits in the string byte interval specified by start and end. Returns zero if the key is missing as it is treated as an empty string.
        See Also:
        valkey.io for details.
      • bitcount

        public <ArgType> T bitcount​(@NonNull
                                    ArgType key,
                                    long start,
                                    long end,
                                    @NonNull
                                    @NonNull BitmapIndexType options)
        Counts the number of set bits (population counting) in a string stored at key. The offsets start and end are zero-based indexes, with 0 being the first element of the list, 1 being the next element and so on. These offsets can also be negative numbers indicating offsets starting at the end of the list, with -1 being the last element of the list, -2 being the penultimate, and so on.
        Parameters:
        key - The key for the string to count the set bits of.
        start - The starting offset.
        end - The ending offset.
        options - The index offset type. Could be either BitmapIndexType.BIT or BitmapIndexType.BYTE.
        Returns:
        Command Response - The number of set bits in the string interval specified by start, end, and options. Returns zero if the key is missing as it is treated as an empty string.
        Since:
        Valkey 7.0 and above
        See Also:
        valkey.io for details.
      • geoadd

        public <ArgType> T geoadd​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  @NonNull java.util.Map<ArgType,​GeospatialData> membersToGeospatialData,
                                  @NonNull
                                  @NonNull GeoAddOptions options)
        Adds geospatial members with their positions to the specified sorted set stored at key .
        If a member is already a part of the sorted set, its position is updated.
        Parameters:
        key - The key of the sorted set.
        membersToGeospatialData - A mapping of member names to their corresponding positions - see GeospatialData. The command will report an error when the user attempts to index coordinates outside the specified ranges.
        options - The GeoAdd options - see GeoAddOptions
        Returns:
        Command Response - The number of elements added to the sorted set. If changed is set to true in the options, returns the number of elements updated in the sorted set.
        See Also:
        valkey.io for more details.
      • geoadd

        public <ArgType> T geoadd​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  @NonNull java.util.Map<ArgType,​GeospatialData> membersToGeospatialData)
        Adds geospatial members with their positions to the specified sorted set stored at key .
        If a member is already a part of the sorted set, its position is updated.
        To perform a geoadd operation while specifying optional parameters, use #geoadd(ArgType, Map, GeoAddOptions).
        Parameters:
        key - The key of the sorted set.
        membersToGeospatialData - A mapping of member names to their corresponding positions - see GeospatialData. The command will report an error when the user attempts to index coordinates outside the specified ranges.
        Returns:
        Command Response - The number of elements added to the sorted set.
        See Also:
        valkey.io for more details.
      • geopos

        public <ArgType> T geopos​(@NonNull
                                  ArgType key,
                                  @NonNull
                                  @NonNull ArgType[] members)
        Returns the positions (longitude,latitude) of all the specified members of the geospatial index represented by the sorted set at key.
        Parameters:
        key - The key of the sorted set.
        members - The members for which to get the positions.
        Returns:
        Command Response - A 2D array which represent positions (longitude and latitude) corresponding to the given members. If a member does not exist, its position will be null.
        See Also:
        valkey.io for more details.
      • geodist

        public <ArgType> T geodist​(@NonNull
                                   ArgType key,
                                   @NonNull
                                   ArgType member1,
                                   @NonNull
                                   ArgType member2,
                                   @NonNull
                                   @NonNull GeoUnit geoUnit)
        Returns the distance between member1 and member2 saved in the geospatial index stored at key.
        Parameters:
        key - The key of the sorted set.
        member1 - The name of the first member.
        member2 - The name of the second member.
        geoUnit - The unit of distance measurement - see GeoUnit.
        Returns:
        Command Response - The distance between member1 and member2. If one or both members do not exist or if the key does not exist returns null.
        See Also:
        valkey.io for more details.
      • geodist

        public <ArgType> T geodist​(@NonNull
                                   ArgType key,
                                   @NonNull
                                   ArgType member1,
                                   @NonNull
                                   ArgType member2)
        Returns the distance between member1 and member2 saved in the geospatial index stored at key.
        Parameters:
        key - The key of the sorted set.
        member1 - The name of the first member.
        member2 - The name of the second member.
        Returns:
        Command Response - The distance between member1 and member2. If one or both members do not exist or if the key does not exist returns null. The default unit is GeoUnit.METERS.
        See Also:
        valkey.io for more details.
      • geohash

        public <ArgType> T geohash​(@NonNull
                                   ArgType key,
                                   @NonNull
                                   @NonNull ArgType[] members)
        Returns the GeoHash strings representing the positions of all the specified members in the sorted set stored at key.
        Parameters:
        key - The key of the sorted set.
        members - The array of members whose GeoHash strings are to be retrieved.
        Returns:
        Command Response - An array of GeoHash strings representing the positions of the specified members stored at key. If a member does not exist in the sorted set, a null value is returned for that member.
        See Also:
        valkey.io for more details.
      • functionLoad

        public <ArgType> T functionLoad​(@NonNull
                                        ArgType libraryCode,
                                        boolean replace)
        Loads a library to Valkey.
        Parameters:
        libraryCode - The source code that implements the library.
        replace - Whether the given library should overwrite a library with the same name if it already exists.
        Returns:
        Command Response - The library name that was loaded.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • functionList

        public T functionList​(boolean withCode)
        Returns information about the functions and libraries.
        Parameters:
        withCode - Specifies whether to request the library code from the server or not.
        Returns:
        Command Response - Info about all libraries and their functions.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • functionList

        public <ArgType> T functionList​(@NonNull
                                        ArgType libNamePattern,
                                        boolean withCode)
        Returns information about the functions and libraries.
        Parameters:
        libNamePattern - A wildcard pattern for matching library names.
        withCode - Specifies whether to request the library code from the server or not.
        Returns:
        Command Response - Info about queried libraries and their functions.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • fcall

        public <ArgType> T fcall​(@NonNull
                                 ArgType function,
                                 @NonNull
                                 @NonNull ArgType[] keys,
                                 @NonNull
                                 @NonNull ArgType[] arguments)
        Invokes a previously loaded function.
        Parameters:
        function - The function name.
        keys - An array of key arguments accessed by the function. To ensure the correct execution of functions, both in standalone and clustered deployments, all names of keys that a function accesses must be explicitly provided as keys.
        arguments - An array of function arguments. arguments should not represent names of keys.
        Returns:
        Command Response - The invoked function's return value.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • fcall

        public <ArgType> T fcall​(@NonNull
                                 ArgType function,
                                 @NonNull
                                 @NonNull ArgType[] arguments)
        Invokes a previously loaded read-only function.
        Parameters:
        function - The function name.
        arguments - An array of function arguments. arguments should not represent names of keys.
        Returns:
        Command Response - The invoked function's return value.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • fcallReadOnly

        public <ArgType> T fcallReadOnly​(@NonNull
                                         ArgType function,
                                         @NonNull
                                         @NonNull ArgType[] keys,
                                         @NonNull
                                         @NonNull ArgType[] arguments)
        Invokes a previously loaded read-only function.
        Parameters:
        function - The function name.
        keys - An array of key arguments accessed by the function. To ensure the correct execution of functions, both in standalone and clustered deployments, all names of keys that a function accesses must be explicitly provided as keys.
        arguments - An array of function arguments. arguments should not represent names of keys.
        Returns:
        Command Response - The invoked function's return value.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • fcallReadOnly

        public <ArgType> T fcallReadOnly​(@NonNull
                                         ArgType function,
                                         @NonNull
                                         @NonNull ArgType[] arguments)
        Invokes a previously loaded function.
        Parameters:
        function - The function name.
        arguments - An array of function arguments. arguments should not represent names of keys.
        Returns:
        Command Response - The invoked function's return value.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • functionStats

        public T functionStats()
        Returns information about the function that's currently running and information about the available execution engines.
        Returns:
        Command Response - A Map with two keys:
        • running_script with information about the running script.
        • engines with information about available engines and their stats.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • functionDump

        public T functionDump()
        Returns the serialized payload of all loaded libraries. The command will be routed to a random node.
        Returns:
        Command Response - The serialized payload of all loaded libraries.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • functionRestore

        public T functionRestore​(@NonNull
                                 @lombok.NonNull byte[] payload)
        Restores libraries from the serialized payload returned by functionDump(). The command will be routed to all primary nodes.
        Parameters:
        payload - The serialized data from functionDump().
        Returns:
        Command Response - "OK" response on success.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • functionRestore

        public T functionRestore​(@NonNull
                                 @lombok.NonNull byte[] payload,
                                 @NonNull
                                 @NonNull FunctionRestorePolicy policy)
        Restores libraries from the serialized payload returned by functionDump(). The command will be routed to all primary nodes.
        Parameters:
        payload - The serialized data from functionDump().
        policy - A policy for handling existing libraries.
        Returns:
        Command Response - "OK" response on success.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • setbit

        public <ArgType> T setbit​(@NonNull
                                  ArgType key,
                                  long offset,
                                  long value)
        Sets or clears the bit at offset in the string value stored at key. The offset is a zero-based index, with 0 being the first element of the list, 1 being the next element, and so on. The offset must be less than 2^32 and greater than or equal to 0. If a key is non-existent then the bit at offset is set to value and the preceding bits are set to 0.
        Parameters:
        key - The key of the string.
        offset - The index of the bit to be set.
        value - The bit value to set at offset. The value must be 0 or 1.
        Returns:
        Command Response - The bit value that was previously stored at offset.
        See Also:
        valkey.io for details.
      • getbit

        public <ArgType> T getbit​(@NonNull
                                  ArgType key,
                                  long offset)
        Returns the bit value at offset in the string value stored at key. offset should be greater than or equal to zero.
        Parameters:
        key - The key of the string.
        offset - The index of the bit to return.
        Returns:
        Command Response - The bit at offset of the string. Returns zero if the key is empty or if the positive offset exceeds the length of the string.
        See Also:
        valkey.io for details.
      • blmpop

        public <ArgType> T blmpop​(@NonNull
                                  @NonNull ArgType[] keys,
                                  @NonNull
                                  @NonNull ListDirection direction,
                                  @NonNull
                                  @NonNull java.lang.Long count,
                                  double timeout)
        Blocks the connection until it pops one or more elements from the first non-empty list from the provided keys. BLMPOP is the blocking variant of #lmpop(ArgType[], ListDirection, Long).
        Parameters:
        keys - The list of provided key names.
        direction - The direction based on which elements are popped from - see ListDirection.
        count - The maximum number of popped elements.
        timeout - The number of seconds to wait for a blocking operation to complete. A value of 0 will block indefinitely.
        Returns:
        Command Response - A Map of key names arrays of popped elements.
        If no member could be popped and the timeout expired, returns null.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • blmpop

        public <ArgType> T blmpop​(@NonNull
                                  @NonNull ArgType[] keys,
                                  @NonNull
                                  @NonNull ListDirection direction,
                                  double timeout)
        Blocks the connection until it pops one element from the first non-empty list from the provided keys. BLMPOP is the blocking variant of #lmpop(ArgType[], ListDirection).
        Parameters:
        keys - The list of provided key names.
        direction - The direction based on which elements are popped from - see ListDirection.
        timeout - The number of seconds to wait for a blocking operation to complete. A value of 0 will block indefinitely.
        Returns:
        Command Response - A Map of key names arrays of popped elements.
        If no member could be popped and the timeout expired, returns null.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • bitpos

        public <ArgType> T bitpos​(@NonNull
                                  ArgType key,
                                  long bit)
        Returns the position of the first bit matching the given bit value.
        Parameters:
        key - The key of the string.
        bit - The bit value to match. The value must be 0 or 1.
        Returns:
        Command Response - The position of the first occurrence matching bit in the binary value of the string held at key. If bit is not found, a -1 is returned.
        See Also:
        valkey.io for details.
      • bitpos

        public <ArgType> T bitpos​(@NonNull
                                  ArgType key,
                                  long bit,
                                  long start)
        Returns the position of the first bit matching the given bit value. The offset start is a zero-based index, with 0 being the first byte of the list, 1 being the next byte and so on. These offsets can also be negative numbers indicating offsets starting at the end of the list, with -1 being the last byte of the list, -2 being the penultimate, and so on.
        Parameters:
        key - The key of the string.
        bit - The bit value to match. The value must be 0 or 1.
        start - The starting offset.
        Returns:
        Command Response - The position of the first occurrence beginning at the start offset of the bit in the binary value of the string held at key . If bit is not found, a -1 is returned.
        See Also:
        valkey.io for details.
      • bitpos

        public <ArgType> T bitpos​(@NonNull
                                  ArgType key,
                                  long bit,
                                  long start,
                                  long end)
        Returns the position of the first bit matching the given bit value. The offsets start and end are zero-based indexes, with 0 being the first byte of the list, 1 being the next byte and so on. These offsets can also be negative numbers indicating offsets starting at the end of the list, with -1 being the last byte of the list, -2 being the penultimate, and so on.
        Parameters:
        key - The key of the string.
        bit - The bit value to match. The value must be 0 or 1.
        start - The starting offset.
        end - The ending offset.
        Returns:
        Command Response - The position of the first occurrence from the start to the end offsets of the bit in the binary value of the string held at key. If bit is not found, a -1 is returned.
        See Also:
        valkey.io for details.
      • bitpos

        public <ArgType> T bitpos​(@NonNull
                                  ArgType key,
                                  long bit,
                                  long start,
                                  long end,
                                  @NonNull
                                  @NonNull BitmapIndexType offsetType)
        Returns the position of the first bit matching the given bit value. The offset offsetType specifies whether the offset is a BIT or BYTE. If BIT is specified, start==0 and end==2 means to look at the first three bits. If BYTE is specified, start==0 and end==2 means to look at the first three bytes The offsets are zero-based indexes, with 0 being the first element of the list, 1 being the next, and so on. These offsets can also be negative numbers indicating offsets starting at the end of the list, with -1 being the last element of the list, -2 being the penultimate, and so on.
        Parameters:
        key - The key of the string.
        bit - The bit value to match. The value must be 0 or 1.
        start - The starting offset.
        end - The ending offset.
        offsetType - The index offset type. Could be either BitmapIndexType.BIT or BitmapIndexType.BYTE.
        Returns:
        Command Response - The position of the first occurrence from the start to the end offsets of the bit in the binary value of the string held at key. If bit is not found, a -1 is returned.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • bitop

        public <ArgType> T bitop​(@NonNull
                                 @NonNull BitwiseOperation bitwiseOperation,
                                 @NonNull
                                 ArgType destination,
                                 @NonNull
                                 @NonNull ArgType[] keys)
        Perform a bitwise operation between multiple keys (containing string values) and store the result in the destination.
        Parameters:
        bitwiseOperation - The bitwise operation to perform.
        destination - The key that will store the resulting string.
        keys - The list of keys to perform the bitwise operation on.
        Returns:
        Command Response - The size of the string stored in destination.
        See Also:
        valkey.io for details.
      • lmpop

        public <ArgType> T lmpop​(@NonNull
                                 @NonNull ArgType[] keys,
                                 @NonNull
                                 @NonNull ListDirection direction,
                                 @NonNull
                                 @NonNull java.lang.Long count)
        Pops one or more elements from the first non-empty list from the provided keys .
        Parameters:
        keys - An array of keys to lists.
        direction - The direction based on which elements are popped from - see ListDirection.
        count - The maximum number of popped elements.
        Returns:
        Command Response - A Map of key name mapped arrays of popped elements. If no member could be popped, returns null.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • lmpop

        public <ArgType> T lmpop​(@NonNull
                                 @NonNull ArgType[] keys,
                                 @NonNull
                                 @NonNull ListDirection direction)
        Pops one element from the first non-empty list from the provided keys.
        Parameters:
        keys - An array of keys to lists.
        direction - The direction based on which elements are popped from - see ListDirection.
        Returns:
        Command Response - A Map of key name mapped array of the popped element. If no member could be popped, returns null.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • lset

        public <ArgType> T lset​(@NonNull
                                ArgType key,
                                long index,
                                @NonNull
                                ArgType element)
        Sets the list element at index to element.
        The index is zero-based, so 0 means the first element, 1 the second element and so on. Negative indices can be used to designate elements starting at the tail of the list. Here, -1 means the last element, -2 means the penultimate and so forth.
        Parameters:
        key - The key of the list.
        index - The index of the element in the list to be set.
        Returns:
        Command Response - "OK" response on success.
        See Also:
        valkey.io for details.
      • lmove

        public <ArgType> T lmove​(@NonNull
                                 ArgType source,
                                 @NonNull
                                 ArgType destination,
                                 @NonNull
                                 @NonNull ListDirection whereFrom,
                                 @NonNull
                                 @NonNull ListDirection whereTo)
        Atomically pops and removes the left/right-most element to the list stored at source depending on whereFrom, and pushes the element at the first/last element of the list stored at destination depending on whereFrom.
        Parameters:
        source - The key to the source list.
        destination - The key to the destination list.
        whereFrom - The ListDirection the element should be removed from.
        whereTo - The ListDirection the element should be added to.
        Returns:
        Command Response - The popped element or null if source does not exist.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for details.
      • blmove

        public <ArgType> T blmove​(@NonNull
                                  ArgType source,
                                  @NonNull
                                  ArgType destination,
                                  @NonNull
                                  @NonNull ListDirection whereFrom,
                                  @NonNull
                                  @NonNull ListDirection whereTo,
                                  double timeout)
        Blocks the connection until it atomically pops and removes the left/right-most element to the list stored at source depending on whereFrom, and pushes the element at the first/last element of the list stored at destination depending on whereFrom.
        BLMove is the blocking variant of #lmove(ArgType, ArgType, ListDirection, ListDirection).
        Parameters:
        source - The key to the source list.
        destination - The key to the destination list.
        whereFrom - The ListDirection the element should be removed from.
        whereTo - The ListDirection the element should be added to.
        timeout - The number of seconds to wait for a blocking operation to complete. A value of 0 will block indefinitely.
        Returns:
        Command Response - The popped element or null if source does not exist or if the operation timed-out.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for details.
      • srandmember

        public <ArgType> T srandmember​(@NonNull
                                       ArgType key)
        Returns a random element from the set value stored at key.
        Parameters:
        key - The key from which to retrieve the set member.
        Returns:
        Command Response - A random element from the set, or null if key does not exist.
        See Also:
        valkey.io for details.
      • srandmember

        public <ArgType> T srandmember​(@NonNull
                                       ArgType key,
                                       long count)
        Returns random elements from the set value stored at key.
        Parameters:
        key - The key from which to retrieve the set members.
        count - The number of elements to return.
        If count is positive, returns unique elements.
        If negative, allows for duplicates.
        Returns:
        Command Response - An array of elements from the set, or an empty array if key does not exist.
        See Also:
        valkey.io for details.
      • spop

        public <ArgType> T spop​(@NonNull
                                ArgType key)
        Removes and returns one random member from the set stored at key.
        Parameters:
        key - The key of the set.
        Returns:
        Command Response - The value of the popped member.
        If key does not exist, null will be returned.
        See Also:
        valkey.io for details.
      • spopCount

        public <ArgType> T spopCount​(@NonNull
                                     ArgType key,
                                     long count)
        Removes and returns up to count random members from the set stored at key , depending on the set's length.
        Parameters:
        key - The key of the set.
        count - The count of the elements to pop from the set.
        Returns:
        Command Response - A Set of popped elements will be returned depending on the set's length.
        If key does not exist, an empty Set will be returned.
        See Also:
        valkey.io for details.
      • bitfieldReadOnly

        public <ArgType> T bitfieldReadOnly​(@NonNull
                                            ArgType key,
                                            @NonNull
                                            @NonNull BitFieldOptions.BitFieldReadOnlySubCommands[] subCommands)
        Reads the array of bits representing the string that is held at key based on the specified subCommands.
        This command is routed depending on the client's ReadFrom strategy.
        Parameters:
        key - The key of the string.
        subCommands - The GET subCommands to be performed.
        Returns:
        Command Response - An array of results from the GET subcommands.
        Since:
        Valkey 6.0 and above
        See Also:
        valkey.io for details.
      • functionFlush

        public T functionFlush()
        Deletes all function libraries.
        Returns:
        Command Response - "OK" response on success.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • functionFlush

        public T functionFlush​(@NonNull
                               @NonNull FlushMode mode)
        Deletes all function libraries.
        Parameters:
        mode - The flushing mode, could be either FlushMode.SYNC or FlushMode.ASYNC.
        Returns:
        Command Response - "OK" response on success.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • functionDelete

        public <ArgType> T functionDelete​(@NonNull
                                          ArgType libName)
        Deletes a library and all its functions.
        Parameters:
        libName - The library name to delete.
        Returns:
        Command Response - "OK" response on success.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • lcs

        public <ArgType> T lcs​(@NonNull
                               ArgType key1,
                               @NonNull
                               ArgType key2)
        Returns all the longest common subsequences combined between strings stored at key1 and key2.
        Parameters:
        key1 - The key that stores the first string.
        key2 - The key that stores the second string.
        Returns:
        Command Response - A String containing all the longest common subsequences combined between the 2 strings. An empty String/GlideString is returned if the keys do not exist or have no common subsequences.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • lcsLen

        public <ArgType> T lcsLen​(@NonNull
                                  ArgType key1,
                                  @NonNull
                                  ArgType key2)
        Returns the total length of all the longest common subsequences between strings stored at key1 and key2.
        Parameters:
        key1 - The key that stores the first string.
        key2 - The key that stores the second string.
        Returns:
        Command Response - The total length of all the longest common subsequences between the 2 strings.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • publish

        public <ArgType> T publish​(@NonNull
                                   ArgType message,
                                   @NonNull
                                   ArgType channel)
        Publishes message on pubsub channel.
        Parameters:
        message - The message to publish.
        channel - The channel to publish the message on.
        Returns:
        Command response - The number of clients that received the message.
        See Also:
        valkey.io for details.
      • pubsubChannels

        public T pubsubChannels()
        Lists the currently active channels.
        Returns:
        Command response - An Array of all active channels.
        See Also:
        valkey.io for details.
      • pubsubChannels

        public <ArgType> T pubsubChannels​(@NonNull
                                          ArgType pattern)
        Lists the currently active channels.
        Parameters:
        pattern - A glob-style pattern to match active channels.
        Returns:
        Command response - An Array of currently active channels matching the given pattern.
        See Also:
        valkey.io for details.
      • pubsubNumPat

        public T pubsubNumPat()
        Returns the number of unique patterns that are subscribed to by clients.
        Returns:
        Command response - The number of unique patterns.
        See Also:
        valkey.io for details.
      • pubsubNumSub

        public <ArgType> T pubsubNumSub​(@NonNull
                                        @NonNull ArgType[] channels)
        Returns the number of subscribers (exclusive of clients subscribed to patterns) for the specified channels.
        Parameters:
        channels - The list of channels to query for the number of subscribers.
        Returns:
        Command response - A Map where keys are the channel names and values are the numbers of subscribers.
        See Also:
        valkey.io for details.
      • sunion

        public <ArgType> T sunion​(@NonNull
                                  @NonNull ArgType[] keys)
        Gets the union of all the given sets.
        Parameters:
        keys - The keys of the sets.
        Returns:
        Command Response - A Set of members which are present in at least one of the given sets. If none of the sets exist, an empty set will be returned.
        See Also:
        valkey.io for details.
      • lcsIdx

        public <ArgType> T lcsIdx​(@NonNull
                                  ArgType key1,
                                  @NonNull
                                  ArgType key2)
        Returns the indices and length of the longest common subsequence between strings stored at key1 and key2.
        Parameters:
        key1 - The key that stores the first string.
        key2 - The key that stores the second string.
        Returns:
        Command Response - A Map containing the indices of the longest common subsequence between the 2 strings and the total length of all the longest common subsequences. The resulting map contains two keys, "matches" and "len":
        • "len" is mapped to the total length of the all longest common subsequences between the 2 strings stored as Long.
        • "matches" is mapped to a three dimensional Long array that stores pairs of indices that represent the location of the common subsequences in the strings held by key1 and key2.
        See example of StringBaseCommands.lcsIdx(String, String) for more details.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • lcsIdx

        public <ArgType> T lcsIdx​(@NonNull
                                  ArgType key1,
                                  @NonNull
                                  ArgType key2,
                                  long minMatchLen)
        Returns the indices and the total length of all the longest common subsequences between strings stored at key1 and key2.
        Parameters:
        key1 - The key that stores the first string.
        key2 - The key that stores the second string.
        minMatchLen - The minimum length of matches to include in the result.
        Returns:
        Command Response - A Map containing the indices of the longest common subsequence between the 2 strings and the total length of all the longest common subsequences. The resulting map contains two keys, "matches" and "len":
        • "len" is mapped to the total length of the all longest common subsequences between the 2 strings stored as Long. This value doesn't count towards the minMatchLen filter.
        • "matches" is mapped to a three dimensional Long array that stores pairs of indices that represent the location of the common subsequences in the strings held by key1 and key2.
        See example of StringBaseCommands.lcsIdx(String, String, long) for more details.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • lcsIdxWithMatchLen

        public <ArgType> T lcsIdxWithMatchLen​(@NonNull
                                              ArgType key1,
                                              @NonNull
                                              ArgType key2)
        Returns the indices and lengths of the longest common subsequences between strings stored at key1 and key2.
        Parameters:
        key1 - The key that stores the first string.
        key2 - The key that stores the second string.
        Returns:
        Command Response - A Map containing the indices of the longest common subsequence between the 2 strings and the lengths of the longest common subsequences. The resulting map contains two keys, "matches" and "len":
        • "len" is mapped to the total length of the all longest common subsequences between the 2 strings stored as Long.
        • "matches" is mapped to a three dimensional array that stores pairs of indices that represent the location of the common subsequences in the strings held by key1 and key2 and the match length.
        See example of StringBaseCommands.lcsIdxWithMatchLen(String, String) for more details.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • lcsIdxWithMatchLen

        public <ArgType> T lcsIdxWithMatchLen​(@NonNull
                                              ArgType key1,
                                              @NonNull
                                              ArgType key2,
                                              long minMatchLen)
        Returns the indices and lengths of the longest common subsequences between strings stored at key1 and key2.
        Parameters:
        key1 - The key that stores the first string.
        key2 - The key that stores the second string.
        minMatchLen - The minimum length of matches to include in the result.
        Returns:
        Command Response - A Map containing the indices of the longest common subsequence between the 2 strings and the lengths of the longest common subsequences. The resulting map contains two keys, "matches" and "len":
        • "len" is mapped to the total length of the all longest common subsequences between the 2 strings stored as Long.
        • "matches" is mapped to a three dimensional array that stores pairs of indices that represent the location of the common subsequences in the strings held by key1 and key2 and the match length.
        See example of StringBaseCommands.lcsIdxWithMatchLen(String, String, long) for more details.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • sort

        public <ArgType> T sort​(@NonNull
                                ArgType key)
        Sorts the elements in the list, set, or sorted set at key and returns the result.
        The sort command can be used to sort elements based on different criteria and apply transformations on sorted elements.
        To store the result into a new key, see #sortStore(ArgType, ArgType).
        Parameters:
        key - The key of the list, set, or sorted set to be sorted.
        Returns:
        Command Response - An Array of sorted elements.
        See Also:
        valkey.io for details.
      • sort

        public <ArgType> T sort​(@NonNull
                                ArgType key,
                                @NonNull
                                @NonNull SortOptions sortOptions)
        Sorts the elements in the list, set, or sorted set at key and returns the result. The sort command can be used to sort elements based on different criteria and apply transformations on sorted elements.
        To store the result into a new key, see #sortStore(ArgType, ArgType, SortOptions).
        Parameters:
        key - The key of the list, set, or sorted set to be sorted.
        sortOptions - The SortOptions.
        Returns:
        Command Response - An Array of sorted elements.
        See Also:
        valkey.io for details.
      • sortReadOnly

        public <ArgType> T sortReadOnly​(@NonNull
                                        ArgType key)
        Sorts the elements in the list, set, or sorted set at key and returns the result.
        The sortReadOnly command can be used to sort elements based on different criteria and apply transformations on sorted elements.
        Parameters:
        key - The key of the list, set, or sorted set to be sorted.
        Returns:
        Command Response - An Array of sorted elements.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • sortReadOnly

        public <ArgType> T sortReadOnly​(@NonNull
                                        ArgType key,
                                        @NonNull
                                        @NonNull SortOptions sortOptions)
        Sorts the elements in the list, set, or sorted set at key and returns the result. The sortReadOnly command can be used to sort elements based on different criteria and apply transformations on sorted elements.
        Parameters:
        key - The key of the list, set, or sorted set to be sorted.
        sortOptions - The SortOptions.
        Returns:
        Command Response - An Array of sorted elements.
        Since:
        Valkey 7.0 and above.
        See Also:
        valkey.io for details.
      • sortStore

        public <ArgType> T sortStore​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     ArgType destination)
        Sorts the elements in the list, set, or sorted set at key and stores the result in destination. The sort command can be used to sort elements based on different criteria, apply transformations on sorted elements, and store the result in a new key.
        To get the sort result without storing it into a key, see #sort(ArgType) or #sortReadOnly(ArgType).
        Parameters:
        key - The key of the list, set, or sorted set to be sorted.
        destination - The key where the sorted result will be stored.
        Returns:
        Command Response - The number of elements in the sorted key stored at destination .
        See Also:
        valkey.io for details.
      • sortStore

        public <ArgType> T sortStore​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     ArgType destination,
                                     @NonNull
                                     @NonNull SortOptions sortOptions)
        Sorts the elements in the list, set, or sorted set at key and stores the result in destination. The sort command can be used to sort elements based on different criteria, apply transformations on sorted elements, and store the result in a new key.
        To get the sort result without storing it into a key, see #sort(ArgType, SortOptions).
        Parameters:
        key - The key of the list, set, or sorted set to be sorted.
        sortOptions - The SortOptions.
        destination - The key where the sorted result will be stored.
        Returns:
        Command Response - The number of elements in the sorted key stored at destination .
        See Also:
        valkey.io for details.
      • geosearch

        public <ArgType> T geosearch​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     @NonNull GeoSearchOrigin.SearchOrigin searchFrom,
                                     @NonNull
                                     @NonNull GeoSearchShape searchBy)
        Returns the members of a sorted set populated with geospatial information using #geoadd(ArgType, Map), which are within the borders of the area specified by a given shape.
        Parameters:
        key - The key of the sorted set.
        searchFrom - The query's center point options, could be one of:
        searchBy - The query's shape options:
        Returns:
        Command Response - An array of matched member names.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for more details.
      • geosearch

        public <ArgType> T geosearch​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     @NonNull GeoSearchOrigin.SearchOrigin searchFrom,
                                     @NonNull
                                     @NonNull GeoSearchShape searchBy,
                                     @NonNull
                                     @NonNull GeoSearchResultOptions resultOptions)
        Returns the members of a sorted set populated with geospatial information using #geoadd(ArgType, Map), which are within the borders of the area specified by a given shape.
        Parameters:
        key - The key of the sorted set.
        searchFrom - The query's center point options, could be one of:
        searchBy - The query's shape options:
        resultOptions - Optional inputs for sorting/limiting the results. See - GeoSearchResultOptions
        Returns:
        Command Response - An array of matched member names.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for more details.
      • geosearch

        public <ArgType> T geosearch​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     @NonNull GeoSearchOrigin.SearchOrigin searchFrom,
                                     @NonNull
                                     @NonNull GeoSearchShape searchBy,
                                     @NonNull
                                     @NonNull GeoSearchOptions options)
        Returns the members of a sorted set populated with geospatial information using #geoadd(ArgType, Map), which are within the borders of the area specified by a given shape.
        Parameters:
        key - The key of the sorted set.
        searchFrom - The query's center point options, could be one of:
        searchBy - The query's shape options:
        options - The optional inputs to request additional information.
        Returns:
        Command Response - A 2D array of arrays where each sub-array represents a single item in the following order:
        • The member (location) name.
        • The distance from the center as a Double, in the same unit specified for searchBy.
        • The geohash of the location as a Long.
        • The coordinates as a two item array of Double.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for more details.
      • geosearch

        public <ArgType> T geosearch​(@NonNull
                                     ArgType key,
                                     @NonNull
                                     @NonNull GeoSearchOrigin.SearchOrigin searchFrom,
                                     @NonNull
                                     @NonNull GeoSearchShape searchBy,
                                     @NonNull
                                     @NonNull GeoSearchOptions options,
                                     @NonNull
                                     @NonNull GeoSearchResultOptions resultOptions)
        Returns the members of a sorted set populated with geospatial information using #geoadd(ArgType, Map), which are within the borders of the area specified by a given shape.
        Parameters:
        key - The key of the sorted set.
        searchFrom - The query's center point options, could be one of:
        searchBy - The query's shape options:
        options - The optional inputs to request additional information.
        resultOptions - Optional inputs for sorting/limiting the results. See - GeoSearchResultOptions
        Returns:
        Command Response - A 2D array of arrays where each sub-array represents a single item in the following order:
        • The member (location) name.
        • The distance from the center as a Double, in the same unit specified for searchBy.
        • The geohash of the location as a Long.
        • The coordinates as a two item array of Double.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for more details.
      • geosearchstore

        public <ArgType> T geosearchstore​(@NonNull
                                          ArgType destination,
                                          @NonNull
                                          ArgType source,
                                          @NonNull
                                          @NonNull GeoSearchOrigin.SearchOrigin searchFrom,
                                          @NonNull
                                          @NonNull GeoSearchShape searchBy)
        Searches for members in a sorted set stored at source representing geospatial data within a circular or rectangular area and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created. To get the result directly, see `#geosearch(ArgType, SearchOrigin, GeoSearchShape).
        Parameters:
        destination - The key of the destination sorted set.
        source - The key of the source sorted set.
        searchFrom - The query's center point options, could be one of:
        searchBy - The query's shape options:
        Returns:
        Command Response - The number of elements in the resulting set.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for more details.
      • geosearchstore

        public <ArgType> T geosearchstore​(@NonNull
                                          ArgType destination,
                                          @NonNull
                                          ArgType source,
                                          @NonNull
                                          @NonNull GeoSearchOrigin.SearchOrigin searchFrom,
                                          @NonNull
                                          @NonNull GeoSearchShape searchBy,
                                          @NonNull
                                          @NonNull GeoSearchResultOptions resultOptions)
        Searches for members in a sorted set stored at source representing geospatial data within a circular or rectangular area and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created. To get the result directly, see `#geosearch(ArgType, SearchOrigin, GeoSearchShape, GeoSearchResultOptions).
        Parameters:
        destination - The key of the destination sorted set.
        source - The key of the source sorted set.
        searchFrom - The query's center point options, could be one of:
        searchBy - The query's shape options:
        resultOptions - Optional inputs for sorting/limiting the results. See - GeoSearchResultOptions
        Returns:
        Command Response - The number of elements in the resulting set.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for more details.
      • geosearchstore

        public <ArgType> T geosearchstore​(@NonNull
                                          ArgType destination,
                                          @NonNull
                                          ArgType source,
                                          @NonNull
                                          @NonNull GeoSearchOrigin.SearchOrigin searchFrom,
                                          @NonNull
                                          @NonNull GeoSearchShape searchBy,
                                          @NonNull
                                          @NonNull GeoSearchStoreOptions options)
        Searches for members in a sorted set stored at source representing geospatial data within a circular or rectangular area and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created. To get the result directly, see `#geosearch(ArgType, SearchOrigin, GeoSearchShape, GeoSearchOptions).
        Parameters:
        destination - The key of the destination sorted set.
        source - The key of the source sorted set.
        searchFrom - The query's center point options, could be one of:
        searchBy - The query's shape options:
        options - The optional inputs to request additional information.
        Returns:
        Command Response - The number of elements in the resulting set.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for more details.
      • geosearchstore

        public <ArgType> T geosearchstore​(@NonNull
                                          ArgType destination,
                                          @NonNull
                                          ArgType source,
                                          @NonNull
                                          @NonNull GeoSearchOrigin.SearchOrigin searchFrom,
                                          @NonNull
                                          @NonNull GeoSearchShape searchBy,
                                          @NonNull
                                          @NonNull GeoSearchStoreOptions options,
                                          @NonNull
                                          @NonNull GeoSearchResultOptions resultOptions)
        Searches for members in a sorted set stored at source representing geospatial data within a circular or rectangular area and stores the result in destination. If destination already exists, it is overwritten. Otherwise, a new sorted set will be created. To get the result directly, see `#geosearch(ArgType, SearchOrigin, GeoSearchShape, GeoSearchOptions, GeoSearchResultOptions).
        Parameters:
        destination - The key of the destination sorted set.
        source - The key of the source sorted set.
        searchFrom - The query's center point options, could be one of:
        searchBy - The query's shape options:
        options - The optional inputs to request additional information.
        resultOptions - Optional inputs for sorting/limiting the results. See - GeoSearchResultOptions
        Returns:
        Command Response - The number of elements in the resulting set.
        Since:
        Valkey 6.2.0 and above.
        See Also:
        valkey.io for more details.
      • sscan

        public <ArgType> T sscan​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 ArgType cursor)
        Iterates incrementally over a set.
        Parameters:
        key - The key of the set.
        cursor - The cursor that points to the next iteration of results. A value of "0" indicates the start of the search.
        Returns:
        Command Response - An Array of Objects. The first element is always the cursor for the next iteration of results. "0" will be the cursor returned on the last iteration of the set. The second element is always an Array of the subset of the set held in key.
        See Also:
        valkey.io for details.
      • sscan

        public <ArgType> T sscan​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 ArgType cursor,
                                 @NonNull
                                 @NonNull SScanOptions sScanOptions)
        Iterates incrementally over a set.
        Parameters:
        key - The key of the set.
        cursor - The cursor that points to the next iteration of results. A value of "0" indicates the start of the search.
        sScanOptions - The SScanOptions.
        Returns:
        Command Response - An Array of Objects. The first element is always the cursor for the next iteration of results. "0" will be the cursor returned on the last iteration of the set. The second element is always an Array of the subset of the set held in key.
        See Also:
        valkey.io for details.
      • zscan

        public <ArgType> T zscan​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 ArgType cursor)
        Iterates incrementally over a sorted set.
        Parameters:
        key - The key of the sorted set.
        cursor - The cursor that points to the next iteration of results. A value of "0" indicates the start of the search.
        Returns:
        Command Response - An Array of Objects. The first element is always the cursor for the next iteration of results. "0" will be the cursor returned on the last iteration of the sorted set. The second element is always an Array of the subset of the sorted set held in key . The array in the second element is always a flattened series of String pairs, where the value is at even indices and the score is at odd indices.
        See Also:
        valkey.io for details.
      • zscan

        public <ArgType> T zscan​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 ArgType cursor,
                                 @NonNull
                                 @NonNull ZScanOptions zScanOptions)
        Iterates incrementally over a sorted set.
        Parameters:
        key - The key of the sorted set.
        cursor - The cursor that points to the next iteration of results. A value of "0" indicates the start of the search.
        zScanOptions - The ZScanOptions.
        Returns:
        Command Response - An Array of Objects. The first element is always the cursor for the next iteration of results. "0" will be the cursor returned on the last iteration of the sorted set. The second element is always an Array of the subset of the sorted set held in key . The array in the second element is a flattened series of String pairs, where the value is at even indices and the score is at odd indices. If ZScanOptions.ZScanOptionsBuilder.noScores(boolean) is to true, the second element will only contain the members without scores.
        See Also:
        valkey.io for details.
      • hscan

        public <ArgType> T hscan​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 ArgType cursor)
        Iterates fields of Hash types and their associated values.
        Parameters:
        key - The key of the hash.
        cursor - The cursor that points to the next iteration of results. A value of "0" indicates the start of the search.
        Returns:
        Command Response - An Array of Objects. The first element is always the cursor for the next iteration of results. "0" will be the cursor returned on the last iteration of the result. The second element is always an Array of the subset of the hash held in key. The array in the second element is always a flattened series of String pairs, where the key is at even indices and the value is at odd indices.
        See Also:
        valkey.io for details.
      • hscan

        public <ArgType> T hscan​(@NonNull
                                 ArgType key,
                                 @NonNull
                                 ArgType cursor,
                                 @NonNull
                                 @NonNull HScanOptions hScanOptions)
        Iterates fields of Hash types and their associated values.
        Parameters:
        key - The key of the hash.
        cursor - The cursor that points to the next iteration of results. A value of "0" indicates the start of the search.
        hScanOptions - The HScanOptions.
        Returns:
        Command Response - An Array of Objects. The first element is always the cursor for the next iteration of results. "0" will be the cursor returned on the last iteration of the result. The second element is always an Array of the subset of the hash held in key. The array in the second element is a flattened series of String pairs, where the key is at even indices and the value is at odd indices. If HScanOptions.HScanOptionsBuilder.noValues(boolean) is set to true, the second element will only contain the fields without the values.
        See Also:
        valkey.io for details.
      • wait

        public T wait​(long numReplicas,
                      long timeout)
        Returns the number of replicas that acknowledged the write commands sent by the current client before this command, both in the case where the specified number of replicas are reached, or when the timeout is reached.
        Parameters:
        numReplicas - The number of replicas to reach.
        timeout - The timeout value specified in milliseconds.
        Returns:
        Command Response - The number of replicas reached by all the writes performed in the context of the current connection.
        See Also:
        valkey.io for details.
      • createArray

        @SafeVarargs
        protected final <ArgType> ArgType[] createArray​(ArgType... args)
        Helper function for creating generic type ("ArgType") array