Package org.apache.qpid.protonj2.types
Class DeliveryTag.ProtonDeliveryTag
java.lang.Object
org.apache.qpid.protonj2.types.DeliveryTag.ProtonDeliveryTag
- All Implemented Interfaces:
DeliveryTag
- Enclosing interface:
- DeliveryTag
A default DeliveryTag implementation that can be used by a codec when decoding DeliveryTag
instances from the wire.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.qpid.protonj2.types.DeliveryTag
DeliveryTag.ProtonDeliveryTag
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Create a copy of this delivery tag, the copy should account for any underlying pooling of tags that the tag source's implementation is using.boolean
int
hashCode()
Returns a view of thisDeliveryTag
object as aProtonBuffer
.byte[]
tagBytes()
Returns a view of thisDeliveryTag
object as a byte array.int
toString()
void
writeTo
(ProtonBuffer buffer) Writes the tag as a sequence of bytes into the given buffer in the manner most efficient for the underlyingDeliveryTag
implementation.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.qpid.protonj2.types.DeliveryTag
release
-
Field Details
-
EMPTY_TAG
-
-
Constructor Details
-
ProtonDeliveryTag
public ProtonDeliveryTag() -
ProtonDeliveryTag
public ProtonDeliveryTag(byte[] tagBytes) -
ProtonDeliveryTag
-
-
Method Details
-
tagBytes
public byte[] tagBytes()Description copied from interface:DeliveryTag
Returns a view of thisDeliveryTag
object as a byte array. The returned array may be the actual underlying tag bytes or a synthetic view based on the value used to generate the tag. It is advised not to modify the returned value and copy if such modification are necessary to the caller.- Specified by:
tagBytes
in interfaceDeliveryTag
- Returns:
- the underlying tag bytes as a byte array that may or may no be a singleton instance..
-
tagLength
public int tagLength()- Specified by:
tagLength
in interfaceDeliveryTag
- Returns:
- the total number of bytes needed to represent the given tag.
-
tagBuffer
Description copied from interface:DeliveryTag
Returns a view of thisDeliveryTag
object as aProtonBuffer
. The returned array may be the actual underlying tag bytes or a synthetic view based on the value used to generate the tag. It is advised not to modify the returned value and copy if such modification are necessary to the caller.- Specified by:
tagBuffer
in interfaceDeliveryTag
- Returns:
- the ProtonBuffer view of the tag bytes.
-
copy
Description copied from interface:DeliveryTag
Create a copy of this delivery tag, the copy should account for any underlying pooling of tags that the tag source's implementation is using.- Specified by:
copy
in interfaceDeliveryTag
- Returns:
- a copy of the underlying bytes that compose this delivery tag.
-
hashCode
public int hashCode() -
equals
-
toString
-
writeTo
Description copied from interface:DeliveryTag
Writes the tag as a sequence of bytes into the given buffer in the manner most efficient for the underlyingDeliveryTag
implementation.- Specified by:
writeTo
in interfaceDeliveryTag
- Parameters:
buffer
- The target buffer where the tag bytes are to be written.
-