Package io.lettuce.core.output
Class VoidOutput<K,V>
- java.lang.Object
-
- io.lettuce.core.output.CommandOutput<K,V,Void>
-
- io.lettuce.core.output.VoidOutput<K,V>
-
- Type Parameters:
K
- Key type.V
- Value type.
public class VoidOutput<K,V> extends CommandOutput<K,V,Void>
Void
command output to consume data silently without actually processing it. CreatingVoidOutput.VoidCodec
through its constructor will preserve its error decoding since decoding errors is stateful. ObtainingVoidOutput
throughcreate()
will return an instance that does not decode errors.- Since:
- 6.0.2
- Author:
- Mark Paluch
-
-
Field Summary
-
Fields inherited from class io.lettuce.core.output.CommandOutput
codec, error, output
-
-
Constructor Summary
Constructors Constructor Description VoidOutput()
Initialize a new instance that decodes errors.VoidOutput(RedisCodec<K,V> codec)
Initialize a new instance that decodes errors.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K,V>
VoidOutput<K,V>create()
Returns an instance ofVoidOutput
coerced to the expected generics.void
set(boolean value)
Update the command output with a boolean.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
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
complete, decodeAscii, get, getError, hasError, multi, multiArray, multiMap, multiPush, multiSet, setError, setError, toString
-
-
-
-
Constructor Detail
-
VoidOutput
public VoidOutput()
Initialize a new instance that decodes errors.
-
VoidOutput
public VoidOutput(RedisCodec<K,V> codec)
Initialize a new instance that decodes errors.- Parameters:
codec
- used for type inference, must not benull
.
-
-
Method Detail
-
create
public static <K,V> VoidOutput<K,V> create()
Returns an instance ofVoidOutput
coerced to the expected generics. Since this codec does not decode any data at all, it's safe to use this way. Note that this method is only suitable for fire-and-forget usage since errors are not decoded.- Type Parameters:
K
- Key type.V
- Value type.- Returns:
- the
VoidOutput
instance.
-
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,Void>
- Parameters:
bytes
- The command output, or null.
-
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,Void>
- 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,Void>
- 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,Void>
- 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,Void>
- Parameters:
number
- The command output.
-
set
public void set(boolean value)
Description copied from class:CommandOutput
Update the command output with a boolean. ConcreteCommandOutput
implementations must override this method to decodeboolean
response values.- Overrides:
set
in classCommandOutput<K,V,Void>
- Parameters:
value
- The command output.
-
-