public class PushOutput<K,V> extends NestedMultiOutput<K,V> implements PushMessage
List<Object> as push notifications may contain
arbitrary values. The first response element which denotes the push message type is available through type().codec, error, output| Constructor and Description |
|---|
PushOutput(RedisCodec<K,V> codec) |
| Modifier and Type | Method and Description |
|---|---|
List<Object> |
getContent()
Returns the notification message contents.
|
List<Object> |
getContent(Function<ByteBuffer,Object> decodeFunction)
Returns the notification message contents by applying a
decodeFunction on ByteBuffer elements. |
String |
getType() |
void |
set(ByteBuffer bytes)
Update the command output with a sequence of bytes, or
null. |
void |
setSingle(ByteBuffer bytes)
Update the command output with a sequence of bytes, or
null representing a simple string. |
String |
type() |
complete, multi, set, setdecodeAscii, get, getError, hasError, multiArray, multiMap, multiPush, multiSet, set, setBigNumber, setError, setError, toStringpublic PushOutput(RedisCodec<K,V> codec)
public void set(ByteBuffer bytes)
CommandOutputnull. Concrete CommandOutput implementations must
override this method to decode bulk/bytes response values.set in class NestedMultiOutput<K,V>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 NestedMultiOutput<K,V>bytes - The command output, or null.public String type()
public String getType()
getType in interface PushMessagepublic List<Object> getContent()
PushMessagePushMessage.getType()
using their appropriate Java representation. String data (simple and bulk) are represented as ByteBuffer
and can be decoded through StringCodec.decodeValue(ByteBuffer). ByteBuffer objects
are read-only buffers that share the content without sharing the read-position.getContent in interface PushMessagePushMessage.getType().public List<Object> getContent(Function<ByteBuffer,Object> decodeFunction)
PushMessagedecodeFunction on ByteBuffer elements. The
content contains all response value beginning with PushMessage.getType() using their appropriate Java representation. String
data (simple and bulk) are mapped using decodeFunction. Please note that buffer read positions are
tracked by this method so decode functions are not required to reset the position.getContent in interface PushMessagePushMessage.getType().Copyright © 2022 lettuce.io. All rights reserved.