public interface HashOperations<H,HK,HV>
Modifier and Type | Method and Description |
---|---|
Long |
delete(H key,
Object... hashKeys)
Delete given hash
hashKeys . |
Map<HK,HV> |
entries(H key)
Get entire hash stored at
key . |
HV |
get(H key,
Object hashKey)
Get value for given
hashKey from hash at key . |
RedisOperations<H,?> |
getOperations() |
Boolean |
hasKey(H key,
Object hashKey)
Determine if given hash
hashKey exists. |
Double |
increment(H key,
HK hashKey,
double delta)
Increment
value of a hash hashKey by the given delta . |
Long |
increment(H key,
HK hashKey,
long delta)
Increment
value of a hash hashKey by the given delta . |
Set<HK> |
keys(H key)
Get key set (fields) of hash at
key . |
Long |
lengthOfValue(H key,
HK hashKey)
Returns the length of the value associated with
hashKey . |
List<HV> |
multiGet(H key,
Collection<HK> hashKeys)
Get values for given
hashKeys from hash at key . |
void |
put(H key,
HK hashKey,
HV value)
Set the
value of a hash hashKey . |
void |
putAll(H key,
Map<? extends HK,? extends HV> m)
Set multiple hash fields to multiple values using data provided in
m . |
Boolean |
putIfAbsent(H key,
HK hashKey,
HV value)
Set the
value of a hash hashKey only if hashKey does not exist. |
Map<HK,HV> |
randomEntries(H key,
long count)
Return a random entries from the hash value stored at
key . |
Map.Entry<HK,HV> |
randomEntry(H key)
Return a random entry from the hash value stored at
key . |
HK |
randomKey(H key)
Return a random hash key (aka field) from the hash value stored at
key . |
List<HK> |
randomKeys(H key,
long count)
Return random hash keys (aka fields) from the hash value stored at
key . |
Cursor<Map.Entry<HK,HV>> |
scan(H key,
ScanOptions options)
Use a
Cursor to iterate over entries in hash at key . |
Long |
size(H key)
Get size of hash at
key . |
List<HV> |
values(H key)
Get entry set (values) of hash at
key . |
Long delete(H key, Object... hashKeys)
hashKeys
.key
- must not be null.hashKeys
- must not be null.Boolean hasKey(H key, Object hashKey)
hashKey
exists.key
- must not be null.hashKey
- must not be null.@Nullable HV get(H key, Object hashKey)
hashKey
from hash at key
.key
- must not be null.hashKey
- must not be null.List<HV> multiGet(H key, Collection<HK> hashKeys)
hashKeys
from hash at key
.key
- must not be null.hashKeys
- must not be null.Long increment(H key, HK hashKey, long delta)
value
of a hash hashKey
by the given delta
.key
- must not be null.hashKey
- must not be null.delta
- Double increment(H key, HK hashKey, double delta)
value
of a hash hashKey
by the given delta
.key
- must not be null.hashKey
- must not be null.delta
- @Nullable HK randomKey(H key)
key
.key
- must not be null.@Nullable Map.Entry<HK,HV> randomEntry(H key)
key
.key
- must not be null.@Nullable List<HK> randomKeys(H key, long count)
key
. If the provided count
argument is
positive, return a list of distinct hash keys, capped either at count
or the hash size. If count
is
negative, the behavior changes and the command is allowed to return the same hash key multiple times. In this case,
the number of returned fields is the absolute value of the specified count.key
- must not be null.count
- number of fields to return.@Nullable Map<HK,HV> randomEntries(H key, long count)
key
.key
- must not be null.count
- number of fields to return. Must be positive.Set<HK> keys(H key)
key
.key
- must not be null.@Nullable Long lengthOfValue(H key, HK hashKey)
hashKey
. If either the key
or the hashKey
do not exist, 0
is returned.key
- must not be null.hashKey
- must not be null.Long size(H key)
key
.key
- must not be null.void putAll(H key, Map<? extends HK,? extends HV> m)
m
.key
- must not be null.m
- must not be null.void put(H key, HK hashKey, HV value)
value
of a hash hashKey
.key
- must not be null.hashKey
- must not be null.value
- Boolean putIfAbsent(H key, HK hashKey, HV value)
value
of a hash hashKey
only if hashKey
does not exist.key
- must not be null.hashKey
- must not be null.value
- List<HV> values(H key)
key
.key
- must not be null.Map<HK,HV> entries(H key)
key
.key
- must not be null.Cursor<Map.Entry<HK,HV>> scan(H key, ScanOptions options)
Cursor
to iterate over entries in hash at key
. CloseableIterator.close()
when done to avoid resource leak.key
- must not be null.options
- RedisOperations<H,?> getOperations()
Copyright © 2011–2021 Pivotal Software, Inc.. All rights reserved.