org.springframework.data.redis.connection
Interface RedisHashCommands

All Known Subinterfaces:
RedisCommands, RedisConnection, StringRedisConnection
All Known Implementing Classes:
DefaultStringRedisConnection, JedisConnection, JredisConnection, LettuceConnection, SrpConnection

public interface RedisHashCommands

Hash-specific commands supported by Redis.


Method Summary
 Long hDel(byte[] key, byte[]... fields)
          Delete given hash fields.
 Boolean hExists(byte[] key, byte[] field)
          Determine if given hash field exists.
 byte[] hGet(byte[] key, byte[] field)
          Get value for given field from hash at key.
 Map<byte[],byte[]> hGetAll(byte[] key)
          Get entire hash stored at key.
 Double hIncrBy(byte[] key, byte[] field, double delta)
          Increment value of a hash field by the given delta.
 Long hIncrBy(byte[] key, byte[] field, long delta)
          Increment value of a hash field by the given delta.
 Set<byte[]> hKeys(byte[] key)
          Get key set (fields) of hash at key.
 Long hLen(byte[] key)
          Get size of hash at key.
 List<byte[]> hMGet(byte[] key, byte[]... fields)
          Get values for given fields from hash at key.
 void hMSet(byte[] key, Map<byte[],byte[]> hashes)
          Set multiple hash fields to multiple values using data provided in hashes
 Boolean hSet(byte[] key, byte[] field, byte[] value)
          Set the value of a hash field.
 Boolean hSetNX(byte[] key, byte[] field, byte[] value)
          Set the value of a hash field only if field does not exist.
 List<byte[]> hVals(byte[] key)
          Get entry set (values) of hash at field.
 

Method Detail

hSet

Boolean hSet(byte[] key,
             byte[] field,
             byte[] value)
Set the value of a hash field.

Parameters:
key -
field -
value -
Returns:
See Also:
http://redis.io/commands/hset

hSetNX

Boolean hSetNX(byte[] key,
               byte[] field,
               byte[] value)
Set the value of a hash field only if field does not exist.

Parameters:
key -
field -
value -
Returns:
See Also:
http://redis.io/commands/hsetnx

hGet

byte[] hGet(byte[] key,
            byte[] field)
Get value for given field from hash at key.

Parameters:
key -
field -
Returns:
See Also:
http://redis.io/commands/hget

hMGet

List<byte[]> hMGet(byte[] key,
                   byte[]... fields)
Get values for given fields from hash at key.

Parameters:
key -
fields -
Returns:
See Also:
http://redis.io/commands/hmget

hMSet

void hMSet(byte[] key,
           Map<byte[],byte[]> hashes)
Set multiple hash fields to multiple values using data provided in hashes

Parameters:
key -
hashes -
See Also:
http://redis.io/commands/hmset

hIncrBy

Long hIncrBy(byte[] key,
             byte[] field,
             long delta)
Increment value of a hash field by the given delta.

Parameters:
key -
field -
delta -
Returns:
See Also:
http://redis.io/commands/hincrby

hIncrBy

Double hIncrBy(byte[] key,
               byte[] field,
               double delta)
Increment value of a hash field by the given delta.

Parameters:
key -
field -
delta -
Returns:
See Also:
http://redis.io/commands/hincrbyfloat

hExists

Boolean hExists(byte[] key,
                byte[] field)
Determine if given hash field exists.

Parameters:
key -
field -
Returns:
See Also:
http://redis.io/commands/hexits

hDel

Long hDel(byte[] key,
          byte[]... fields)
Delete given hash fields.

Parameters:
key -
fields -
Returns:
See Also:
http://redis.io/commands/hdel

hLen

Long hLen(byte[] key)
Get size of hash at key.

Parameters:
key -
Returns:
See Also:
http://redis.io/commands/hlen

hKeys

Set<byte[]> hKeys(byte[] key)
Get key set (fields) of hash at key.

Parameters:
key -
Returns:
See Also:
http://redis.io/commands/h?

hVals

List<byte[]> hVals(byte[] key)
Get entry set (values) of hash at field.

Parameters:
key -
Returns:
See Also:
http://redis.io/commands/hvals

hGetAll

Map<byte[],byte[]> hGetAll(byte[] key)
Get entire hash stored at key.

Parameters:
key -
Returns:
See Also:
http://redis.io/commands/hgetall