public interface RedisStringCommands
Modifier and Type | Interface and Description |
---|---|
static class |
RedisStringCommands.BitOperation |
static class |
RedisStringCommands.SetOption
SET command arguments for NX , XX . |
Modifier and Type | Method and Description |
---|---|
Long |
append(byte[] key,
byte[] value)
Append a
value to key . |
Long |
bitCount(byte[] key)
Count the number of set bits (population counting) in value stored at
key . |
Long |
bitCount(byte[] key,
long begin,
long end)
Count the number of set bits (population counting) of value stored at
key between begin and
end . |
Long |
bitOp(RedisStringCommands.BitOperation op,
byte[] destination,
byte[]... keys)
Perform bitwise operations between strings.
|
Long |
decr(byte[] key)
Decrement value of
key by 1. |
Long |
decrBy(byte[] key,
long value)
Increment value of
key by value . |
byte[] |
get(byte[] key)
Get the value of
key . |
Boolean |
getBit(byte[] key,
long offset)
Get the bit value at
offset of value at key . |
byte[] |
getRange(byte[] key,
long begin,
long end)
Get a substring of value of
key between begin and end . |
byte[] |
getSet(byte[] key,
byte[] value)
Set value of
key and return its old value. |
Long |
incr(byte[] key)
Increment value of
key by 1. |
Double |
incrBy(byte[] key,
double value)
Increment value of
key by value . |
Long |
incrBy(byte[] key,
long value)
Increment value of
key by value . |
List<byte[]> |
mGet(byte[]... keys)
Get the values of all given
keys . |
void |
mSet(Map<byte[],byte[]> tuple)
Set multiple keys to multiple values using key-value pairs provided in
tuple . |
Boolean |
mSetNX(Map<byte[],byte[]> tuple)
Set multiple keys to multiple values using key-value pairs provided in
tuple only if the provided key does
not exist. |
void |
pSetEx(byte[] key,
long milliseconds,
byte[] value)
Set the
value and expiration in milliseconds for key . |
void |
set(byte[] key,
byte[] value)
Set
value for key . |
void |
set(byte[] key,
byte[] value,
Expiration expiration,
RedisStringCommands.SetOption option)
Set
value for key applying timeouts from expiration if set and inserting/updating values
depending on option . |
Boolean |
setBit(byte[] key,
long offset,
boolean value)
Sets the bit at
offset in value stored at key . |
void |
setEx(byte[] key,
long seconds,
byte[] value)
Set the
value and expiration in seconds for key . |
Boolean |
setNX(byte[] key,
byte[] value)
Set
value for key , only if key does not exist. |
void |
setRange(byte[] key,
byte[] value,
long offset)
Overwrite parts of
key starting at the specified offset with given value . |
Long |
strLen(byte[] key)
Get the length of the value stored at
key . |
byte[] get(byte[] key)
key
.
See http://redis.io/commands/get
key
- must not be null.byte[] getSet(byte[] key, byte[] value)
key
and return its old value.
See http://redis.io/commands/getset
key
- must not be null.value
- List<byte[]> mGet(byte[]... keys)
keys
.
See http://redis.io/commands/mget
keys
- void set(byte[] key, byte[] value)
value
for key
.
See http://redis.io/commands/set
key
- must not be null.value
- must not be null.void set(byte[] key, byte[] value, Expiration expiration, RedisStringCommands.SetOption option)
value
for key
applying timeouts from expiration
if set and inserting/updating values
depending on option
.
See http://redis.io/commands/set
key
- must not be null.value
- must not be null.expiration
- can be null. Defaulted to Expiration.persistent()
.option
- can be null. Defaulted to RedisStringCommands.SetOption.UPSERT
.Boolean setNX(byte[] key, byte[] value)
value
for key
, only if key
does not exist.
See http://redis.io/commands/setnx
key
- must not be null.value
- must not be null.void setEx(byte[] key, long seconds, byte[] value)
value
and expiration in seconds
for key
.
See http://redis.io/commands/setex
key
- must not be null.seconds
- value
- must not be null.void pSetEx(byte[] key, long milliseconds, byte[] value)
value
and expiration in milliseconds
for key
.
See http://redis.io/commands/psetex
key
- must not be null.milliseconds
- value
- must not be null.void mSet(Map<byte[],byte[]> tuple)
tuple
.
See http://redis.io/commands/mset
tuple
- Boolean mSetNX(Map<byte[],byte[]> tuple)
tuple
only if the provided key does
not exist.
See http://redis.io/commands/msetnx
tuple
- Long incr(byte[] key)
key
by 1.
See http://redis.io/commands/incr
key
- must not be null.Long incrBy(byte[] key, long value)
key
by value
.
See http://redis.io/commands/incrby
key
- must not be null.value
- Double incrBy(byte[] key, double value)
key
by value
.
See http://redis.io/commands/incrbyfloat
key
- must not be null.value
- Long decr(byte[] key)
key
by 1.
See http://redis.io/commands/decr
key
- must not be null.Long decrBy(byte[] key, long value)
key
by value
.
See http://redis.io/commands/decrby
key
- must not be null.value
- Long append(byte[] key, byte[] value)
value
to key
.
See http://redis.io/commands/append
key
- must not be null.value
- byte[] getRange(byte[] key, long begin, long end)
key
between begin
and end
.
See http://redis.io/commands/getrange
key
- must not be null.begin
- end
- void setRange(byte[] key, byte[] value, long offset)
key
starting at the specified offset
with given value
.
See http://redis.io/commands/setrange
key
- must not be null.value
- offset
- Boolean getBit(byte[] key, long offset)
offset
of value at key
.
See http://redis.io/commands/getbit
key
- must not be null.offset
- Boolean setBit(byte[] key, long offset, boolean value)
offset
in value stored at key
.
See http://redis.io/commands/setbit
key
- must not be null.offset
- value
- offset
.Long bitCount(byte[] key)
key
.
See http://redis.io/commands/bitcount
key
- must not be null.Long bitCount(byte[] key, long begin, long end)
key
between begin
and
end
.
See http://redis.io/commands/bitcount
key
- must not be null.begin
- end
- Long bitOp(RedisStringCommands.BitOperation op, byte[] destination, byte[]... keys)
See http://redis.io/commands/bitop
op
- destination
- keys
- Long strLen(byte[] key)
key
.
See http://redis.io/commands/strlen
key
- must not be null.Copyright © 2011-2016–2016 Pivotal Software, Inc.. All rights reserved.