public class TransformingOutput<K,V,S,T> extends CommandOutput<K,V,T>
Modifier and Type | Class and Description |
---|---|
static class |
TransformingOutput.TransformingAccessor
Accessor for the underlying output.
|
codec, error, output
Modifier and Type | Method and Description |
---|---|
void |
complete(int depth)
Mark the command output complete.
|
T |
get()
Get the command output.
|
String |
getError()
Get the error that occurred.
|
boolean |
hasError()
Check if the command resulted in an error.
|
void |
multi(int count)
Mark the beginning of a multi sequence (array).
|
void |
multiArray(int count)
Mark the beginning of a multi sequence (array).
|
void |
multiMap(int count)
Mark the beginning of a multi sequence (map).
|
void |
multiPush(int count)
Mark the beginning of a multi sequence (push-array).
|
void |
multiSet(int count)
Mark the beginning of a set.
|
void |
set(boolean value)
Update the command output with a boolean.
|
void |
set(ByteBuffer bytes)
Update the command output with a sequence of bytes, or
null . |
void |
set(double number)
Update the command output with a floating-point number.
|
void |
set(long integer)
Update the command output with a 64-bit signed integer.
|
void |
setBigNumber(ByteBuffer bytes)
Update the command output with a big number.
|
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.
|
void |
setSingle(ByteBuffer bytes)
Update the command output with a sequence of bytes, or
null representing a simple string. |
static <K,V,S,T> CommandOutput<K,V,T> |
transform(CommandOutput<K,V,S> delegate,
Function<TransformingOutput.TransformingAccessor,T> mappingFunction)
Create a new transforming output.
|
decodeAscii, toString
public static <K,V,S,T> CommandOutput<K,V,T> transform(CommandOutput<K,V,S> delegate, Function<TransformingOutput.TransformingAccessor,T> mappingFunction)
public void set(ByteBuffer bytes)
CommandOutput
null
. Concrete CommandOutput
implementations must
override this method to decode bulk
/bytes response values.set
in class CommandOutput<K,V,T>
bytes
- The command output, or null.public void setSingle(ByteBuffer bytes)
CommandOutput
null
representing a simple string. Concrete
CommandOutput
implementations must override this method to decode single
/bytes response values.setSingle
in class CommandOutput<K,V,T>
bytes
- The command output, or null.public void setBigNumber(ByteBuffer bytes)
CommandOutput
CommandOutput
implementations must override this method to
decode big number
response values.setBigNumber
in class CommandOutput<K,V,T>
bytes
- The command output, or null.public void set(long integer)
CommandOutput
CommandOutput
implementations must override this
method to decode number
(integer) response values.set
in class CommandOutput<K,V,T>
integer
- The command output.public void set(double number)
CommandOutput
CommandOutput
implementations must override this
method to decode double
response values.set
in class CommandOutput<K,V,T>
number
- The command output.public void set(boolean value)
CommandOutput
CommandOutput
implementations must override this method to
decode boolean
response values.set
in class CommandOutput<K,V,T>
value
- The command output.public void setError(ByteBuffer error)
CommandOutput
setError
in class CommandOutput<K,V,T>
error
- Error message.public void setError(String error)
CommandOutput
setError
in class CommandOutput<K,V,T>
error
- Error message.public boolean hasError()
CommandOutput
hasError
in class CommandOutput<K,V,T>
public String getError()
CommandOutput
getError
in class CommandOutput<K,V,T>
public T get()
CommandOutput
get
in class CommandOutput<K,V,T>
public void complete(int depth)
CommandOutput
complete
in class CommandOutput<K,V,T>
depth
- Remaining depth of output queue.public void multi(int count)
CommandOutput
multi
in class CommandOutput<K,V,T>
count
- expected number of elements in this multi sequence.public void multiArray(int count)
CommandOutput
multiArray
in class CommandOutput<K,V,T>
count
- expected number of elements in this multi sequence.public void multiPush(int count)
CommandOutput
multiPush
in class CommandOutput<K,V,T>
count
- expected number of elements in this multi sequence.public void multiMap(int count)
CommandOutput
multiMap
in class CommandOutput<K,V,T>
count
- expected number of elements in this multi sequence.public void multiSet(int count)
CommandOutput
multiSet
in class CommandOutput<K,V,T>
count
- expected number of elements in this multi sequence.Copyright © 2023 lettuce.io. All rights reserved.