Record Class WebSocketFrame

java.lang.Object
java.lang.Record
cool.scx.http.peach.WebSocketFrame

public record WebSocketFrame(boolean fin, WebSocketOpCode opCode, boolean masked, int payloadLength, byte[] maskingKey, byte[] payloadData) extends Record
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    WebSocketFrame(boolean fin, WebSocketOpCode opCode, boolean masked, int payloadLength, byte[] maskingKey, byte[] payloadData)
    Creates an instance of a WebSocketFrame record class.
    WebSocketFrame(boolean fin, WebSocketOpCode opCode, byte[] payloadData)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    boolean
    fin()
    Returns the value of the fin record component.
    final int
    Returns a hash code value for this object.
    boolean
    Returns the value of the masked record component.
    byte[]
    Returns the value of the maskingKey record component.
    Returns the value of the opCode record component.
    byte[]
    Returns the value of the payloadData record component.
    int
    Returns the value of the payloadLength record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • WebSocketFrame

      public WebSocketFrame(boolean fin, WebSocketOpCode opCode, byte[] payloadData)
    • WebSocketFrame

      public WebSocketFrame(boolean fin, WebSocketOpCode opCode, boolean masked, int payloadLength, byte[] maskingKey, byte[] payloadData)
      Creates an instance of a WebSocketFrame record class.
      Parameters:
      fin - the value for the fin record component
      opCode - the value for the opCode record component
      masked - the value for the masked record component
      payloadLength - the value for the payloadLength record component
      maskingKey - the value for the maskingKey record component
      payloadData - the value for the payloadData record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • fin

      public boolean fin()
      Returns the value of the fin record component.
      Returns:
      the value of the fin record component
    • opCode

      public WebSocketOpCode opCode()
      Returns the value of the opCode record component.
      Returns:
      the value of the opCode record component
    • masked

      public boolean masked()
      Returns the value of the masked record component.
      Returns:
      the value of the masked record component
    • payloadLength

      public int payloadLength()
      Returns the value of the payloadLength record component.
      Returns:
      the value of the payloadLength record component
    • maskingKey

      public byte[] maskingKey()
      Returns the value of the maskingKey record component.
      Returns:
      the value of the maskingKey record component
    • payloadData

      public byte[] payloadData()
      Returns the value of the payloadData record component.
      Returns:
      the value of the payloadData record component