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, setRefCnt
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getData, getDataUtf8, getMetadata, getMetadataUtf8
refCnt, release, release
public ByteBuf content()
Frame
.content
in interface ByteBufHolder
public Frame copy()
Frame
.copy
in interface ByteBufHolder
public Frame duplicate()
duplicate
in interface ByteBufHolder
public Frame retainedDuplicate()
Frame
. This method returns a retained duplicate unlike duplicate()
.retainedDuplicate
in interface ByteBufHolder
ByteBuf.retainedDuplicate()
public Frame replace(ByteBuf content)
Frame
which contains the specified content
.replace
in interface ByteBufHolder
public Frame retain()
1
.retain
in interface ByteBufHolder
retain
in interface ReferenceCounted
retain
in interface Payload
retain
in class AbstractReferenceCounted
public Frame retain(int increment)
increment
.retain
in interface ByteBufHolder
retain
in interface ReferenceCounted
retain
in interface Payload
retain
in class AbstractReferenceCounted
public Frame touch()
ResourceLeakDetector
. This method is a shortcut to touch(null)
.touch
in interface ByteBufHolder
touch
in interface ReferenceCounted
touch
in interface Payload
touch
in class AbstractReferenceCounted
public Frame touch(@Nullable Object hint)
ResourceLeakDetector
.touch
in interface ByteBufHolder
touch
in interface ReferenceCounted
touch
in interface Payload
protected void deallocate()
AbstractReferenceCounted.refCnt()
is equals 0.deallocate
in class AbstractReferenceCounted
public 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 Payload
public 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()
Payload
hasMetadata
in interface Payload