Package io.github.mahmoudimus.http2
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 processederrorCode- the raw 32-bit error codedebugData- 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().-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.mahmoudimus.http2.Frame
Frame.Continuation, Frame.Data, Frame.GoAway, Frame.Headers, Frame.Ping, Frame.Priority, Frame.PrioritySpec, Frame.PushPromise, Frame.RstStream, Frame.Settings, Frame.Unknown, Frame.WindowUpdate -
Field Summary
Fields inherited from interface io.github.mahmoudimus.http2.Frame
MAX_STREAM_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the value of thedebugDatarecord component.final booleanIndicates whether some other object is "equal to" this one.error()Interprets the raw wire error code.intReturns the value of theerrorCoderecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of thelastStreamIdrecord component.intstreamId()The stream this frame belongs to, or 0 for the connection.final StringtoString()Returns a string representation of this record class.inttype()The frame type code, one of theFrameTypeconstants (or any value forFrame.Unknown).
-
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 processederrorCode- the raw 32-bit error codedebugData- the diagnostic bytes, retained without copying
-
GoAway
Creates a frame with the given error code.- Parameters:
lastStreamId- the last peer-initiated stream that might have been processederror- the error code to senddebugData- the diagnostic bytes, retained without copying
-
-
Method Details
-
streamId
public int streamId()Description copied from interface:FrameThe stream this frame belongs to, or 0 for the connection. -
type
public int type()Description copied from interface:FrameThe frame type code, one of theFrameTypeconstants (or any value forFrame.Unknown). -
error
Interprets the raw wire error code.- Returns:
- the known code, or INTERNAL_ERROR for an unknown value
-
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. -
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. -
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 '=='. -
lastStreamId
public int lastStreamId()Returns the value of thelastStreamIdrecord component.- Returns:
- the value of the
lastStreamIdrecord component
-
errorCode
public int errorCode()Returns the value of theerrorCoderecord component.- Returns:
- the value of the
errorCoderecord component
-
debugData
public byte[] debugData()Returns the value of thedebugDatarecord component.- Returns:
- the value of the
debugDatarecord component
-