public interface BoundHashOperations<H,HK,HV> extends BoundKeyOperations<H>
Modifier and Type | Method and Description |
---|---|
Long |
delete(Object... keys)
Delete given hash
keys at the bound key. |
Map<HK,HV> |
entries()
Get entire hash at the bound key.
|
HV |
get(Object member)
Get value for given
key from the hash at the bound key. |
RedisOperations<H,?> |
getOperations() |
Boolean |
hasKey(Object key)
Determine if given hash
key exists at the bound key. |
Double |
increment(HK key,
double delta)
Increment
value of a hash key by the given delta at the bound key. |
Long |
increment(HK key,
long delta)
Increment
value of a hash key by the given delta at the bound key. |
Set<HK> |
keys()
Get key set (fields) of hash at the bound key.
|
Long |
lengthOfValue(HK hashKey)
Returns the length of the value associated with
hashKey . |
List<HV> |
multiGet(Collection<HK> keys)
Get values for given
keys from the hash at the bound key. |
void |
put(HK key,
HV value)
Set the
value of a hash key at the bound key. |
void |
putAll(Map<? extends HK,? extends HV> m)
Set multiple hash fields to multiple values using data provided in
m at the bound key. |
Boolean |
putIfAbsent(HK key,
HV value)
Set the
value of a hash key only if key does not exist. |
Map<HK,HV> |
randomEntries(long count)
Return a random entry from the hash stored at the bound key.
|
Map.Entry<HK,HV> |
randomEntry()
Return a random entry from the hash stored at the bound key.
|
HK |
randomKey()
Return a random key (aka field) from the hash stored at the bound key.
|
List<HK> |
randomKeys(long count)
Return a random keys (aka fields) from the hash stored at the bound key.
|
Cursor<Map.Entry<HK,HV>> |
scan(ScanOptions options)
Use a
Cursor to iterate over entries in the hash. |
Long |
size()
Get size of hash at the bound key.
|
List<HV> |
values()
Get entry set (values) of hash at the bound key.
|
@Nullable Long delete(Object... keys)
keys
at the bound key.keys
- must not be null.@Nullable Boolean hasKey(Object key)
key
exists at the bound key.key
- must not be null.@Nullable HV get(Object member)
key
from the hash at the bound key.member
- must not be null.@Nullable List<HV> multiGet(Collection<HK> keys)
keys
from the hash at the bound key. Values are in the order of the requested keys
Absent field values are represented using null
in the resulting List
.keys
- must not be null.@Nullable Long increment(HK key, long delta)
value
of a hash key
by the given delta
at the bound key.key
- must not be null.delta
- @Nullable Double increment(HK key, double delta)
value
of a hash key
by the given delta
at the bound key.key
- must not be null.delta
- @Nullable HK randomKey()
@Nullable Map.Entry<HK,HV> randomEntry()
@Nullable List<HK> randomKeys(long count)
count
argument is
positive, return a list of distinct 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 key multiple times. In this case, the
number of returned keys is the absolute value of the specified count.count
- number of keys to return.@Nullable Map<HK,HV> randomEntries(long count)
count
- number of entries to return. Must be positive.@Nullable Set<HK> keys()
@Nullable Long lengthOfValue(HK hashKey)
hashKey
. If the hashKey
do not exist, 0
is
returned.hashKey
- must not be null.@Nullable Long size()
void putAll(Map<? extends HK,? extends HV> m)
m
at the bound key.m
- must not be null.void put(HK key, HV value)
value
of a hash key
at the bound key.key
- must not be null.value
- @Nullable Boolean putIfAbsent(HK key, HV value)
value
of a hash key
only if key
does not exist.key
- must not be null.value
- @Nullable List<HV> values()
@Nullable Map<HK,HV> entries()
Cursor<Map.Entry<HK,HV>> scan(ScanOptions options)
Cursor
to iterate over entries in the hash.options
- RedisOperations<H,?> getOperations()
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.