Class ProtonSequentialTagGenerator.ProtonNumericDeliveryTag
- java.lang.Object
-
- org.apache.qpid.protonj2.engine.impl.ProtonSequentialTagGenerator.ProtonNumericDeliveryTag
-
- All Implemented Interfaces:
DeliveryTag
- Enclosing class:
- ProtonSequentialTagGenerator
protected static class ProtonSequentialTagGenerator.ProtonNumericDeliveryTag extends java.lang.Object implements DeliveryTag
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.qpid.protonj2.types.DeliveryTag
DeliveryTag.ProtonDeliveryTag
-
-
Field Summary
Fields Modifier and Type Field Description protected longtagValue
-
Constructor Summary
Constructors Constructor Description ProtonNumericDeliveryTag(long tagValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeliveryTagcopy()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.booleanequals(java.lang.Object obj)inthashCode()voidrelease()Optional method used by tag implementations that provide pooling of tags.ProtonBuffertagBuffer()Returns a view of thisDeliveryTagobject as aProtonBuffer.byte[]tagBytes()Returns a view of thisDeliveryTagobject as a byte array.inttagLength()java.lang.StringtoString()voidwriteTo(ProtonBuffer buffer)Writes the tag as a sequence of bytes into the given buffer in the manner most efficient for the underlyingDeliveryTagimplementation.
-
-
-
Method Detail
-
tagLength
public int tagLength()
- Specified by:
tagLengthin interfaceDeliveryTag- Returns:
- the total number of bytes needed to represent the given tag.
-
tagBytes
public byte[] tagBytes()
Description copied from interface:DeliveryTagReturns a view of thisDeliveryTagobject 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:
tagBytesin interfaceDeliveryTag- Returns:
- the underlying tag bytes as a byte array that may or may no be a singleton instance..
-
tagBuffer
public ProtonBuffer tagBuffer()
Description copied from interface:DeliveryTagReturns a view of thisDeliveryTagobject 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:
tagBufferin interfaceDeliveryTag- Returns:
- the ProtonBuffer view of the tag bytes.
-
release
public void release()
Description copied from interface:DeliveryTagOptional method used by tag implementations that provide pooling of tags. Implementations can do nothing here if no release mechanics are needed.- Specified by:
releasein interfaceDeliveryTag
-
copy
public DeliveryTag copy()
Description copied from interface:DeliveryTagCreate 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:
copyin interfaceDeliveryTag- Returns:
- a copy of the underlying bytes that compose this delivery tag.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
writeTo
public void writeTo(ProtonBuffer buffer)
Description copied from interface:DeliveryTagWrites the tag as a sequence of bytes into the given buffer in the manner most efficient for the underlyingDeliveryTagimplementation.- Specified by:
writeToin interfaceDeliveryTag- Parameters:
buffer- The target buffer where the tag bytes are to be written.
-
-