Record Class Frame.GoAway

java.lang.Object
java.lang.Record
io.github.mahmoudimus.http2.Frame.GoAway
Record Components:
lastStreamId - the last peer-initiated stream that might have been processed
errorCode - the raw 32-bit error code
debugData - the diagnostic bytes, retained without copying
All Implemented Interfaces:
Frame
Enclosing interface:
Frame

public static record Frame.GoAway(int lastStreamId, int errorCode, byte[] debugData) extends Record implements Frame
GOAWAY (§6.8). errorCode is the raw wire value; see error().
  • Constructor Details

    • GoAway

      public GoAway(int lastStreamId, int errorCode, byte[] debugData)
      Creates GOAWAY with a nonnegative last stream identifier.
      Parameters:
      lastStreamId - the last peer-initiated stream that might have been processed
      errorCode - the raw 32-bit error code
      debugData - the diagnostic bytes, retained without copying
    • GoAway

      public GoAway(int lastStreamId, ErrorCode error, byte[] debugData)
      Creates a frame with the given error code.
      Parameters:
      lastStreamId - the last peer-initiated stream that might have been processed
      error - the error code to send
      debugData - the diagnostic bytes, retained without copying
  • Method Details

    • streamId

      public int streamId()
      Description copied from interface: Frame
      The stream this frame belongs to, or 0 for the connection.
      Specified by:
      streamId in interface Frame
      Returns:
      the stream identifier, or 0 for the connection
    • type

      public int type()
      Description copied from interface: Frame
      The frame type code, one of the FrameType constants (or any value for Frame.Unknown).
      Specified by:
      type in interface Frame
      Returns:
      the unsigned frame type code
    • error

      public ErrorCode error()
      Interprets the raw wire error code.
      Returns:
      the known code, or INTERNAL_ERROR for an unknown value
    • 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 '=='.
      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.
    • lastStreamId

      public int lastStreamId()
      Returns the value of the lastStreamId record component.
      Returns:
      the value of the lastStreamId record component
    • errorCode

      public int errorCode()
      Returns the value of the errorCode record component.
      Returns:
      the value of the errorCode record component
    • debugData

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