Record Class Frame.RstStream

java.lang.Object
java.lang.Record
io.github.mahmoudimus.http2.Frame.RstStream
Record Components:
streamId - the nonzero stream identifier
errorCode - the raw 32-bit error code
All Implemented Interfaces:
Frame
Enclosing interface:
Frame

public static record Frame.RstStream(int streamId, int errorCode) extends Record implements Frame
RST_STREAM (§6.4). errorCode is the raw wire value; see error().
  • Constructor Details

    • RstStream

      public RstStream(int streamId, int errorCode)
      Creates RST_STREAM for a nonzero stream.
      Parameters:
      streamId - the nonzero stream identifier
      errorCode - the raw 32-bit error code
    • RstStream

      public RstStream(int streamId, ErrorCode error)
      Creates a frame with the given error code.
      Parameters:
      streamId - the nonzero stream identifier
      error - the error code to send
  • Method Details

    • 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. All components in this record class 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.
    • streamId

      public int streamId()
      Returns the value of the streamId record component.
      Specified by:
      streamId in interface Frame
      Returns:
      the value of the streamId record component
    • errorCode

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