Interface WebSocketPayloadCodec

All Known Implementing Classes:
ModelWebSocketCodec, TrackingWebSocketCodec

public interface WebSocketPayloadCodec
Optional compact representation for a protocol-specific websocket payload.

Implementations return null for values or transport formats they do not own. The generic transport then falls back to its regular JSON or CBOR representation.

  • Method Summary

    Modifier and Type
    Method
    Description
    tryDecode(byte[] bytes, WebSocketTransportFormat format)
    Returns the decoded value, or null when the bytes do not belong to this codec.
    byte[]
    Returns a compact representation, or null when this codec does not own the value.
    default byte[]
    tryEncode(JsonType value, WebSocketTransportFormat format, boolean routedEnvelopes)
    Encodes with the peer's native envelope capability; existing custom codecs keep their own representation.