Package Torello.Browser
Class Network.WebSocketFrame
- java.lang.Object
-
- Torello.Java.JSON.BaseType
-
- Torello.Browser.Network.WebSocketFrame
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- Network
public static class Network.WebSocketFrame extends BaseType implements java.io.Serializable
WebSocket message data. This represents an entire WebSocket message, not just a fragmented frame as the name suggests.- See Also:
- Serialized Form
Hi-Lited Source-Code:- View Here: Torello/Browser/Network.java
- Open New Browser-Tab: Torello/Browser/Network.java
File Size: 3,281 Bytes Line Count: 84 '\n' Characters Found
-
-
Field Summary
Serializable ID Modifier and Type Field protected static long
serialVersionUID
For Object Serialization.Type Properties Modifier and Type Field boolean
mask
WebSocket message mask.Number
opcode
WebSocket message opcode.String
payloadData
WebSocket message payload data.
-
Constructor Summary
Constructors Constructor Description WebSocketFrame(Number opcode, boolean mask, String payloadData)
ConstructorWebSocketFrame(JsonObject jo)
JSON Object Constructor
-
Method Summary
Generate Array that Indicates which Parameter are Optional Modifier and Type Method boolean[]
optionals()
Implementing this method allows sub-classes to specify which JSON Properties may be absent or null.Methods: class java.lang.Object Modifier and Type Method boolean
equals(Object other)
Checks whether'this'
equals an input Java-Object
int
hashCode()
Generates a Hash-Code for'this'
instance
-
-
-
Field Detail
-
serialVersionUID
protected static final long serialVersionUID
For Object Serialization. java.io.Serializable- See Also:
- Constant Field Values
-
opcode
public final java.lang.Number opcode
WebSocket message opcode.
-
mask
public final boolean mask
WebSocket message mask.
-
payloadData
public final java.lang.String payloadData
WebSocket message payload data. If the opcode is 1, this is a text message and payloadData is a UTF-8 string. If the opcode isn't 1, then payloadData is a base64 encoded string representing binary data.
-
-
Constructor Detail
-
WebSocketFrame
public WebSocketFrame(java.lang.Number opcode, boolean mask, java.lang.String payloadData)
Constructor- Parameters:
opcode
- WebSocket message opcode.mask
- WebSocket message mask.payloadData
- WebSocket message payload data. If the opcode is 1, this is a text message and payloadData is a UTF-8 string. If the opcode isn't 1, then payloadData is a base64 encoded string representing binary data.
-
WebSocketFrame
public WebSocketFrame(JsonObject jo)
JSON Object Constructor- Parameters:
jo
- A Json-Object having data about an instance of'WebSocketFrame'
.
-
-
Method Detail
-
optionals
public boolean[] optionals()
Description copied from class:BaseType
Implementing this method allows sub-classes to specify which JSON Properties may be absent or null. When binding aJsonObject
to a Java-Object, if some of the expected fields for the Java-Object map to Properties which might be left-out or omitted, then that may be indicated by setting that fields array positionTRUE
.
NOTE: This array should have a length equal to the number of fields contained by the Java Object. The first boolean in the array should specify whether the first Object Field may by absent. The second boolean should specify whether the second Object Field is optional in the JSON - and so on and so forth...
-
equals
public boolean equals(java.lang.Object other)
Checks whether'this'
equals an input Java-Object
- Overrides:
equals
in classjava.lang.Object
- Code:
- Exact Method Body:
if (other == null) return false; if (other.getClass() != this.getClass()) return false; WebSocketFrame o = (WebSocketFrame) other; return Objects.equals(this.opcode, o.opcode) && (this.mask == o.mask) && Objects.equals(this.payloadData, o.payloadData);
-
hashCode
public int hashCode()
Generates a Hash-Code for'this'
instance- Overrides:
hashCode
in classjava.lang.Object
- Code:
- Exact Method Body:
return Objects.hashCode(this.opcode) + (this.mask ? 1 : 0) + Objects.hashCode(this.payloadData);
-
-