public class Frame extends Object 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. |
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) |
int |
refCnt()
Returns the reference count of this object.
|
boolean |
release()
Decreases the reference count by
1 and deallocates this object if the reference count
reaches at 0. |
boolean |
release(int decrement)
Decreases the reference count by the specified
decrement and deallocates this object if
the reference count reaches at 0. |
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.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetData, getDataUtf8, getMetadata, getMetadataUtf8public 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 int refCnt()
0, it means this object has been
deallocated.refCnt in interface ReferenceCountedpublic Frame retain()
1.retain in interface ByteBufHolderretain in interface ReferenceCountedretain in interface Payloadpublic Frame retain(int increment)
increment.retain in interface ByteBufHolderretain in interface ReferenceCountedretain in interface Payloadpublic Frame touch()
ResourceLeakDetector. This method is a shortcut to touch(null).touch in interface ByteBufHoldertouch in interface ReferenceCountedtouch in interface Payloadpublic Frame touch(@Nullable Object hint)
ResourceLeakDetector.touch in interface ByteBufHoldertouch in interface ReferenceCountedtouch in interface Payloadpublic boolean release()
1 and deallocates this object if the reference count
reaches at 0.release in interface ReferenceCountedtrue if and only if the reference count became 0 and this object has
been deallocatedpublic boolean release(int decrement)
decrement and deallocates this object if
the reference count reaches at 0.release in interface ReferenceCountedtrue if and only if the reference count became 0 and this object has
been deallocatedpublic 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