Package io.lettuce.core.output
Class MultiOutput<K,V>
- java.lang.Object
-
- io.lettuce.core.output.CommandOutput<K,V,TransactionResult>
-
- io.lettuce.core.output.MultiOutput<K,V>
-
- Type Parameters:
K
- Key type.V
- Value type.
public class MultiOutput<K,V> extends CommandOutput<K,V,TransactionResult>
Output of all commands within a MULTI block.- Author:
- Will Glozer, Mark Paluch
-
-
Field Summary
-
Fields inherited from class io.lettuce.core.output.CommandOutput
codec, error, output
-
-
Constructor Summary
Constructors Constructor Description MultiOutput(RedisCodec<K,V> codec)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(RedisCommand<K,V,?> cmd)
void
cancel()
void
complete(int depth)
Mark the command output complete.TransactionResult
get()
Get the command output.void
multi(int count)
Mark the beginning of a multi sequence (array).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
set(ByteBuffer bytes)
Update the command output with a sequence of bytes, ornull
.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
setSingle(ByteBuffer bytes)
Update the command output with a sequence of bytes, ornull
representing a simple string.-
Methods inherited from class io.lettuce.core.output.CommandOutput
decodeAscii, getError, hasError, multiArray, multiMap, multiPush, multiSet, set, setError, toString
-
-
-
-
Constructor Detail
-
MultiOutput
public MultiOutput(RedisCodec<K,V> codec)
-
-
Method Detail
-
add
public void add(RedisCommand<K,V,?> cmd)
-
cancel
public void cancel()
-
set
public void set(long integer)
Description copied from class:CommandOutput
Update the command output with a 64-bit signed integer. ConcreteCommandOutput
implementations must override this method to decodenumber
(integer) response values.- Overrides:
set
in classCommandOutput<K,V,TransactionResult>
- Parameters:
integer
- The command output.
-
setSingle
public void setSingle(ByteBuffer bytes)
Description copied from class:CommandOutput
Update the command output with a sequence of bytes, ornull
representing a simple string. ConcreteCommandOutput
implementations must override this method to decodesingle
/bytes response values.- Overrides:
setSingle
in classCommandOutput<K,V,TransactionResult>
- Parameters:
bytes
- The command output, or null.
-
setBigNumber
public void setBigNumber(ByteBuffer bytes)
Description copied from class:CommandOutput
Update the command output with a big number. ConcreteCommandOutput
implementations must override this method to decodebig number
response values.- Overrides:
setBigNumber
in classCommandOutput<K,V,TransactionResult>
- Parameters:
bytes
- The command output, or null.
-
set
public void set(double number)
Description copied from class:CommandOutput
Update the command output with a floating-point number. ConcreteCommandOutput
implementations must override this method to decodedouble
response values.- Overrides:
set
in classCommandOutput<K,V,TransactionResult>
- Parameters:
number
- The command output.
-
set
public void set(ByteBuffer bytes)
Description copied from class:CommandOutput
Update the command output with a sequence of bytes, ornull
. ConcreteCommandOutput
implementations must override this method to decodebulk
/bytes response values.- Overrides:
set
in classCommandOutput<K,V,TransactionResult>
- Parameters:
bytes
- The command output, or null.
-
multi
public void multi(int count)
Description copied from class:CommandOutput
Mark the beginning of a multi sequence (array).- Overrides:
multi
in classCommandOutput<K,V,TransactionResult>
- Parameters:
count
- expected number of elements in this multi sequence.
-
setError
public void setError(ByteBuffer error)
Description copied from class:CommandOutput
Set command output to an error message from the server.- Overrides:
setError
in classCommandOutput<K,V,TransactionResult>
- Parameters:
error
- Error message.
-
complete
public void complete(int depth)
Description copied from class:CommandOutput
Mark the command output complete.- Overrides:
complete
in classCommandOutput<K,V,TransactionResult>
- Parameters:
depth
- Remaining depth of output queue.
-
get
public TransactionResult get()
Description copied from class:CommandOutput
Get the command output.- Overrides:
get
in classCommandOutput<K,V,TransactionResult>
- Returns:
- The command output.
-
-