java.lang.Object
io.lettuce.core.output.CommandOutput<K,V,List<Object>>
io.lettuce.core.output.NestedMultiOutput<K,V>
io.lettuce.core.output.PushOutput<K,V>
- All Implemented Interfaces:
PushMessage
public class PushOutput<K,V> extends NestedMultiOutput<K,V> implements PushMessage
Output for push notifications. The response output is always
List<Object> as push notifications may contain
arbitrary values. The first response element which denotes the push message type is available through type().- Since:
- 6.0
- Author:
- Mark Paluch
-
Field Summary
Fields inherited from class io.lettuce.core.output.CommandOutput
codec, error, output -
Constructor Summary
Constructors Constructor Description PushOutput(RedisCodec<K,V> codec) -
Method Summary
Modifier and Type Method Description List<Object>getContent()Returns the notification message contents.List<Object>getContent(Function<ByteBuffer,Object> decodeFunction)Returns the notification message contents by applying adecodeFunctiononByteBufferelements.StringgetType()voidset(ByteBuffer bytes)Update the command output with a sequence of bytes, ornull.voidsetSingle(ByteBuffer bytes)Update the command output with a sequence of bytes, ornullrepresenting a simple string.Stringtype()Methods inherited from class io.lettuce.core.output.NestedMultiOutput
complete, multi, set, setMethods inherited from class io.lettuce.core.output.CommandOutput
decodeAscii, get, getError, hasError, multiArray, multiMap, multiPush, multiSet, set, setBigNumber, setError, setError, toString
-
Constructor Details
-
PushOutput
-
-
Method Details
-
set
Description copied from class:CommandOutputUpdate the command output with a sequence of bytes, ornull. ConcreteCommandOutputimplementations must override this method to decodebulk/bytes response values.- Overrides:
setin classNestedMultiOutput<K,V>- Parameters:
bytes- The command output, or null.
-
setSingle
Description copied from class:CommandOutputUpdate the command output with a sequence of bytes, ornullrepresenting a simple string. ConcreteCommandOutputimplementations must override this method to decodesingle/bytes response values.- Overrides:
setSinglein classNestedMultiOutput<K,V>- Parameters:
bytes- The command output, or null.
-
type
-
getType
- Specified by:
getTypein interfacePushMessage- Returns:
- the push message type.
-
getContent
Description copied from interface:PushMessageReturns the notification message contents. The content contains all response value beginning withPushMessage.getType()using their appropriate Java representation. String data (simple and bulk) are represented asByteBufferand can be decoded throughStringCodec.decodeValue(ByteBuffer).ByteBufferobjects are read-only buffers that share the content without sharing the read-position.- Specified by:
getContentin interfacePushMessage- Returns:
- the notification message containing all response values including
PushMessage.getType().
-
getContent
Description copied from interface:PushMessageReturns the notification message contents by applying adecodeFunctiononByteBufferelements. The content contains all response value beginning withPushMessage.getType()using their appropriate Java representation. String data (simple and bulk) are mapped usingdecodeFunction. Please note that buffer read positions are tracked by this method so decode functions are not required to reset the position.- Specified by:
getContentin interfacePushMessage- Returns:
- the notification message containing all response values including
PushMessage.getType().
-