- java.lang.Object
-
- io.netty5.buffer.api.BufferHolder<Http2UnknownFrame>
-
- io.netty5.handler.codec.http2.DefaultHttp2UnknownFrame
-
- All Implemented Interfaces:
Http2Frame
,Http2StreamFrame
,Http2UnknownFrame
,Resource<Http2UnknownFrame>
,AutoCloseable
@UnstableApi public final class DefaultHttp2UnknownFrame extends BufferHolder<Http2UnknownFrame> implements Http2UnknownFrame
-
-
Constructor Summary
Constructors Constructor Description DefaultHttp2UnknownFrame(byte frameType, Http2Flags flags)
DefaultHttp2UnknownFrame(byte frameType, Http2Flags flags, Buffer data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Buffer
content()
Get the data content associated with this unknown frame.DefaultHttp2UnknownFrame
copy()
Create a copy of this unknown frame, which in turn contain a copy of the frame contents.boolean
equals(Object o)
This implementation of theequals
operation is restricted to work only with instances of the same class.Http2Flags
flags()
Get theHttp2Flags
set on this unknown frame.byte
frameType()
Get the raw frame type.int
hashCode()
String
name()
Returns the name of the HTTP/2 frame e.g.protected DefaultHttp2UnknownFrame
receive(Buffer buf)
Called when a sentBufferHolder
is received by the recipient.Http2FrameStream
stream()
Returns theHttp2FrameStream
object for this frame, ornull
if the frame has yet to be associated with a stream.DefaultHttp2UnknownFrame
stream(Http2FrameStream stream)
Set theHttp2FrameStream
object for this frame.String
toString()
-
Methods inherited from class io.netty5.buffer.api.BufferHolder
close, getBuffer, getBufferVolatile, isAccessible, replaceBuffer, replaceBufferVolatile, send, touch
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty5.util.Resource
close, isAccessible, send, touch
-
-
-
-
Constructor Detail
-
DefaultHttp2UnknownFrame
public DefaultHttp2UnknownFrame(byte frameType, Http2Flags flags)
-
DefaultHttp2UnknownFrame
public DefaultHttp2UnknownFrame(byte frameType, Http2Flags flags, Buffer data)
-
-
Method Detail
-
content
public Buffer content()
Description copied from interface:Http2UnknownFrame
Get the data content associated with this unknown frame.The buffer will be empty if there is no data with this unknown frame.
- Specified by:
content
in interfaceHttp2UnknownFrame
- Returns:
- The contents of this unknown frame.
-
stream
public Http2FrameStream stream()
Description copied from interface:Http2StreamFrame
Returns theHttp2FrameStream
object for this frame, ornull
if the frame has yet to be associated with a stream.- Specified by:
stream
in interfaceHttp2StreamFrame
- Specified by:
stream
in interfaceHttp2UnknownFrame
-
stream
public DefaultHttp2UnknownFrame stream(Http2FrameStream stream)
Description copied from interface:Http2StreamFrame
Set theHttp2FrameStream
object for this frame.- Specified by:
stream
in interfaceHttp2StreamFrame
- Specified by:
stream
in interfaceHttp2UnknownFrame
-
frameType
public byte frameType()
Description copied from interface:Http2UnknownFrame
Get the raw frame type. This is the type value that wasn't recognized and caused this to be captured as an unknown frame.- Specified by:
frameType
in interfaceHttp2UnknownFrame
- Returns:
- The raw frame type.
-
flags
public Http2Flags flags()
Description copied from interface:Http2UnknownFrame
Get theHttp2Flags
set on this unknown frame.- Specified by:
flags
in interfaceHttp2UnknownFrame
- Returns:
- The flags set on this frame.
-
name
public String name()
Description copied from interface:Http2Frame
Returns the name of the HTTP/2 frame e.g. DATA, GOAWAY, etc.- Specified by:
name
in interfaceHttp2Frame
-
copy
public DefaultHttp2UnknownFrame copy()
Description copied from interface:Http2UnknownFrame
Create a copy of this unknown frame, which in turn contain a copy of the frame contents.- Specified by:
copy
in interfaceHttp2UnknownFrame
- Returns:
- A copy of this unknown frame.
-
receive
protected DefaultHttp2UnknownFrame receive(Buffer buf)
Description copied from class:BufferHolder
Called when a sentBufferHolder
is received by the recipient. TheBufferHolder
should return a new concrete instance, that wraps the givenBuffer
object.- Specified by:
receive
in classBufferHolder<Http2UnknownFrame>
- Parameters:
buf
- TheBuffer
that is received by the recipient, and needs to be wrapped in a newBufferHolder
instance.- Returns:
- A new buffer holder instance, containing the given buffer.
-
equals
public boolean equals(Object o)
Description copied from class:BufferHolder
This implementation of theequals
operation is restricted to work only with instances of the same class. The reason for that is that Netty library already has a number of classes that extendBufferHolder
and overrideequals
method with an additional comparison logic, and we need the symmetric property of theequals
operation to be preserved.- Overrides:
equals
in classBufferHolder<Http2UnknownFrame>
- Parameters:
o
- The reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBufferHolder<Http2UnknownFrame>
-
-