Package io.github.mahmoudimus.http2
Record Class Frame.PushPromise
java.lang.Object
java.lang.Record
io.github.mahmoudimus.http2.Frame.PushPromise
- Record Components:
streamId- the nonzero stream identifierpromisedStreamId- the nonzero identifier reserved for the promised streamfieldBlock- the HPACK-encoded field block bytes, retained without copyingendHeaders- whether this fragment completes the field blockpadding- padding octets including the Pad Length octet, or 0 for no padding
- All Implemented Interfaces:
Frame
- Enclosing interface:
Frame
public static record Frame.PushPromise(int streamId, int promisedStreamId, byte[] fieldBlock, boolean endHeaders, int padding)
extends Record
implements Frame
PUSH_PROMISE (§6.6), with its complete field block. A server never accepts one, and a client
that sent
SETTINGS_ENABLE_PUSH = 0 must treat one as a connection error of type
PROTOCOL_ERROR (§8.4). The reader still returns it, with the field block (which must be
decoded to keep HPACK state in step if the connection is to continue), and leaves the decision
to the caller.-
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
ConstructorsConstructorDescriptionPushPromise(int streamId, int promisedStreamId, byte[] fieldBlock, boolean endHeaders, int padding) Creates PUSH_PROMISE with nonzero stream identifiers and valid padding. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theendHeadersrecord component.final booleanIndicates whether some other object is "equal to" this one.byte[]Returns the value of thefieldBlockrecord component.final inthashCode()Returns a hash code value for this object.intpadding()Returns the value of thepaddingrecord component.intReturns the value of thepromisedStreamIdrecord component.intstreamId()Returns the value of thestreamIdrecord component.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
-
PushPromise
public PushPromise(int streamId, int promisedStreamId, byte[] fieldBlock, boolean endHeaders, int padding) Creates PUSH_PROMISE with nonzero stream identifiers and valid padding.- Parameters:
streamId- the nonzero stream identifierpromisedStreamId- the nonzero identifier reserved for the promised streamfieldBlock- the HPACK-encoded field block bytes, retained without copyingendHeaders- whether this fragment completes the field blockpadding- padding octets including the Pad Length octet, or 0 for no padding
-
-
Method Details
-
type
public int type()Description copied from interface:FrameThe frame type code, one of theFrameTypeconstants (or any value forFrame.Unknown). -
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 '=='. -
streamId
public int streamId()Returns the value of thestreamIdrecord component. -
promisedStreamId
public int promisedStreamId()Returns the value of thepromisedStreamIdrecord component.- Returns:
- the value of the
promisedStreamIdrecord component
-
fieldBlock
public byte[] fieldBlock()Returns the value of thefieldBlockrecord component.- Returns:
- the value of the
fieldBlockrecord component
-
endHeaders
public boolean endHeaders()Returns the value of theendHeadersrecord component.- Returns:
- the value of the
endHeadersrecord component
-
padding
public int padding()Returns the value of thepaddingrecord component.- Returns:
- the value of the
paddingrecord component
-