|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lordofthejars.nosqlunit.redis.embedded.ExpirationDatatypeOperations
com.lordofthejars.nosqlunit.redis.embedded.HashDatatypeOperations
public class HashDatatypeOperations
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.lordofthejars.nosqlunit.redis.embedded.ExpirationDatatypeOperations |
|---|
ExpirationDatatypeOperations.TtlState |
| Field Summary | |
|---|---|
protected static String |
HASH
|
protected com.google.common.collect.Table<ByteBuffer,ByteBuffer,ByteBuffer> |
hashElements
|
| Fields inherited from class com.lordofthejars.nosqlunit.redis.embedded.ExpirationDatatypeOperations |
|---|
expirationsInMillis, NO_EXPIRATION |
| Constructor Summary | |
|---|---|
HashDatatypeOperations()
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class com.lordofthejars.nosqlunit.redis.embedded.ExpirationDatatypeOperations |
|---|
addExpirationAt, addExpirationTime, remainingTime, removeExpiration, renameTtlKey, timedoutState |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.lordofthejars.nosqlunit.redis.embedded.RedisDatatypeOperations |
|---|
addExpirationAt, addExpirationTime, remainingTime, removeExpiration, timedoutState |
| Field Detail |
|---|
protected static final String HASH
protected com.google.common.collect.Table<ByteBuffer,ByteBuffer,ByteBuffer> hashElements
| Constructor Detail |
|---|
public HashDatatypeOperations()
| Method Detail |
|---|
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 RedisDatatypeOperations
public boolean renameKey(byte[] key,
byte[] newKey)
renameKey in interface RedisDatatypeOperationspublic List<byte[]> sort(byte[] key)
sort in interface RedisDatatypeOperations
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||