public class SockJsFrame
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.nio.charset.Charset |
CHARSET
The charset used by SockJS.
|
Constructor and Description |
---|
SockJsFrame(java.lang.String content)
Create a new instance frame with the given frame content.
|
Modifier and Type | Method and Description |
---|---|
static SockJsFrame |
closeFrame(int code,
java.lang.String reason) |
static SockJsFrame |
closeFrameAnotherConnectionOpen() |
static SockJsFrame |
closeFrameGoAway() |
boolean |
equals(java.lang.Object other) |
java.lang.String |
getContent()
Return the SockJS frame content (never
null ). |
byte[] |
getContentBytes()
Return the SockJS frame content as a byte array.
|
java.lang.String |
getFrameData()
Return data contained in a SockJS "message" and "close" frames.
|
SockJsFrameType |
getType()
Return the SockJS frame type.
|
int |
hashCode() |
static SockJsFrame |
heartbeatFrame() |
static SockJsFrame |
messageFrame(SockJsMessageCodec codec,
java.lang.String... messages) |
static SockJsFrame |
openFrame() |
java.lang.String |
toString() |
public static final java.nio.charset.Charset CHARSET
public SockJsFrame(java.lang.String content)
content
- the content (must be a non-empty and represent a valid SockJS frame)public SockJsFrameType getType()
public java.lang.String getContent()
null
).public byte[] getContentBytes()
@Nullable public java.lang.String getFrameData()
null
.public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static SockJsFrame openFrame()
public static SockJsFrame heartbeatFrame()
public static SockJsFrame messageFrame(SockJsMessageCodec codec, java.lang.String... messages)
public static SockJsFrame closeFrameGoAway()
public static SockJsFrame closeFrameAnotherConnectionOpen()
public static SockJsFrame closeFrame(int code, @Nullable java.lang.String reason)