|
||||||||||
| 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.StringDatatypeOperations
public class StringDatatypeOperations
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.lordofthejars.nosqlunit.redis.embedded.ExpirationDatatypeOperations |
|---|
ExpirationDatatypeOperations.TtlState |
| Field Summary | |
|---|---|
protected Map<ByteBuffer,ByteBuffer> |
simpleTypes
|
protected static String |
STRING
|
| Fields inherited from class com.lordofthejars.nosqlunit.redis.embedded.ExpirationDatatypeOperations |
|---|
expirationsInMillis, NO_EXPIRATION |
| Constructor Summary | |
|---|---|
StringDatatypeOperations()
|
|
| Method Summary | |
|---|---|
Long |
append(byte[] key,
byte[] value)
If the key already exists and is a string, this command appends the provided value at the end of the string. |
Long |
decr(byte[] key)
Decrement the number stored at key by one. |
Long |
decrBy(byte[] key,
long integer)
IDECRBY work just like INCR but instead to
decrement by 1 the decrement is integer. |
Long |
del(byte[]... keys)
|
boolean |
exists(byte[] key)
|
void |
flushAllKeys()
|
byte[] |
get(byte[] key)
|
Boolean |
getbit(byte[] key,
long offset)
Returns the bit value at offset in the string value stored at key |
long |
getNumberOfKeys()
|
byte[] |
getrange(byte[] key,
long startOffset,
long endOffset)
|
byte[] |
getSet(byte[] key,
byte[] value)
|
Long |
incr(byte[] key)
Increment the number stored at key by one. |
Long |
incrBy(byte[] key,
long integer)
INCRBY work just like INCR but instead to increment
by 1 the increment is integer. |
List<byte[]> |
keys()
|
List<byte[]> |
mget(byte[]... keys)
|
String |
mset(byte[]... keysvalues)
|
Long |
msetnx(byte[]... keysvalues)
|
String |
rename(byte[] oldKey,
byte[] newKey)
|
boolean |
renameKey(byte[] key,
byte[] newKey)
|
String |
set(byte[] key,
byte[] value)
|
Boolean |
setbit(byte[] key,
long offset,
byte[] value)
Sets or clears the bit at offset in the string value stored at key |
String |
setex(byte[] key,
int seconds,
byte[] value)
|
Long |
setnx(byte[] key,
byte[] value)
|
Long |
setrange(byte[] key,
long offset,
byte[] value)
|
List<byte[]> |
sort(byte[] key)
|
int |
strlen(byte[] key)
|
byte[] |
substr(byte[] key,
int start,
int end)
Return a subset of the string from offset start to offset end (both offsets are inclusive). |
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 STRING
protected Map<ByteBuffer,ByteBuffer> simpleTypes
| Constructor Detail |
|---|
public StringDatatypeOperations()
| Method Detail |
|---|
public Long append(byte[] key,
byte[] value)
Time complexity: O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation.
key - value -
public Long decr(byte[] key)
INCR commands are limited to 64 bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented, and then converted back as a string.
Time complexity: O(1)
key -
incr(byte[]),
incrBy(byte[], long),
decrBy(byte[], long)
public Long decrBy(byte[] key,
long integer)
INCR but instead to
decrement by 1 the decrement is integer.
INCR commands are limited to 64 bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented, and then converted back as a string.
key - integer -
incr(byte[]),
decr(byte[]),
incrBy(byte[], long)
public Long incrBy(byte[] key,
long integer)
INCR but instead to increment
by 1 the increment is integer.
INCR commands are limited to 64 bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented, and then converted back as a string.
key - integer -
incr(byte[]),
decr(byte[]),
decrBy(byte[], long)public Long incr(byte[] key)
INCR commands are limited to 64 bit signed integers.
Note: this is actually a string operation, that is, in Redis there are not "integer" types. Simply the string stored at the key is parsed as a base 10 64 bit signed integer, incremented, and then converted back as a string.
key -
incrBy(byte[], long),
decr(byte[]),
decrBy(byte[], long)
public Boolean getbit(byte[] key,
long offset)
key - offset -
public Boolean setbit(byte[] key,
long offset,
byte[] value)
key - offset - value -
public Long setrange(byte[] key,
long offset,
byte[] value)
public byte[] getrange(byte[] key,
long startOffset,
long endOffset)
public String mset(byte[]... keysvalues)
public Long msetnx(byte[]... keysvalues)
public int strlen(byte[] key)
public String rename(byte[] oldKey,
byte[] newKey)
public List<byte[]> mget(byte[]... keys)
public byte[] get(byte[] key)
public byte[] getSet(byte[] key,
byte[] value)
public String set(byte[] key,
byte[] value)
public Long setnx(byte[] key,
byte[] value)
public String setex(byte[] key,
int seconds,
byte[] value)
public byte[] substr(byte[] key,
int start,
int end)
The function handles out of range requests without raising an error, but just limiting the resulting range to the actual length of the string.
key - start - end -
public long getNumberOfKeys()
getNumberOfKeys in interface RedisDatatypeOperationspublic void flushAllKeys()
flushAllKeys 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[]> keys()
keys in interface RedisDatatypeOperationspublic String type()
type 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 | |||||||||