|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.lambdaworks.redis.protocol.CommandOutput<K,V,T>
T - Output type.public abstract class CommandOutput<K,V,T>
Abstract representation of the output of a redis command.
| Field Summary | |
|---|---|
protected RedisCodec<K,V> |
codec
|
protected String |
error
|
protected T |
output
|
| Constructor Summary | |
|---|---|
CommandOutput(RedisCodec<K,V> codec,
T output)
Initialize a new instance that encodes and decodes keys and values using the supplied codec. |
|
| Method Summary | |
|---|---|
void |
complete(int depth)
Mark the command output complete. |
protected String |
decodeAscii(ByteBuffer bytes)
|
T |
get()
Get the command output. |
String |
getError()
Get the error that occurred. |
boolean |
hasError()
Check if the command resulted in an error. |
void |
set(ByteBuffer bytes)
Set the command output to a sequence of bytes, or null. |
void |
set(long integer)
Set the command output to a 64-bit signed integer. |
void |
setError(ByteBuffer error)
Set command output to an error message from the server. |
void |
setError(String error)
Set command output to an error message from the client. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected RedisCodec<K,V> codec
protected T output
protected String error
| Constructor Detail |
|---|
public CommandOutput(RedisCodec<K,V> codec,
T output)
codec - Codec used to encode/decode keys and values.output - Initial value of output.| Method Detail |
|---|
public T get()
public void set(ByteBuffer bytes)
CommandOutput implementations must override this method
unless they only receive an integer value which cannot be null.
bytes - The command output, or null.public void set(long integer)
CommandOutput implementations must override this method
unless they only receive a byte array value.
integer - The command output.public void setError(ByteBuffer error)
error - Error message.public void setError(String error)
error - Error message.public boolean hasError()
public String getError()
public void complete(int depth)
depth - Remaining depth of output queue.protected String decodeAscii(ByteBuffer bytes)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||