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()
IRedis special overrides
|
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)
Determine if a command might be operating on a modified key.
|
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) |
dump, keys, migrate, move, object, pttl, randomkey, rename, renamenx, restore, scan, sort, ttl, 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()
AbstractRedisMockcreateClient in interface IRediscreateClient in class AbstractRedisMockpublic boolean modified(Integer hashCode, String command, List<Object> args)
IRedismodified in interface IRedismodified in class AbstractRedisMockhashCode - Hash code for the interested object.command - The redis command.args - Arguments to the command.public Long del(String... keys)
del in interface IRedisKeysdel in class AbstractRedisMockpublic Boolean exists(String key)
exists in interface IRedisKeysexists in class AbstractRedisMockpublic Boolean expire(String key, int seconds)
expire in interface IRedisKeysexpire in class AbstractRedisMockpublic Boolean expireat(String key, long timestamp)
expireat in interface IRedisKeysexpireat in class AbstractRedisMockpublic Boolean persist(String key)
persist in interface IRedisKeyspersist in class AbstractRedisMockpublic Boolean pexpire(String key, long milliseconds)
pexpire in interface IRedisKeyspexpire in class AbstractRedisMockpublic Boolean pexpireat(String key, long timestamp)
pexpireat in interface IRedisKeyspexpireat in class AbstractRedisMockpublic String type(String key)
type in interface IRedisKeystype in class AbstractRedisMockpublic Long append(String key, String value) throws WrongTypeException
IRedisStringappend in interface IRedisStringappend in class AbstractRedisMockkey - The keyvalue - The valueWrongTypeException - If key is not a stringpublic Long bitcount(String key, long... options) throws WrongTypeException
IRedisStringbitcount in interface IRedisStringbitcount in class AbstractRedisMockkey - 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 AbstractRedisMockoperation - 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 AbstractRedisMockkey - 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 AbstractRedisMockkey - 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 AbstractRedisMockkey - 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 AbstractRedisMockkey - The keyWrongTypeException - If key is not a stringpublic Boolean getbit(String key, long offset) throws WrongTypeException
IRedisStringgetbit in interface IRedisStringgetbit in class AbstractRedisMockkey - 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 AbstractRedisMockkey - 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 AbstractRedisMockkey - The keyvalue - The new valueWrongTypeException - If key is not a stringpublic Long incr(String key) throws WrongTypeException, NotIntegerException
IRedisStringincr in interface IRedisStringincr in class AbstractRedisMockkey - 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 AbstractRedisMockkey - 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 AbstractRedisMockkey - 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 AbstractRedisMockkeys - The keys to getpublic String mset(String... keyvalues) throws ArgException
IRedisStringmset in interface IRedisStringmset in class AbstractRedisMockkeyvalues - 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 AbstractRedisMockkeyvalues - 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 AbstractRedisMockkey - 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 AbstractRedisMockkey - 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 AbstractRedisMockkey - 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 AbstractRedisMockkey - The keyseconds - The expiry time in secondsvalue - The valuepublic Long setnx(String key, String value)
IRedisStringsetnx in interface IRedisStringsetnx in class AbstractRedisMockkey - The keyvalue - The valuepublic Long setrange(String key, long offset, String value) throws WrongTypeException
IRedisStringsetrange in interface IRedisStringsetrange in class AbstractRedisMockkey - 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 AbstractRedisMockkey - The keyWrongTypeException - If key is not a stringpublic String lindex(String key, long index) throws WrongTypeException
lindex in interface IRedisListlindex in class AbstractRedisMockWrongTypeExceptionpublic Long linsert(String key, String before_after, String pivot, String value) throws WrongTypeException
linsert in interface IRedisListlinsert in class AbstractRedisMockWrongTypeExceptionpublic Long llen(String key) throws WrongTypeException
llen in interface IRedisListllen in class AbstractRedisMockWrongTypeExceptionpublic String lpop(String key) throws WrongTypeException
lpop in interface IRedisListlpop in class AbstractRedisMockWrongTypeExceptionpublic Long lpush(String key, String element, String... elements) throws WrongTypeException
lpush in interface IRedisListlpush in class AbstractRedisMockWrongTypeExceptionpublic Long lpushx(String key, String element) throws WrongTypeException
lpushx in interface IRedisListlpushx in class AbstractRedisMockWrongTypeExceptionpublic List<String> lrange(String key, long start, long end) throws WrongTypeException
lrange in interface IRedisListlrange in class AbstractRedisMockWrongTypeExceptionpublic Long lrem(String key, long count, String element) throws WrongTypeException
lrem in interface IRedisListlrem in class AbstractRedisMockWrongTypeExceptionpublic String lset(String key, long index, String element) throws WrongTypeException, NoKeyException, IndexOutOfRangeException
lset in interface IRedisListlset in class AbstractRedisMockWrongTypeExceptionNoKeyExceptionIndexOutOfRangeExceptionpublic String ltrim(String key, long start, long end) throws WrongTypeException
ltrim in interface IRedisListltrim in class AbstractRedisMockWrongTypeExceptionpublic String rpop(String key) throws WrongTypeException
rpop in interface IRedisListrpop in class AbstractRedisMockWrongTypeExceptionpublic String rpoplpush(String source, String dest) throws WrongTypeException
rpoplpush in interface IRedisListrpoplpush in class AbstractRedisMockWrongTypeExceptionpublic Long rpush(String key, String element, String... elements) throws WrongTypeException
rpush in interface IRedisListrpush in class AbstractRedisMockWrongTypeExceptionpublic Long rpushx(String key, String element) throws WrongTypeException
rpushx in interface IRedisListrpushx in class AbstractRedisMockWrongTypeExceptionpublic Long sadd(String key, String member, String... members) throws WrongTypeException
sadd in interface IRedisSetsadd in class AbstractRedisMockWrongTypeExceptionpublic Long scard(String key) throws WrongTypeException
scard in interface IRedisSetscard in class AbstractRedisMockWrongTypeExceptionpublic Set<String> sdiff(String key, String... keys) throws WrongTypeException
sdiff in interface IRedisSetsdiff in class AbstractRedisMockWrongTypeExceptionpublic Long sdiffstore(String destination, String key, String... keys) throws WrongTypeException
sdiffstore in interface IRedisSetsdiffstore in class AbstractRedisMockWrongTypeExceptionpublic Set<String> sinter(String key, String... keys) throws WrongTypeException
sinter in interface IRedisSetsinter in class AbstractRedisMockWrongTypeExceptionpublic Long sinterstore(String destination, String key, String... keys) throws WrongTypeException
sinterstore in interface IRedisSetsinterstore in class AbstractRedisMockWrongTypeExceptionpublic Boolean sismember(String key, String member) throws WrongTypeException
sismember in interface IRedisSetsismember in class AbstractRedisMockWrongTypeExceptionpublic Set<String> smembers(String key) throws WrongTypeException
smembers in interface IRedisSetsmembers in class AbstractRedisMockWrongTypeExceptionpublic Boolean smove(String source, String dest, String member) throws WrongTypeException
smove in interface IRedisSetsmove in class AbstractRedisMockWrongTypeExceptionpublic String spop(String key) throws WrongTypeException
spop in interface IRedisSetspop in class AbstractRedisMockWrongTypeExceptionpublic String srandmember(String key) throws WrongTypeException
srandmember in interface IRedisSetsrandmember in class AbstractRedisMockWrongTypeExceptionpublic List<String> srandmember(String key, long count) throws WrongTypeException
srandmember in interface IRedisSetsrandmember in class AbstractRedisMockWrongTypeExceptionpublic Long srem(String key, String member, String... members) throws WrongTypeException
srem in interface IRedisSetsrem in class AbstractRedisMockWrongTypeExceptionpublic Set<String> sunion(String key, String... keys) throws WrongTypeException
sunion in interface IRedisSetsunion in class AbstractRedisMockWrongTypeExceptionpublic Long sunionstore(String destination, String key, String... keys) throws WrongTypeException
sunionstore in interface IRedisSetsunionstore in class AbstractRedisMockWrongTypeExceptionpublic ScanResult<Set<String>> sscan(String key, long cursor, String... options) throws WrongTypeException
sscan in interface IRedisSetsscan in class AbstractRedisMockWrongTypeExceptionpublic Long hdel(String key, String field, String... fields) throws WrongTypeException
hdel in interface IRedisHashhdel in class AbstractRedisMockWrongTypeExceptionpublic Boolean hexists(String key, String field) throws WrongTypeException
hexists in interface IRedisHashhexists in class AbstractRedisMockWrongTypeExceptionpublic String hget(String key, String field) throws WrongTypeException
hget in interface IRedisHashhget in class AbstractRedisMockWrongTypeExceptionpublic Map<String,String> hgetall(String key) throws WrongTypeException
hgetall in interface IRedisHashhgetall in class AbstractRedisMockWrongTypeExceptionpublic Long hincrby(String key, String field, long increment) throws WrongTypeException, NotIntegerHashException
hincrby in interface IRedisHashhincrby in class AbstractRedisMockWrongTypeExceptionNotIntegerHashExceptionpublic String hincrbyfloat(String key, String field, double increment) throws WrongTypeException, NotFloatHashException
hincrbyfloat in interface IRedisHashhincrbyfloat in class AbstractRedisMockWrongTypeExceptionNotFloatHashExceptionpublic Set<String> hkeys(String key) throws WrongTypeException
hkeys in interface IRedisHashhkeys in class AbstractRedisMockWrongTypeExceptionpublic Long hlen(String key) throws WrongTypeException
hlen in interface IRedisHashhlen in class AbstractRedisMockWrongTypeExceptionpublic List<String> hmget(String key, String field, String... fields) throws WrongTypeException
hmget in interface IRedisHashhmget in class AbstractRedisMockWrongTypeExceptionpublic String hmset(String key, String field, String value, String... fieldsvalues) throws WrongTypeException, ArgException
hmset in interface IRedisHashhmset in class AbstractRedisMockWrongTypeExceptionArgExceptionpublic Boolean hset(String key, String field, String value) throws WrongTypeException
hset in interface IRedisHashhset in class AbstractRedisMockWrongTypeExceptionpublic Boolean hsetnx(String key, String field, String value) throws WrongTypeException
hsetnx in interface IRedisHashhsetnx in class AbstractRedisMockWrongTypeExceptionpublic Long hstrlen(String key, String field) throws WrongTypeException
hstrlen in interface IRedisHashhstrlen in class AbstractRedisMockWrongTypeExceptionpublic List<String> hvals(String key) throws WrongTypeException
hvals in interface IRedisHashhvals in class AbstractRedisMockWrongTypeExceptionpublic ScanResult<Map<String,String>> hscan(String key, long cursor, String... options) throws WrongTypeException
hscan in interface IRedisHashhscan in class AbstractRedisMockWrongTypeExceptionpublic String discard() throws DiscardWithoutMultiException
discard in interface IRedisTransactiondiscard in class AbstractRedisMockDiscardWithoutMultiExceptionpublic List<Object> exec() throws ExecWithoutMultiException
exec in interface IRedisTransactionexec in class AbstractRedisMockExecWithoutMultiExceptionpublic IRedisClient multi()
multi in interface IRedisTransactionmulti in class AbstractRedisMockpublic String unwatch()
unwatch in interface IRedisTransactionunwatch in class AbstractRedisMockpublic String watch(String key)
watch in interface IRedisTransactionwatch in class AbstractRedisMockCopyright © 2015. All rights reserved.