public final class RedisMockClient extends AbstractRedisMock
IRedisSortedSet.ZsetPair| Constructor and Description |
|---|
RedisMockClient(RedisMock redisMock) |
| Modifier and Type | Method and Description |
|---|---|
Long |
append(String key,
String value)
Append value onto key.
|
Long |
bitcount(String key,
long... options)
Count the number of set bits in a string.
|
Long |
bitop(String operation,
String destkey,
String... keys)
Perform a bitwise operation between multiple keys and store the result in the destination key.
|
Long |
bitpos(String key,
long bit,
long... options)
Return the position of the first bit set to 0 or 1 in a string.
|
IRedisClient |
createClient()
Create a client.
|
Long |
decr(String key)
Decrement the number stored at key by one.
|
Long |
decrby(String key,
long decrement)
Decrement the number stored at key by the given decrement.
|
Long |
del(String... keys) |
String |
discard() |
List<Object> |
exec() |
Boolean |
exists(String key) |
Boolean |
expire(String key,
int seconds) |
Boolean |
expireat(String key,
long timestamp) |
String |
get(String key)
Get the value of a key.
|
Boolean |
getbit(String key,
long offset)
Returns the bit value at offset in the string value stored at key.
|
String |
getrange(String key,
long start,
long end)
Returns the substring of the string value stored at key, determined by the inclusive offsets
start and end.
|
String |
getset(String key,
String value)
Atomically set a key and return its previous value.
|
Long |
hdel(String key,
String field,
String... fields) |
Boolean |
hexists(String key,
String field) |
String |
hget(String key,
String field) |
Map<String,String> |
hgetall(String key) |
Long |
hincrby(String key,
String field,
long increment) |
String |
hincrbyfloat(String key,
String field,
double increment) |
Set<String> |
hkeys(String key) |
Long |
hlen(String key) |
List<String> |
hmget(String key,
String field,
String... fields) |
String |
hmset(String key,
String field,
String value,
String... fieldsvalues) |
ScanResult<Map<String,String>> |
hscan(String key,
long cursor,
String... options) |
Boolean |
hset(String key,
String field,
String value) |
Boolean |
hsetnx(String key,
String field,
String value) |
Long |
hstrlen(String key,
String field) |
List<String> |
hvals(String key) |
Long |
incr(String key)
Increment the number stored at key by one.
|
Long |
incrby(String key,
long increment)
Increment the number stored at key by the given increment.
|
String |
incrbyfloat(String key,
double increment)
Increment the number stored at key by the given increment.
|
String |
lindex(String key,
long index) |
Long |
linsert(String key,
String before_after,
String pivot,
String value) |
Long |
llen(String key) |
String |
lpop(String key) |
Long |
lpush(String key,
String element,
String... elements) |
Long |
lpushx(String key,
String element) |
List<String> |
lrange(String key,
long start,
long end) |
Long |
lrem(String key,
long count,
String element) |
String |
lset(String key,
long index,
String element) |
String |
ltrim(String key,
long start,
long end) |
String[] |
mget(String... keys)
Returns the values of all specified keys.
|
boolean |
modified(Integer hashCode,
String command,
List<Object> args) |
String |
mset(String... keyvalues)
Sets the given keys to their respective values.
|
Boolean |
msetnx(String... keyvalues)
Sets the given keys to their respective values.
|
IRedisClient |
multi() |
Boolean |
persist(String key) |
Boolean |
pexpire(String key,
long milliseconds) |
Boolean |
pexpireat(String key,
long timestamp) |
String |
psetex(String key,
long milliseconds,
String value)
Set and expire a key in milliseconds.
|
String |
rpop(String key) |
String |
rpoplpush(String source,
String dest) |
Long |
rpush(String key,
String element,
String... elements) |
Long |
rpushx(String key,
String element) |
Long |
sadd(String key,
String member,
String... members) |
Long |
scard(String key) |
Set<String> |
sdiff(String key,
String... keys) |
Long |
sdiffstore(String destination,
String key,
String... keys) |
String |
set(String key,
String value,
String... options)
Set key to hold the string value.
|
Long |
setbit(String key,
long offset,
boolean value)
Sets or clears the bit at offset in the string value stored at key.
|
String |
setex(String key,
int seconds,
String value)
Set and expire a key in seconds.
|
Long |
setnx(String key,
String value)
Set a key only if it does not already exist.
|
Long |
setrange(String key,
long offset,
String value)
Ovewrite part of the string starting at offset with value.
|
Set<String> |
sinter(String key,
String... keys) |
Long |
sinterstore(String destination,
String key,
String... keys) |
Boolean |
sismember(String key,
String member) |
Set<String> |
smembers(String key) |
Boolean |
smove(String source,
String dest,
String member) |
String |
spop(String key) |
String |
srandmember(String key) |
List<String> |
srandmember(String key,
long count) |
Long |
srem(String key,
String member,
String... members) |
ScanResult<Set<String>> |
sscan(String key,
long cursor,
String... options) |
Long |
strlen(String key)
Return the length of the string at key.
|
Set<String> |
sunion(String key,
String... keys) |
Long |
sunionstore(String destination,
String key,
String... keys) |
String |
type(String key) |
String |
unwatch() |
String |
watch(String key) |
close, dump, keys, migrate, move, object, pttl, randomkey, rename, renamenx, restore, scan, sort, ttl, zadd, zadd, zcard, zcount, zincrby, zinterstore, zlexcount, zrange, zrangebylex, zrangebyscore, zrank, zrem, zremrangebylex, zremrangebyrank, zremrangebyscore, zrevrange, zrevrangebylex, zrevrangebyscore, zrevrank, zscan, zscore, zunionstorepublic RedisMockClient(RedisMock redisMock)
public IRedisClient createClient()
IRedisClientpublic boolean modified(Integer hashCode, String command, List<Object> args)
modified in class AbstractRedisMockpublic Long del(String... keys)
del in interface IRedisKeysdel in class AbstractRedisClientpublic Boolean exists(String key)
exists in interface IRedisKeysexists in class AbstractRedisClientpublic Boolean expire(String key, int seconds)
expire in interface IRedisKeysexpire in class AbstractRedisClientpublic Boolean expireat(String key, long timestamp)
expireat in interface IRedisKeysexpireat in class AbstractRedisClientpublic Boolean persist(String key)
persist in interface IRedisKeyspersist in class AbstractRedisClientpublic Boolean pexpire(String key, long milliseconds)
pexpire in interface IRedisKeyspexpire in class AbstractRedisClientpublic Boolean pexpireat(String key, long timestamp)
pexpireat in interface IRedisKeyspexpireat in class AbstractRedisClientpublic String type(String key)
type in interface IRedisKeystype in class AbstractRedisClientpublic Long append(String key, String value) throws WrongTypeException
IRedisStringappend in interface IRedisStringappend in class AbstractRedisClientkey - The keyvalue - The valueWrongTypeException - If key is not a stringpublic Long bitcount(String key, long... options) throws WrongTypeException
IRedisStringbitcount in interface IRedisStringbitcount in class AbstractRedisClientkey - The keyoptions - start, endWrongTypeException - If key is not a stringpublic Long bitop(String operation, String destkey, String... keys) throws WrongTypeException
IRedisStringbitop in interface IRedisStringbitop in class AbstractRedisClientoperation - The operation to perform. Valid values are "and", "or", "xor", and "not".destkey - The destination key to store the operation result in.keys - The keys to operate against.WrongTypeException - If key is not a stringpublic Long bitpos(String key, long bit, long... options) throws WrongTypeException, BitArgException
IRedisStringbitpos in interface IRedisStringbitpos in class AbstractRedisClientkey - The keybit - 0|1options - start, endWrongTypeException - If key is not a stringBitArgException - If bit is not equal to 0 or 1public Long decr(String key) throws WrongTypeException, NotIntegerException
IRedisStringdecr in interface IRedisStringdecr in class AbstractRedisClientkey - The keyWrongTypeException - If key is not a stringNotIntegerException - If key does not hold an integer valuepublic Long decrby(String key, long decrement) throws WrongTypeException, NotIntegerException
IRedisStringdecrby in interface IRedisStringdecrby in class AbstractRedisClientkey - The keydecrement - The number to decrement byWrongTypeException - If key is not a stringNotIntegerException - If key does not hold an integer valuepublic String get(String key) throws WrongTypeException
IRedisStringget in interface IRedisStringget in class AbstractRedisClientkey - The keyWrongTypeException - If key is not a stringpublic Boolean getbit(String key, long offset) throws WrongTypeException
IRedisStringgetbit in interface IRedisStringgetbit in class AbstractRedisClientkey - The keyoffset - The offset within the stringWrongTypeException - If key is not a stringpublic String getrange(String key, long start, long end) throws WrongTypeException
IRedisStringgetrange in interface IRedisStringgetrange in class AbstractRedisClientkey - The keystart - The start index of the rangeend - The end index of the rangeWrongTypeException - If key is not a stringpublic String getset(String key, String value) throws WrongTypeException
IRedisStringgetset in interface IRedisStringgetset in class AbstractRedisClientkey - The keyvalue - The new valueWrongTypeException - If key is not a stringpublic Long incr(String key) throws WrongTypeException, NotIntegerException
IRedisStringincr in interface IRedisStringincr in class AbstractRedisClientkey - The keyWrongTypeException - If key is not a stringNotIntegerException - If key does not hold an integer valuepublic Long incrby(String key, long increment) throws WrongTypeException, NotIntegerException
IRedisStringincrby in interface IRedisStringincrby in class AbstractRedisClientkey - The keyincrement - The increment to increase the key byWrongTypeException - If key is not a stringNotIntegerException - If key does not hold an integer valuepublic String incrbyfloat(String key, double increment) throws WrongTypeException, NotFloatException
IRedisStringincrbyfloat in interface IRedisStringincrbyfloat in class AbstractRedisClientkey - The keyincrement - The increment to increase the key byWrongTypeException - If key is not a stringNotFloatException - If key does not hold a floating point valuepublic String[] mget(String... keys)
IRedisStringmget in interface IRedisStringmget in class AbstractRedisClientkeys - The keys to getpublic String mset(String... keyvalues) throws ArgException
IRedisStringmset in interface IRedisStringmset in class AbstractRedisClientkeyvalues - The key-value pairs to set.ArgException - If the given arguments are not validpublic Boolean msetnx(String... keyvalues) throws ArgException
IRedisStringmsetnx in interface IRedisStringmsetnx in class AbstractRedisClientkeyvalues - The key-value pairs to set.ArgException - If the given arguments are not validpublic String psetex(String key, long milliseconds, String value)
IRedisStringpsetex in interface IRedisStringpsetex in class AbstractRedisClientkey - The keymilliseconds - The expiry time in millisecondsvalue - The valuepublic String set(String key, String value, String... options) throws SyntaxErrorException
IRedisStringset in interface IRedisStringset in class AbstractRedisClientkey - The keyvalue - The valueoptions - nx|xx, ex|px timeout.SyntaxErrorException - If the given options were not valid.public Long setbit(String key, long offset, boolean value) throws WrongTypeException
IRedisStringsetbit in interface IRedisStringsetbit in class AbstractRedisClientkey - The keyoffset - The offsetvalue - Whether to set or clear the bit (set = true, clear = false)WrongTypeException - If key is not a stringpublic String setex(String key, int seconds, String value)
IRedisStringsetex in interface IRedisStringsetex in class AbstractRedisClientkey - The keyseconds - The expiry time in secondsvalue - The valuepublic Long setnx(String key, String value)
IRedisStringsetnx in interface IRedisStringsetnx in class AbstractRedisClientkey - The keyvalue - The valuepublic Long setrange(String key, long offset, String value) throws WrongTypeException
IRedisStringsetrange in interface IRedisStringsetrange in class AbstractRedisClientkey - The keyoffset - Where to start. If greater than the length of the string,
the string is padded out to the offset.value - The valueWrongTypeException - If key is not a stringpublic Long strlen(String key) throws WrongTypeException
IRedisStringstrlen in interface IRedisStringstrlen in class AbstractRedisClientkey - The keyWrongTypeException - If key is not a stringpublic String lindex(String key, long index) throws WrongTypeException
lindex in interface IRedisListlindex in class AbstractRedisClientWrongTypeExceptionpublic Long linsert(String key, String before_after, String pivot, String value) throws WrongTypeException
linsert in interface IRedisListlinsert in class AbstractRedisClientWrongTypeExceptionpublic Long llen(String key) throws WrongTypeException
llen in interface IRedisListllen in class AbstractRedisClientWrongTypeExceptionpublic String lpop(String key) throws WrongTypeException
lpop in interface IRedisListlpop in class AbstractRedisClientWrongTypeExceptionpublic Long lpush(String key, String element, String... elements) throws WrongTypeException
lpush in interface IRedisListlpush in class AbstractRedisClientWrongTypeExceptionpublic Long lpushx(String key, String element) throws WrongTypeException
lpushx in interface IRedisListlpushx in class AbstractRedisClientWrongTypeExceptionpublic List<String> lrange(String key, long start, long end) throws WrongTypeException
lrange in interface IRedisListlrange in class AbstractRedisClientWrongTypeExceptionpublic Long lrem(String key, long count, String element) throws WrongTypeException
lrem in interface IRedisListlrem in class AbstractRedisClientWrongTypeExceptionpublic String lset(String key, long index, String element) throws WrongTypeException, NoKeyException, IndexOutOfRangeException
lset in interface IRedisListlset in class AbstractRedisClientWrongTypeExceptionNoKeyExceptionIndexOutOfRangeExceptionpublic String ltrim(String key, long start, long end) throws WrongTypeException
ltrim in interface IRedisListltrim in class AbstractRedisClientWrongTypeExceptionpublic String rpop(String key) throws WrongTypeException
rpop in interface IRedisListrpop in class AbstractRedisClientWrongTypeExceptionpublic String rpoplpush(String source, String dest) throws WrongTypeException
rpoplpush in interface IRedisListrpoplpush in class AbstractRedisClientWrongTypeExceptionpublic Long rpush(String key, String element, String... elements) throws WrongTypeException
rpush in interface IRedisListrpush in class AbstractRedisClientWrongTypeExceptionpublic Long rpushx(String key, String element) throws WrongTypeException
rpushx in interface IRedisListrpushx in class AbstractRedisClientWrongTypeExceptionpublic Long sadd(String key, String member, String... members) throws WrongTypeException
sadd in interface IRedisSetsadd in class AbstractRedisClientWrongTypeExceptionpublic Long scard(String key) throws WrongTypeException
scard in interface IRedisSetscard in class AbstractRedisClientWrongTypeExceptionpublic Set<String> sdiff(String key, String... keys) throws WrongTypeException
sdiff in interface IRedisSetsdiff in class AbstractRedisClientWrongTypeExceptionpublic Long sdiffstore(String destination, String key, String... keys) throws WrongTypeException
sdiffstore in interface IRedisSetsdiffstore in class AbstractRedisClientWrongTypeExceptionpublic Set<String> sinter(String key, String... keys) throws WrongTypeException
sinter in interface IRedisSetsinter in class AbstractRedisClientWrongTypeExceptionpublic Long sinterstore(String destination, String key, String... keys) throws WrongTypeException
sinterstore in interface IRedisSetsinterstore in class AbstractRedisClientWrongTypeExceptionpublic Boolean sismember(String key, String member) throws WrongTypeException
sismember in interface IRedisSetsismember in class AbstractRedisClientWrongTypeExceptionpublic Set<String> smembers(String key) throws WrongTypeException
smembers in interface IRedisSetsmembers in class AbstractRedisClientWrongTypeExceptionpublic Boolean smove(String source, String dest, String member) throws WrongTypeException
smove in interface IRedisSetsmove in class AbstractRedisClientWrongTypeExceptionpublic String spop(String key) throws WrongTypeException
spop in interface IRedisSetspop in class AbstractRedisClientWrongTypeExceptionpublic String srandmember(String key) throws WrongTypeException
srandmember in interface IRedisSetsrandmember in class AbstractRedisClientWrongTypeExceptionpublic List<String> srandmember(String key, long count) throws WrongTypeException
srandmember in interface IRedisSetsrandmember in class AbstractRedisClientWrongTypeExceptionpublic Long srem(String key, String member, String... members) throws WrongTypeException
srem in interface IRedisSetsrem in class AbstractRedisClientWrongTypeExceptionpublic Set<String> sunion(String key, String... keys) throws WrongTypeException
sunion in interface IRedisSetsunion in class AbstractRedisClientWrongTypeExceptionpublic Long sunionstore(String destination, String key, String... keys) throws WrongTypeException
sunionstore in interface IRedisSetsunionstore in class AbstractRedisClientWrongTypeExceptionpublic ScanResult<Set<String>> sscan(String key, long cursor, String... options) throws WrongTypeException
sscan in interface IRedisSetsscan in class AbstractRedisClientWrongTypeExceptionpublic Long hdel(String key, String field, String... fields) throws WrongTypeException
hdel in interface IRedisHashhdel in class AbstractRedisClientWrongTypeExceptionpublic Boolean hexists(String key, String field) throws WrongTypeException
hexists in interface IRedisHashhexists in class AbstractRedisClientWrongTypeExceptionpublic String hget(String key, String field) throws WrongTypeException
hget in interface IRedisHashhget in class AbstractRedisClientWrongTypeExceptionpublic Map<String,String> hgetall(String key) throws WrongTypeException
hgetall in interface IRedisHashhgetall in class AbstractRedisClientWrongTypeExceptionpublic Long hincrby(String key, String field, long increment) throws WrongTypeException, NotIntegerHashException
hincrby in interface IRedisHashhincrby in class AbstractRedisClientWrongTypeExceptionNotIntegerHashExceptionpublic String hincrbyfloat(String key, String field, double increment) throws WrongTypeException, NotFloatHashException
hincrbyfloat in interface IRedisHashhincrbyfloat in class AbstractRedisClientWrongTypeExceptionNotFloatHashExceptionpublic Set<String> hkeys(String key) throws WrongTypeException
hkeys in interface IRedisHashhkeys in class AbstractRedisClientWrongTypeExceptionpublic Long hlen(String key) throws WrongTypeException
hlen in interface IRedisHashhlen in class AbstractRedisClientWrongTypeExceptionpublic List<String> hmget(String key, String field, String... fields) throws WrongTypeException
hmget in interface IRedisHashhmget in class AbstractRedisClientWrongTypeExceptionpublic String hmset(String key, String field, String value, String... fieldsvalues) throws WrongTypeException, ArgException
hmset in interface IRedisHashhmset in class AbstractRedisClientWrongTypeExceptionArgExceptionpublic Boolean hset(String key, String field, String value) throws WrongTypeException
hset in interface IRedisHashhset in class AbstractRedisClientWrongTypeExceptionpublic Boolean hsetnx(String key, String field, String value) throws WrongTypeException
hsetnx in interface IRedisHashhsetnx in class AbstractRedisClientWrongTypeExceptionpublic Long hstrlen(String key, String field) throws WrongTypeException
hstrlen in interface IRedisHashhstrlen in class AbstractRedisClientWrongTypeExceptionpublic List<String> hvals(String key) throws WrongTypeException
hvals in interface IRedisHashhvals in class AbstractRedisClientWrongTypeExceptionpublic ScanResult<Map<String,String>> hscan(String key, long cursor, String... options) throws WrongTypeException
hscan in interface IRedisHashhscan in class AbstractRedisClientWrongTypeExceptionpublic String discard() throws DiscardWithoutMultiException
discard in interface IRedisTransactiondiscard in class AbstractRedisClientDiscardWithoutMultiExceptionpublic List<Object> exec() throws ExecWithoutMultiException
exec in interface IRedisTransactionexec in class AbstractRedisClientExecWithoutMultiExceptionpublic IRedisClient multi()
multi in interface IRedisTransactionmulti in class AbstractRedisClientpublic String unwatch()
unwatch in interface IRedisTransactionunwatch in class AbstractRedisClientpublic String watch(String key)
watch in interface IRedisTransactionwatch in class AbstractRedisClientCopyright © 2015. All rights reserved.