public class RedisCommandInfo extends Object
Modifier and Type | Class and Description |
---|---|
static class |
RedisCommandInfo.CommandStatus
Enumerates the CommandStatus which is expected to be SUCCESS on normal execution.
|
static class |
RedisCommandInfo.ResultType
Enumerates the Result Types of Redis
|
Constructor and Description |
---|
RedisCommandInfo(DataHandler pdataHandler,
Object pmetaData,
RedisCommand pcommand,
Object... pparams)
Creates a Redis CommandInfo Object
|
RedisCommandInfo(DataHandler pdataHandler,
RedisCommand pcommand,
Object... pparams)
Creates a Redis CommandInfo Object
|
RedisCommandInfo(Object pmetaData,
RedisCommand pcommand,
Object... pparams)
Creates a Redis CommandInfo Object which uses the Default Data Handler of the
AsyncRedisConnection . |
RedisCommandInfo(RedisCommand pcommand,
Object... pparams)
Creates a Redis CommandInfo Object which uses the Default Data Handler of the
AsyncRedisConnection . |
Modifier and Type | Method and Description |
---|---|
void |
addDebug(String message)
Utility to add a Debug message to the Command.
|
byte |
getByteResult(byte def)
Converts the result to a byte
|
byte |
getByteResult(Object res,
byte def)
Converts any result Object to a byte
|
RedisCommand |
getCommand()
Gets the command
|
RedisCommand |
getCommandRun()
Returns the actual command that was attempted to run.
|
DataHandler |
getDataHandler()
Gets the data handler
|
StringBuffer |
getDebugBuf()
Gets the debug buf in use
|
double |
getDoubleResult(double def)
Converts the result to a double value
|
double |
getDoubleResult(Object res,
double def)
Converts any result Object to a double value
|
Throwable |
getError()
Gets the exception that was encountered
|
float |
getFloatResult(float def)
Converts the result to a float
|
float |
getFloatResult(Object res,
float def)
Converts any result Object to a float
|
int |
getIntResult(int def)
Converts the result to an int
|
static int |
getIntResult(Object res,
int def)
Converts any result Object to an int
|
long |
getLongResult(long def)
Converts the result to a long
|
long |
getLongResult(Object res,
long def)
Converts any result Object to a long
|
ResultTypeInfo[] |
getMbResultTypes()
In case the ResultType returned by getResultType is MULTIBULK this method returns the ResultTypes in
the response.
|
Object[] |
getParams()
Gets the command parameters
|
Object |
getResult()
Gets the result.
|
RedisCommandInfo.ResultType |
getResultType()
Gets the Type of the Result.
|
RedisCommandInfo.CommandStatus |
getRunStatus()
Gets the Run Status to indicate whether the command ran successfully or if there was an error.
|
short |
getShortResult(Object res,
short def)
Converts any result Object to a short value
|
short |
getShortResult(short def)
Converts the result to a short value
|
void |
setDebugBuf(StringBuffer pdebugBuf)
Sets a StringBuffer for debuging purposes.
|
public RedisCommandInfo(DataHandler pdataHandler, Object pmetaData, RedisCommand pcommand, Object... pparams)
pdataHandler
- Data Handler to usepmetaData
- Meta Data for the Data handler if requiredpcommand
- The Redis Command to runpparams
- Parameters for the Redis Commandpublic RedisCommandInfo(DataHandler pdataHandler, RedisCommand pcommand, Object... pparams)
pdataHandler
- Data Handler to usepcommand
- The Redis Command to runpparams
- Parameters for the Redis Commandpublic RedisCommandInfo(Object pmetaData, RedisCommand pcommand, Object... pparams)
AsyncRedisConnection
.pmetaData
- Meta Data for the Data handler if requiredpcommand
- The Redis Command to runpparams
- Parameters for the Redis Commandpublic RedisCommandInfo(RedisCommand pcommand, Object... pparams)
AsyncRedisConnection
.pcommand
- The Redis Command to runpparams
- Parameters for the Redis Commandpublic void addDebug(String message)
message
- Message to append. A new line is added after the message.public RedisCommandInfo.ResultType getResultType()
public Object getResult()
public ResultTypeInfo[] getMbResultTypes()
public static int getIntResult(Object res, int def)
res
- Result Objectdef
- Default value to return in case the result is null or not an Integerpublic int getIntResult(int def)
def
- Default value to return in case the result is null or not an Integerpublic long getLongResult(Object res, long def)
res
- Result Objectdef
- Default value to return in case the result is null or not a Longpublic long getLongResult(long def)
def
- Default value to return in case the result is null or not a Longpublic short getShortResult(Object res, short def)
res
- Result Objectdef
- Default value to return in case the result is null or not a Short intpublic short getShortResult(short def)
def
- Default value to return in case the result is null or not a Short intpublic byte getByteResult(Object res, byte def)
res
- Result Objectdef
- Default value to return in case the result is null or not a Bytepublic byte getByteResult(byte def)
def
- Default value to return in case the result is null or not a Bytepublic double getDoubleResult(Object res, double def)
res
- Result Objectdef
- Default value to return in case the result is null or not a Doublepublic double getDoubleResult(double def)
def
- Default value to return in case the result is null or not a Doublepublic float getFloatResult(Object res, float def)
res
- Result Objectdef
- Default value to return in case the result is null or not a Floatpublic float getFloatResult(float def)
def
- Default value to return in case the result is null or not a Floatpublic RedisCommand getCommand()
public RedisCommand getCommandRun()
RedisCommand.EVALCHECK
in which case it is either EVAL
or EVALSHA.public Object[] getParams()
public DataHandler getDataHandler()
public RedisCommandInfo.CommandStatus getRunStatus()
public Throwable getError()
public StringBuffer getDebugBuf()
public void setDebugBuf(StringBuffer pdebugBuf)
pdebugBuf
- Debug Buffer to useCopyright © 2013- Suresh Mahalingam. All Rights Reserved.