Record Class WebSocketFrame
java.lang.Object
java.lang.Record
cool.scx.http.web_socket.WebSocketFrame
public record WebSocketFrame(boolean fin, boolean rsv1, boolean rsv2, boolean rsv3, WebSocketOpCode opCode, boolean masked, int payloadLength, byte[] maskingKey, byte[] payloadData)
extends Record
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionWebSocketFrame(boolean fin, boolean rsv1, boolean rsv2, boolean rsv3, WebSocketOpCode opCode, boolean masked, int payloadLength, byte[] maskingKey, byte[] payloadData) Creates an instance of aWebSocketFramerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.booleanfin()Returns the value of thefinrecord component.final inthashCode()Returns a hash code value for this object.booleanmasked()Returns the value of themaskedrecord component.byte[]Returns the value of themaskingKeyrecord component.static WebSocketFrameof(boolean fin, WebSocketOpCode opCode, byte[] payloadData) static WebSocketFrameof(boolean fin, WebSocketOpCode opCode, byte[] maskingKey, byte[] payloadData) static WebSocketFrameof(WebSocketOpCode opCode, byte[] payloadData) opCode()Returns the value of theopCoderecord component.byte[]Returns the value of thepayloadDatarecord component.intReturns the value of thepayloadLengthrecord component.booleanrsv1()Returns the value of thersv1record component.booleanrsv2()Returns the value of thersv2record component.booleanrsv3()Returns the value of thersv3record component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
WebSocketFrame
public WebSocketFrame(boolean fin, boolean rsv1, boolean rsv2, boolean rsv3, WebSocketOpCode opCode, boolean masked, int payloadLength, byte[] maskingKey, byte[] payloadData) Creates an instance of aWebSocketFramerecord class.- Parameters:
fin- the value for thefinrecord componentrsv1- the value for thersv1record componentrsv2- the value for thersv2record componentrsv3- the value for thersv3record componentopCode- the value for theopCoderecord componentmasked- the value for themaskedrecord componentpayloadLength- the value for thepayloadLengthrecord componentmaskingKey- the value for themaskingKeyrecord componentpayloadData- the value for thepayloadDatarecord component
-
-
Method Details
-
of
public static WebSocketFrame of(boolean fin, WebSocketOpCode opCode, byte[] maskingKey, byte[] payloadData) -
of
-
of
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
fin
public boolean fin()Returns the value of thefinrecord component.- Returns:
- the value of the
finrecord component
-
rsv1
public boolean rsv1()Returns the value of thersv1record component.- Returns:
- the value of the
rsv1record component
-
rsv2
public boolean rsv2()Returns the value of thersv2record component.- Returns:
- the value of the
rsv2record component
-
rsv3
public boolean rsv3()Returns the value of thersv3record component.- Returns:
- the value of the
rsv3record component
-
opCode
Returns the value of theopCoderecord component.- Returns:
- the value of the
opCoderecord component
-
masked
public boolean masked()Returns the value of themaskedrecord component.- Returns:
- the value of the
maskedrecord component
-
payloadLength
public int payloadLength()Returns the value of thepayloadLengthrecord component.- Returns:
- the value of the
payloadLengthrecord component
-
maskingKey
public byte[] maskingKey()Returns the value of themaskingKeyrecord component.- Returns:
- the value of the
maskingKeyrecord component
-
payloadData
public byte[] payloadData()Returns the value of thepayloadDatarecord component.- Returns:
- the value of the
payloadDatarecord component
-