Interface MapTypeDecoder
-
- All Superinterfaces:
PrimitiveTypeDecoder<java.util.Map>,StreamTypeDecoder<java.util.Map>,TypeDecoder<java.util.Map>
- All Known Implementing Classes:
AbstractMapTypeDecoder,Map32TypeDecoder,Map8TypeDecoder
public interface MapTypeDecoder extends PrimitiveTypeDecoder<java.util.Map>
Base interface for all AMQP Map type value decoders.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.lang.Class<java.util.Map>getTypeClass()intreadCount(java.io.InputStream stream)Reads the count of entries in the encoded Map.intreadCount(ProtonBuffer buffer)Reads the count of entries in the encoded Map.intreadSize(java.io.InputStream stream)Reads the encoded size of the underlying Map type.intreadSize(ProtonBuffer buffer)Reads the encoded size of the underlying Map type.-
Methods inherited from interface org.apache.qpid.protonj2.codec.decoders.PrimitiveTypeDecoder
getTypeCode, isJavaPrimitive
-
Methods inherited from interface org.apache.qpid.protonj2.codec.StreamTypeDecoder
isArrayType, readArrayElements, readValue, skipValue
-
Methods inherited from interface org.apache.qpid.protonj2.codec.TypeDecoder
isArrayType, readArrayElements, readValue, skipValue
-
-
-
-
Method Detail
-
getTypeClass
default java.lang.Class<java.util.Map> getTypeClass()
- Specified by:
getTypeClassin interfaceStreamTypeDecoder<java.util.Map>- Specified by:
getTypeClassin interfaceTypeDecoder<java.util.Map>- Returns:
- the Class that this decoder handles.
-
readSize
int readSize(ProtonBuffer buffer) throws DecodeException
Reads the encoded size of the underlying Map type.- Parameters:
buffer- The buffer containing the encoded Map type.- Returns:
- the size in bytes of the encoded Map.
- Throws:
DecodeException- if an error occurs reading the value
-
readCount
int readCount(ProtonBuffer buffer) throws DecodeException
Reads the count of entries in the encoded Map.This value is the total count of all key values pairs, and should always be an even number as Map types cannot be unbalanced.
- Parameters:
buffer- The buffer containing the encoded Map type.- Returns:
- the number of elements that we encoded from the original Map.
- Throws:
DecodeException- if an error occurs reading the value
-
readSize
int readSize(java.io.InputStream stream) throws DecodeExceptionReads the encoded size of the underlying Map type.- Parameters:
stream- The InputStream containing the encoded Map type.- Returns:
- the size in bytes of the encoded Map.
- Throws:
DecodeException- if an error occurs reading the value
-
readCount
int readCount(java.io.InputStream stream) throws DecodeExceptionReads the count of entries in the encoded Map.This value is the total count of all key values pairs, and should always be an even number as Map types cannot be unbalanced.
- Parameters:
stream- The InputStream containing the encoded Map type.- Returns:
- the number of elements that we encoded from the original Map.
- Throws:
DecodeException- if an error occurs reading the value
-
-