Enum Class RedisCommand
- All Implemented Interfaces:
Serializable
,Comparable<RedisCommand>
,Constable
Enumeration
of well-known Redis commands. This enumeration serves as non-exhaustive set of
built-in commands for a typical Redis server.- Since:
- 1.3
- Author:
- Christoph Strobl, Thomas Darimont, Ninad Divadkar, Mark Paluch, Oscar Cai, Sébastien Volle, John Blum
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic RedisCommand
Returns the command represented by the givenkey
, otherwise returnsUNKNOWN
if no matching command could be found.boolean
isRead()
boolean
boolean
isRepresentedBy
(String command) Compares
the givenString
representing the Redis command to theEnum.toString()
representation ofRedisCommand
as well as anyalias
.boolean
isWrite()
boolean
boolean
void
validateArgumentCount
(int argumentCount) Validates givenargument count
against expected ones.static RedisCommand
Returns the enum constant of this class with the specified name.static RedisCommand[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
APPEND
-
AUTH
-
BGREWRITEAOF
-
BGSAVE
-
BITCOUNT
-
BITOP
-
BITPOS
-
BLPOP
-
BRPOP
-
BRPOPLPUSH
-
CLIENT_KILL
-
CLIENT_LIST
-
CLIENT_GETNAME
-
CLIENT_PAUSE
-
CLIENT_SETNAME
-
CONFIG_GET
-
CONFIG_REWRITE
-
CONFIG_SET
-
CONFIG_RESETSTAT
-
DBSIZE
-
DECR
-
DECRBY
-
DEL
-
DISCARD
-
DUMP
-
ECHO
-
EVAL
-
EVALSHA
-
EXEC
-
EXISTS
-
EXPIRE
-
EXPIREAT
-
FLUSHALL
-
FLUSHDB
-
GET
-
GETBIT
-
GETRANGE
-
GETSET
-
GEOADD
-
GEODIST
-
GEOHASH
-
GEOPOS
-
GEORADIUS
-
GEORADIUSBYMEMBER
-
HDEL
-
HEXISTS
-
HGET
-
HGETALL
-
HINCRBY
-
HINCBYFLOAT
-
HKEYS
-
HLEN
-
HMGET
-
HMSET
-
HSET
-
HSETNX
-
HVALS
-
HEXPIRE
-
HEXPIREAT
-
HPEXPIRE
-
HPEXPIREAT
-
HPERSIST
-
HTTL
-
HPTTL
-
INCR
-
INCRBYFLOAT
-
INFO
-
KEYS
-
LASTSAVE
-
LINDEX
-
LINSERT
-
LLEN
-
LPOP
-
LPUSH
-
LPUSHX
-
LRANGE
-
LREM
-
LSET
-
LTRIM
-
MGET
-
MIGRATE
-
MONITOR
-
MOVE
-
MSET
-
MSETNX
-
MULTI
-
PERSIST
-
PEXPIRE
-
PEXPIREAT
-
PING
-
PSETEX
-
PSUBSCRIBE
-
PTTL
-
QUIT
-
RANDOMKEY
-
RENAME
-
RENAMENX
-
REPLICAOF
-
RESTORE
-
RPOP
-
RPOPLPUSH
-
RPUSH
-
RPUSHX
-
SADD
-
SAVE
-
SCARD
-
SCRIPT_EXISTS
-
SCRIPT_FLUSH
-
SCRIPT_KILL
-
SCRIPT_LOAD
-
SDIFF
-
SDIFFSTORE
-
SELECT
-
SET
-
SETBIT
-
SETEX
-
SETNX
-
SETRANGE
-
SHUTDOWN
-
SINTER
-
SINTERSTORE
-
SISMEMBER
-
SLAVEOF
-
SLOWLOG
-
SMEMBERS
-
SMOVE
-
SORT
-
SPOP
-
SRANDMEMBER
-
SREM
-
STRLEN
-
SUBSCRIBE
-
SUNION
-
SUNIONSTORE
-
SYNC
-
TIME
-
TTL
-
TYPE
-
UNSUBSCRIBE
-
UNWATCH
-
WATCH
-
ZADD
-
ZCARD
-
ZCOUNT
-
ZINCRBY
-
ZINTERSTORE
-
ZRANGE
-
ZRANGEBYSCORE
-
ZRANK
-
ZREM
-
ZREMRANGEBYRANK
-
ZREMRANGEBYSCORE
-
ZREVRANGE
-
ZREVRANGEBYSCORE
-
ZREVRANK
-
ZSCORE
-
ZUNIONSTORE
-
SCAN
-
SSCAN
-
HSCAN
-
ZSCAN
-
UNKNOWN
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
failsafeCommandLookup
Returns the command represented by the givenkey
, otherwise returnsUNKNOWN
if no matching command could be found.- Parameters:
key
-key
to theRedisCommand
to lookup.- Returns:
- a matching
RedisCommand
for the givenkey
, otherwiseUNKNOWN
.
-
requiresArguments
public boolean requiresArguments()- Returns:
- true if the command requires arguments
-
requiresExactNumberOfArguments
public boolean requiresExactNumberOfArguments()- Returns:
- true if an exact number of arguments is expected.
-
isRead
public boolean isRead()- Returns:
- true if the command triggers a read operation
-
isWrite
public boolean isWrite()- Returns:
- true if the command triggers a write operation
-
isReadonly
public boolean isReadonly()- Returns:
- true if values are read but not written
-
isRepresentedBy
Compares
the givenString
representing the Redis command to theEnum.toString()
representation ofRedisCommand
as well as anyalias
.- Parameters:
command
-String
representation of the Redis command to match.- Returns:
- true if a positive match.
-
validateArgumentCount
public void validateArgumentCount(int argumentCount) Validates givenargument count
against expected ones.- Parameters:
argumentCount
-number of arguments
passed to the Redis command.- Throws:
IllegalArgumentException
- if the givenargument count
does not match expected.
-