Class 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&lt;Object&gt; 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
    • Constructor Detail

      • PushOutput

        public PushOutput​(RedisCodec<K,​V> codec)
    • Method Detail

      • set

        public void set​(ByteBuffer bytes)
        Description copied from class: CommandOutput
        Update the command output with a sequence of bytes, or null. Concrete CommandOutput implementations must override this method to decode bulk/bytes response values.
        Overrides:
        set in class NestedMultiOutput<K,​V>
        Parameters:
        bytes - The command output, or null.
      • setSingle

        public void setSingle​(ByteBuffer bytes)
        Description copied from class: CommandOutput
        Update the command output with a sequence of bytes, or null representing a simple string. Concrete CommandOutput implementations must override this method to decode single/bytes response values.
        Overrides:
        setSingle in class NestedMultiOutput<K,​V>
        Parameters:
        bytes - The command output, or null.
      • getContent

        public List<Object> getContent​(Function<ByteBuffer,​Object> decodeFunction)
        Description copied from interface: PushMessage
        Returns the notification message contents by applying a decodeFunction 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.
        Specified by:
        getContent in interface PushMessage
        Returns:
        the notification message containing all response values including PushMessage.getType().