Class DeliveryAnnotationsTypeEncoder
java.lang.Object
org.apache.qpid.protonj2.codec.encoders.AbstractDescribedTypeEncoder<M>
org.apache.qpid.protonj2.codec.encoders.AbstractDescribedMapTypeEncoder<Symbol,Object,DeliveryAnnotations>
org.apache.qpid.protonj2.codec.encoders.messaging.DeliveryAnnotationsTypeEncoder
- All Implemented Interfaces:
DescribedTypeEncoder<DeliveryAnnotations>
,TypeEncoder<DeliveryAnnotations>
public final class DeliveryAnnotationsTypeEncoder
extends AbstractDescribedMapTypeEncoder<Symbol,Object,DeliveryAnnotations>
Encoder of AMQP DeliveryAnnotations type values to a byte stream.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getMapSize
(DeliveryAnnotations value) Gets the number of elements that will result when this type is encoded into an AMQP Map type.boolean
hasMap
(DeliveryAnnotations value) Returns false when the value to be encoded has no Map body and can be written as a Null body type instead of a Map type.void
writeMapEntries
(ProtonBuffer buffer, Encoder encoder, EncoderState state, DeliveryAnnotations annotations) Performs the write of the Map entries to the given buffer, the caller takes care of writing the Map preamble and tracking the final size of the written elements of the Map.Methods inherited from class org.apache.qpid.protonj2.codec.encoders.AbstractDescribedMapTypeEncoder
getMapEncoding, writeArray, writeRawArray, writeType
Methods inherited from class org.apache.qpid.protonj2.codec.encoders.AbstractDescribedTypeEncoder
isArrayType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.qpid.protonj2.codec.DescribedTypeEncoder
encoderRegistered
-
Constructor Details
-
DeliveryAnnotationsTypeEncoder
public DeliveryAnnotationsTypeEncoder()
-
-
Method Details
-
getTypeClass
- Returns:
- the Class type that this encoder handles.
-
getDescriptorCode
- Returns:
- the UnsignedLong value to use as the Descriptor for this type.
-
getDescriptorSymbol
- Returns:
- the Symbol value to use as the Descriptor for this type.
-
hasMap
Description copied from class:AbstractDescribedMapTypeEncoder
Returns false when the value to be encoded has no Map body and can be written as a Null body type instead of a Map type.- Specified by:
hasMap
in classAbstractDescribedMapTypeEncoder<Symbol,
Object, DeliveryAnnotations> - Parameters:
value
- the value which be encoded as a map type.- Returns:
- true if the type to be encoded has a Map body, false otherwise.
-
getMapSize
Description copied from class:AbstractDescribedMapTypeEncoder
Gets the number of elements that will result when this type is encoded into an AMQP Map type.- Specified by:
getMapSize
in classAbstractDescribedMapTypeEncoder<Symbol,
Object, DeliveryAnnotations> - Parameters:
value
- the value which will be encoded as a map type.- Returns:
- the number of elements that should comprise the encoded list.
-
writeMapEntries
public void writeMapEntries(ProtonBuffer buffer, Encoder encoder, EncoderState state, DeliveryAnnotations annotations) Description copied from class:AbstractDescribedMapTypeEncoder
Performs the write of the Map entries to the given buffer, the caller takes care of writing the Map preamble and tracking the final size of the written elements of the Map.- Specified by:
writeMapEntries
in classAbstractDescribedMapTypeEncoder<Symbol,
Object, DeliveryAnnotations> - Parameters:
buffer
- the buffer where the type should be encoded to.encoder
- the current encoder.state
- the current encoder state.annotations
- the value which will be encoded as a map type.
-