public class Frame extends AbstractReferenceCounted implements Payload, ByteBufHolder
DuplexConnection.
This provides encoding, decoding and field accessors.
| Modifier and Type | Class and Description |
|---|---|
static class |
Frame.Cancel |
static class |
Frame.Error |
static class |
Frame.Keepalive |
static class |
Frame.Lease |
static class |
Frame.PayloadFrame |
static class |
Frame.Request |
static class |
Frame.RequestN |
static class |
Frame.Setup |
| Modifier and Type | Method and Description |
|---|---|
ByteBuf |
content()
Return the content which is held by this
Frame. |
Frame |
copy()
Creates a deep copy of this
Frame. |
protected void |
deallocate()
Called once
AbstractReferenceCounted.refCnt() is equals 0. |
Frame |
duplicate()
Duplicates this
Frame. |
static void |
ensureFrameType(FrameType frameType,
Frame frame) |
boolean |
equals(Object o) |
int |
flags()
Return the flags field for the frame
|
static Frame |
from(ByteBuf content)
Acquire a free Frame backed by given ByteBuf
|
int |
getStreamId()
Return frame stream identifier
|
FrameType |
getType()
Return frame
FrameType |
int |
hashCode() |
boolean |
hasMetadata()
Returns whether the payload has metadata, useful for tell if metadata is empty or not present.
|
static boolean |
isFlagSet(int flags,
int checkedFlag) |
Frame |
replace(ByteBuf content)
Returns a new
Frame which contains the specified content. |
Frame |
retain()
Increases the reference count by
1. |
Frame |
retain(int increment)
Increases the reference count by the specified
increment. |
Frame |
retainedDuplicate()
Duplicates this
Frame. |
static int |
setFlag(int current,
int toSet) |
ByteBuf |
sliceData()
Return
ByteBuf that is a ByteBuf.slice() for the frame data |
ByteBuf |
sliceMetadata()
Return
ByteBuf that is a ByteBuf.slice() for the frame metadata |
String |
toString() |
Frame |
touch()
Records the current access location of this object for debugging purposes.
|
Frame |
touch(Object hint)
Records the current access location of this object with an additional arbitrary information for
debugging purposes.
|
refCnt, release, release, setRefCntclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetData, getDataUtf8, getMetadata, getMetadataUtf8refCnt, release, releasepublic ByteBuf content()
Frame.content in interface ByteBufHolderpublic Frame copy()
Frame.copy in interface ByteBufHolderpublic Frame duplicate()
duplicate in interface ByteBufHolderpublic Frame retainedDuplicate()
Frame. This method returns a retained duplicate unlike duplicate().retainedDuplicate in interface ByteBufHolderByteBuf.retainedDuplicate()public Frame replace(ByteBuf content)
Frame which contains the specified content.replace in interface ByteBufHolderpublic Frame retain()
1.retain in interface ByteBufHolderretain in interface ReferenceCountedretain in interface Payloadretain in class AbstractReferenceCountedpublic Frame retain(int increment)
increment.retain in interface ByteBufHolderretain in interface ReferenceCountedretain in interface Payloadretain in class AbstractReferenceCountedpublic Frame touch()
ResourceLeakDetector. This method is a shortcut to touch(null).touch in interface ByteBufHoldertouch in interface ReferenceCountedtouch in interface Payloadtouch in class AbstractReferenceCountedpublic Frame touch(@Nullable Object hint)
ResourceLeakDetector.touch in interface ByteBufHoldertouch in interface ReferenceCountedtouch in interface Payloadprotected void deallocate()
AbstractReferenceCounted.refCnt() is equals 0.deallocate in class AbstractReferenceCountedpublic ByteBuf sliceMetadata()
ByteBuf that is a ByteBuf.slice() for the frame metadata
If no metadata is present, the ByteBuf will have 0 capacity.
sliceMetadata in interface Payloadpublic ByteBuf sliceData()
ByteBuf that is a ByteBuf.slice() for the frame data
If no data is present, the ByteBuf will have 0 capacity.
public int getStreamId()
public int flags()
public static Frame from(ByteBuf content)
content - to use as backing bufferpublic static boolean isFlagSet(int flags,
int checkedFlag)
public static int setFlag(int current,
int toSet)
public boolean hasMetadata()
PayloadhasMetadata in interface Payload