Record Class Http3Frame.Unknown

java.lang.Object
java.lang.Record
org.microproxy.frames.Http3Frame.Unknown
Record Components:
type - the type code
payload - the payload, not copied
All Implemented Interfaces:
Http3Frame, HttpFrame
Enclosing interface:
Http3Frame

public static record Http3Frame.Unknown(long type, byte[] payload) extends Record implements Http3Frame
A frame of an extension or reserved type, such as a grease frame (type 0x1f * N + 0x21) or PRIORITY_UPDATE (RFC 9218).
  • Constructor Details

    • Unknown

      public Unknown(long type, byte[] payload)
      Creates an extension frame.
      Parameters:
      type - the type code: 0 to 2^62-1, not a type HTTP/3 defines (0x00, 0x01, 0x03, 0x04, 0x05, 0x07, 0x0d) or forbids as HTTP/2's (0x02, 0x06, 0x08, 0x09)
      payload - the payload, not copied
  • Method Details

    • typeName

      public String typeName()
      Description copied from interface: HttpFrame
      The frame type's name as the protocol's RFC spells it (DATA, HEADERS, SETTINGS, ...), or UNKNOWN for an extension or reserved type.
      Specified by:
      typeName in interface HttpFrame
      Returns:
      the frame type name
    • typeCode

      public long typeCode()
      Description copied from interface: HttpFrame
      The frame type's code on the wire.
      Specified by:
      typeCode in interface HttpFrame
      Returns:
      the unsigned type code
    • isReserved

      public boolean isReserved()
      Whether the type is reserved for greasing (0x1f * N + 0x21).
      Returns:
      whether the frame is grease
    • withPayload

      public Http3Frame.Unknown withPayload(byte[] newPayload)
      This frame with another payload.
      Parameters:
      newPayload - the new payload
      Returns:
      a copy with it
    • equals

      public boolean equals(Object o)
      Compares the payload's content, not the array's identity.
      Specified by:
      equals in class Record
    • hashCode

      public 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
    • toString

      public 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
    • type

      public long type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • payload

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