- 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 RedisCommandReturns the command represented by the givenkey, otherwise returnsUNKNOWNif no matching command could be found.booleanisRead()booleanbooleanisRepresentedBy(String command) Comparesthe givenStringrepresenting the Redis command to theEnum.toString()representation ofRedisCommandas well as anyalias.booleanisWrite()booleanbooleanvoidvalidateArgumentCount(int argumentCount) Validates givenargument countagainst expected ones.static RedisCommandReturns 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
-
BITFIELD
-
BITFIELD_RO
-
BITOP
-
BITPOS
-
BLMOVE
-
BLMPOP
-
BLPOP
-
BRPOP
-
BRPOPLPUSH
-
BZMPOP
-
BZPOPMAX
-
BZPOPMIN
-
CLIENT_GETREDIR
-
CLIENT_ID
-
CLIENT_INFO
-
CLIENT_KILL
-
CLIENT_LIST
-
CLIENT_GETNAME
-
CLIENT_PAUSE
-
CLIENT_SETINFO
-
CLIENT_SETNAME
-
CLIENT_NO_EVICT
-
CLIENT_NO_TOUCH
-
CLIENT_TRACKING
-
CONFIG_GET
-
CONFIG_REWRITE
-
CONFIG_SET
-
CONFIG_RESETSTAT
-
COPY
-
DBSIZE
-
DECR
-
DECRBY
-
DEL
-
DISCARD
-
DUMP
-
ECHO
-
EVAL
-
EVAL_RO
-
EVALSHA
-
EVALSHA_RO
-
EXEC
-
EXISTS
-
EXPIRE
-
EXPIREAT
-
EXPIRETIME
-
FCALL
-
FCALL_RO
-
FLUSHALL
-
FLUSHDB
-
FUNCTION_DELETE
-
FUNCTION_DUMP
-
FUNCTION_FLUSH
-
FUNCTION_KILL
-
GET
-
GETBIT
-
GETDEL
-
GETEX
-
GETRANGE
-
GETSET
-
GEOADD
-
GEODIST
-
GEOHASH
-
GEOPOS
-
GEORADIUS
-
GEORADIUS_RO
-
GEORADIUSBYMEMBER
-
GEORADIUSBYMEMBER_RO
-
GEOSEARCH
-
GEOSEARCH_STORE
-
HDEL
-
HELLO
-
HEXISTS
-
HGET
-
HGETALL
-
HGETDEL
-
HGETEX
-
HINCRBY
-
HINCBYFLOAT
-
HKEYS
-
HLEN
-
HMGET
-
HMSET
-
HPOP
-
HSET
-
HSETNX
-
HVALS
-
HEXPIRE
-
HEXPIREAT
-
HPEXPIRE
-
HPEXPIREAT
-
HPEXPIRETIME
-
HPERSIST
-
HTTL
-
HPTTL
-
HSCAN
-
HSTRLEN
-
INCR
-
INCRBY
-
INCRBYFLOAT
-
INFO
-
KEYS
-
LCS
-
LASTSAVE
-
LINDEX
-
LINSERT
-
LLEN
-
LMOVE
-
LMPOP
-
LPOP
-
LPOS
-
LPUSH
-
LPUSHX
-
LRANGE
-
LREM
-
LSET
-
LTRIM
-
MGET
-
MIGRATE
-
MONITOR
-
MOVE
-
MSET
-
MSETNX
-
MULTI
-
PERSIST
-
PEXPIRE
-
PEXPIREAT
-
PEXPIRETIME
-
PFADD
-
PFCOUNT
-
PFMERGE
-
PING
-
PSETEX
-
PSUBSCRIBE
-
PTTL
-
QUIT
-
RANDOMKEY
-
READONLY
-
READWRITE
-
RENAME
-
RENAMENX
-
REPLICAOF
-
RESTORE
-
RPOP
-
RPOPLPUSH
-
RPUSH
-
RPUSHX
-
SADD
-
SAVE
-
SCAN
-
SCARD
-
SCRIPT_EXISTS
-
SCRIPT_FLUSH
-
SCRIPT_KILL
-
SCRIPT_LOAD
-
SDIFF
-
SDIFFSTORE
-
SELECT
-
SET
-
SETBIT
-
SETEX
-
SETNX
-
SETRANGE
-
SHUTDOWN
-
SINTER
-
SINTERCARD
-
SINTERSTORE
-
SISMEMBER
-
SLAVEOF
-
SLOWLOG
-
SMEMBERS
-
SMOVE
-
SORT
-
SORT_RO
-
SPOP
-
SRANDMEMBER
-
SREM
-
SSCAN
-
STRLEN
-
SUBSCRIBE
-
SUBSTR
-
SUNION
-
SUNIONSTORE
-
SYNC
-
TIME
-
TTL
-
TYPE
-
UNLINK
-
UNSUBSCRIBE
-
UNWATCH
-
VADD
-
VCARD
-
VDIM
-
VEMB
-
VISMEMBER
-
VLINKS
-
VRANDMEMBER
-
VREM
-
VSIM
-
WATCH
-
ZADD
-
ZCARD
-
ZCOUNT
-
ZINCRBY
-
ZINTERSTORE
-
ZRANGE
-
ZRANGEBYSCORE
-
ZRANK
-
ZREM
-
ZREMRANGEBYRANK
-
ZREMRANGEBYSCORE
-
ZREVRANGE
-
ZREVRANGEBYSCORE
-
ZREVRANK
-
ZSCORE
-
ZUNIONSTORE
-
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 returnsUNKNOWNif no matching command could be found.- Parameters:
key-keyto theRedisCommandto lookup.- Returns:
- a matching
RedisCommandfor 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
Comparesthe givenStringrepresenting the Redis command to theEnum.toString()representation ofRedisCommandas well as anyalias.- Parameters:
command-Stringrepresentation of the Redis command to match.- Returns:
- true if a positive match.
-
validateArgumentCount
public void validateArgumentCount(int argumentCount) Validates givenargument countagainst expected ones.- Parameters:
argumentCount-number of argumentspassed to the Redis command.- Throws:
IllegalArgumentException- if the givenargument countdoes not match expected.
-