public class HashDatatypeOperations extends ExpirationDatatypeOperations implements RedisDatatypeOperations
ExpirationDatatypeOperations.TtlState| Modifier and Type | Field and Description |
|---|---|
protected static String |
HASH |
protected com.google.common.collect.Table<ByteBuffer,ByteBuffer,ByteBuffer> |
hashElements |
expirationsInMillis, NO_EXPIRATION| Constructor and Description |
|---|
HashDatatypeOperations() |
| Modifier and Type | Method and Description |
|---|---|
Long |
del(byte[]... keys) |
boolean |
exists(byte[] key) |
void |
flushAllKeys() |
long |
getNumberOfKeys() |
Long |
hdel(byte[] key,
byte[]... fields)
Remove the specified field from an hash stored at key.
|
Boolean |
hexists(byte[] key,
byte[] field)
Test for existence of a specified field in a hash.
|
byte[] |
hget(byte[] key,
byte[] field)
If key holds a hash, retrieve the value associated to the specified
field.
|
Map<byte[],byte[]> |
hgetAll(byte[] key)
Return all the fields and associated values in a hash.
|
Long |
hincrBy(byte[] key,
byte[] field,
long value)
Increment the number stored at field in the hash at key by value.
|
Set<byte[]> |
hkeys(byte[] key)
Return all the fields in a hash.
|
Long |
hlen(byte[] key)
Return the number of items in a hash.
|
List<byte[]> |
hmget(byte[] key,
byte[]... fields)
Retrieve the values associated to the specified fields.
|
String |
hmset(byte[] key,
Map<byte[],byte[]> hash)
Set the respective fields to the respective values.
|
Long |
hset(byte[] key,
byte[] field,
byte[] value)
Set the specified hash field to the specified value.
|
Long |
hsetnx(byte[] key,
byte[] field,
byte[] value)
Set the specified hash field to the specified value if the field not
exists.
|
List<byte[]> |
hvals(byte[] key)
Return all the values in a hash.
|
List<byte[]> |
keys() |
boolean |
renameKey(byte[] key,
byte[] newKey) |
List<byte[]> |
sort(byte[] key) |
String |
type() |
addExpirationAt, addExpirationTime, remainingTime, removeExpiration, renameTtlKey, timedoutStateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddExpirationAt, addExpirationTime, remainingTime, removeExpiration, timedoutStateprotected static final String HASH
protected com.google.common.collect.Table<ByteBuffer,ByteBuffer,ByteBuffer> hashElements
public Long hset(byte[] key, byte[] field, byte[] value)
If key does not exist, a new key holding a hash is created.
key - field - value - public byte[] hget(byte[] key,
byte[] field)
If the field is not found or the key does not exist, a special 'nil' value is returned.
key - field - public Long hdel(byte[] key, byte[]... fields)
Time complexity: O(1)
key - fields - public Boolean hexists(byte[] key, byte[] field)
key - field - public Map<byte[],byte[]> hgetAll(byte[] key)
key - public Long hincrBy(byte[] key, byte[] field, long value)
The range of values supported by HINCRBY is limited to 64 bit signed integers.
key - field - value - public Set<byte[]> hkeys(byte[] key)
key - public Long hlen(byte[] key)
key - public List<byte[]> hmget(byte[] key, byte[]... fields)
If some of the specified fields do not exist, nil values are returned. Non existing keys are considered like empty hashes.
key - fields - public String hmset(byte[] key, Map<byte[],byte[]> hash)
If key does not exist, a new key holding a hash is created.
key - hash - public Long hsetnx(byte[] key, byte[] field, byte[] value)
key - field - value - public List<byte[]> hvals(byte[] key)
key - public long getNumberOfKeys()
getNumberOfKeys in interface RedisDatatypeOperationspublic void flushAllKeys()
flushAllKeys in interface RedisDatatypeOperationspublic String type()
type in interface RedisDatatypeOperationspublic List<byte[]> keys()
keys in interface RedisDatatypeOperationspublic Long del(byte[]... keys)
del in interface RedisDatatypeOperationspublic boolean exists(byte[] key)
exists in interface RedisDatatypeOperationspublic boolean renameKey(byte[] key,
byte[] newKey)
renameKey in interface RedisDatatypeOperationspublic List<byte[]> sort(byte[] key)
sort in interface RedisDatatypeOperationsCopyright © 2016. All Rights Reserved.