See static factory methods in WebSocketSession for creating messages with
the org. for the session.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| public static enum | WebSocketMessage.
WebSocket message types. |
| Modifier and Type | Field and Description |
|---|---|
| private final Object | |
| private final DataBuffer | |
| private static final boolean | |
| private final WebSocketMessage. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | WebSocketMessage(WebSocketMessage.
the type of WebSocket message type,the message content payload, Object the message from the API of the underlying WebSocket
library, if applicable. nativeMessage)Constructor for an inbound message with access to the underlying message. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. other)Overrides java. Indicates whether some other object is "equal to" this one. |
| public < the type to cast the underlying message to T> T | Returns: the underlying message, ornullReturn the message from the API of the underlying WebSocket library. |
| public DataBuffer | |
| public String | getPayloadAsText()
A variant of |
| public String | getPayloadAsText(Charset
the character encoding charset)A shortcut for decoding the raw content of the message to text with the given character encoding. |
| public WebSocketMessage. | |
| public int | |
| public void | release()
Release the payload |
| public WebSocketMessage | retain()
Retain the data buffer for the message payload, which is useful on runtimes (e.g. Netty) with pooled buffers. |
| public String |
| nativeMessage | back to summary |
|---|---|
| private final Object nativeMessage
| |
| payload | back to summary |
|---|---|
| private final DataBuffer payload | |
| reactorNetty2Present | back to summary |
|---|---|
| private static final boolean reactorNetty2Present | |
| type | back to summary |
|---|---|
| private final WebSocketMessage. | |
| WebSocketMessage | back to summary |
|---|---|
| public WebSocketMessage(WebSocketMessage. Constructor for a WebSocketMessage. See static factory methods in | |
| WebSocketMessage | back to summary |
|---|---|
| public WebSocketMessage(WebSocketMessage. Constructor for an inbound message with access to the underlying message.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object other) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getNativeMessage | back to summary |
|---|---|
| public <T> T getNativeMessage() Return the message from the API of the underlying WebSocket library. This is applicable for inbound messages only and when the underlying message has additional fields other than the content. Currently this is the case for Reactor Netty only.
| |
| getPayload | back to summary |
|---|---|
| public DataBuffer getPayload() Return the message payload. | |
| getPayloadAsText | back to summary |
|---|---|
| public String getPayloadAsText() A variant of | |
| getPayloadAsText | back to summary |
|---|---|
| public String getPayloadAsText(Charset charset) A shortcut for decoding the raw content of the message to text with the given character encoding. This is useful for text WebSocket messages, or otherwise when the payload is expected to contain text.
| |
| getType | back to summary |
|---|---|
| public WebSocketMessage. Return the message type (text, binary, etc). | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| release | back to summary |
|---|---|
| public void release() Release the payload DataBuffer payload = message.getPayload(); DataBufferUtils.release(payload);
| |
| retain | back to summary |
|---|---|
| public WebSocketMessage retain() Retain the data buffer for the message payload, which is useful on runtimes (e.g. Netty) with pooled buffers. A shortcut for: DataBuffer payload = message.getPayload(); DataBufferUtils.retain(payload);
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static WebSocketMessage |
| ReactorNetty2Helper | back to summary |
|---|---|
| private ReactorNetty2Helper() | |
| retain | back to summary |
|---|---|
| pack-priv static WebSocketMessage retain(WebSocketMessage message) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final WebSocketMessage. | BINARY
Binary WebSocket message. |
| public static final WebSocketMessage. | PING
WebSocket ping. |
| public static final WebSocketMessage. | PONG
WebSocket pong. |
| public static final WebSocketMessage. | TEXT
Text WebSocket message. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static WebSocketMessage. | |
| public static WebSocketMessage. |
| BINARY | back to summary |
|---|---|
| public static final WebSocketMessage. Binary WebSocket message. | |
| PING | back to summary |
|---|---|
| public static final WebSocketMessage. WebSocket ping. | |
| PONG | back to summary |
|---|---|
| public static final WebSocketMessage. WebSocket pong. | |
| TEXT | back to summary |
|---|---|
| public static final WebSocketMessage. Text WebSocket message. | |
| Type | back to summary |
|---|---|
| private Type() | |
| valueOf | back to summary |
|---|---|
| public static WebSocketMessage. | |
| values | back to summary |
|---|---|
| public static WebSocketMessage. | |