Package org.microproxy.frames
Record Class Http2Frame.Headers
java.lang.Object
java.lang.Record
org.microproxy.frames.Http2Frame.Headers
- Record Components:
streamId- the streamfields- the header block, pseudo-headers firstendStream- whether the frame ends the stream
- All Implemented Interfaces:
Http2Frame,HttpFrame
- Enclosing interface:
Http2Frame
public static record Http2Frame.Headers(int streamId, List<Field> fields, boolean endStream)
extends Record
implements Http2Frame
HEADERS (section 6.2), with its whole decoded header block. The deprecated priority signal a
client may put in HEADERS is not shown.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.microproxy.frames.Http2Frame
Http2Frame.Data, Http2Frame.GoAway, Http2Frame.Headers, Http2Frame.Ping, Http2Frame.Priority, Http2Frame.PushPromise, Http2Frame.RstStream, Http2Frame.Settings, Http2Frame.Unknown, Http2Frame.WindowUpdate -
Field Summary
Fields inherited from interface org.microproxy.frames.Http2Frame
ERROR_NAMES, SETTING_NAMES, SETTINGS_ENABLE_CONNECT_PROTOCOL, SETTINGS_ENABLE_PUSH, SETTINGS_HEADER_TABLE_SIZE, SETTINGS_INITIAL_WINDOW_SIZE, SETTINGS_MAX_CONCURRENT_STREAMS, SETTINGS_MAX_FRAME_SIZE, SETTINGS_MAX_HEADER_LIST_SIZE, TYPE_CONTINUATION, TYPE_DATA, TYPE_GOAWAY, TYPE_HEADERS, TYPE_PING, TYPE_PRIORITY, TYPE_PUSH_PROMISE, TYPE_RST_STREAM, TYPE_SETTINGS, TYPE_WINDOW_UPDATE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theendStreamrecord component.final booleanIndicates whether some other object is "equal to" this one.fields()Returns the value of thefieldsrecord component.The first value of a field.final inthashCode()Returns a hash code value for this object.intstreamId()Returns the value of thestreamIdrecord component.final StringtoString()Returns a string representation of this record class.longtypeCode()The frame type's code on the wire.typeName()The frame type's name as the protocol's RFC spells it (DATA,HEADERS,SETTINGS, ...), orUNKNOWNfor an extension or reserved type.withEndStream(boolean end) This frame with END_STREAM set or not (seeFrameInterceptorfor who decides).withFields(List<Field> newFields) This frame with another header block.withHeader(String name, String value) This frame withnameset tovalue: the first field of that name gets the value and later ones are removed; without one, the field is added (a pseudo-header after the other pseudo-headers, a regular field at the end).withoutHeader(String name) This frame without the fields namedname.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.microproxy.frames.Http2Frame
protocol
-
Constructor Details
-
Headers
Creates HEADERS.- Parameters:
streamId- the stream, 1 or morefields- the header block, copiedendStream- whether the frame ends the stream
-
-
Method Details
-
typeName
Description copied from interface:HttpFrameThe frame type's name as the protocol's RFC spells it (DATA,HEADERS,SETTINGS, ...), orUNKNOWNfor an extension or reserved type. -
typeCode
public long typeCode()Description copied from interface:HttpFrameThe frame type's code on the wire. -
get
The first value of a field.- Parameters:
name- the field name, lower case- Returns:
- the value, or null if there is no such field
-
withFields
This frame with another header block.- Parameters:
newFields- the new header block- Returns:
- a copy with the fields
-
withHeader
This frame withnameset tovalue: the first field of that name gets the value and later ones are removed; without one, the field is added (a pseudo-header after the other pseudo-headers, a regular field at the end).- Parameters:
name- the field name, lower casevalue- the value- Returns:
- a copy with the field set
-
withoutHeader
This frame without the fields namedname.- Parameters:
name- the field name, lower case- Returns:
- a copy without them
-
withEndStream
This frame with END_STREAM set or not (seeFrameInterceptorfor who decides).- Parameters:
end- whether the frame ends the stream- Returns:
- a copy with the flag
-
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.- Specified by:
streamIdin interfaceHttp2Frame- Returns:
- the value of the
streamIdrecord component
-
fields
Returns the value of thefieldsrecord component.- Returns:
- the value of the
fieldsrecord component
-
endStream
public boolean endStream()Returns the value of theendStreamrecord component.- Returns:
- the value of the
endStreamrecord component
-