public class ComplexOutput<K,V,T> extends CommandOutput<K,V,T>
CommandOutput that is used in combination with a given ComplexDataParser to produce
a domain object from the data extracted from the server. Since there already are implementations of the CommandOutput
interface for most simple types, this implementation is better suited to parse complex, often nested, data structures, for
example a map containing other maps, arrays or sets as values for one or more of its keys.
The implementation of the ComplexDataParser is responsible for mapping the data from the result to meaningful
properties that the user of the Lettuce driver could then use in a statically typed manner.
ComplexDataParser| Modifier and Type | Field and Description |
|---|---|
protected ComplexData |
data |
codec, error, output| Constructor and Description |
|---|
ComplexOutput(RedisCodec<K,V> codec,
ComplexDataParser<T> parser)
Constructs a new instance of the
ComplexOutput |
| Modifier and Type | Method and Description |
|---|---|
void |
complete(int depth)
Mark the command output complete.
|
T |
get()
Get the command output.
|
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 |
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 |
setSingle(ByteBuffer bytes)
Update the command output with a sequence of bytes, or
null representing a simple string. |
decodeString, getError, hasError, multi, multiPush, setBigNumber, setError, setError, toStringprotected ComplexData data
public ComplexOutput(RedisCodec<K,V> codec, ComplexDataParser<T> parser)
ComplexOutputcodec - the RedisCodec to be appliedpublic T get()
CommandOutputget in class CommandOutput<K,V,T>public void set(long integer)
CommandOutputCommandOutput 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)
CommandOutputCommandOutput 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)
CommandOutputCommandOutput implementations must override this method to
decode boolean response values.set in class CommandOutput<K,V,T>value - The command output.public void set(ByteBuffer bytes)
CommandOutputnull. 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)
CommandOutputnull 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 complete(int depth)
CommandOutputcomplete in class CommandOutput<K,V,T>depth - Remaining depth of output queue.public void multiSet(int count)
CommandOutputmultiSet in class CommandOutput<K,V,T>count - expected number of elements in this multi sequence.public void multiArray(int count)
CommandOutputmultiArray in class CommandOutput<K,V,T>count - expected number of elements in this multi sequence.public void multiMap(int count)
CommandOutputmultiMap in class CommandOutput<K,V,T>count - expected number of elements in this multi sequence.Copyright © 2025 lettuce.io. All rights reserved.