Module org.apache.qpid.protonj2
Interface PrimitiveTypeDecoder<V>
- Type Parameters:
V- the Type Class that this decoder manages.
- All Superinterfaces:
StreamTypeDecoder<V>,TypeDecoder<V>
- All Known Subinterfaces:
BinaryTypeDecoder,ListTypeDecoder,MapTypeDecoder,PrimitiveArrayTypeDecoder,StringTypeDecoder,SymbolTypeDecoder
- All Known Implementing Classes:
AbstractArrayTypeDecoder,AbstractBinaryTypeDecoder,AbstractListTypeDecoder,AbstractMapTypeDecoder,AbstractPrimitiveTypeDecoder,AbstractStringTypeDecoder,AbstractSymbolTypeDecoder,Array32TypeDecoder,Array8TypeDecoder,Binary32TypeDecoder,Binary8TypeDecoder,BooleanFalseTypeDecoder,BooleanTrueTypeDecoder,BooleanTypeDecoder,ByteTypeDecoder,CharacterTypeDecoder,Decimal128TypeDecoder,Decimal32TypeDecoder,Decimal64TypeDecoder,DoubleTypeDecoder,FloatTypeDecoder,Integer32TypeDecoder,Integer8TypeDecoder,List0TypeDecoder,List32TypeDecoder,List8TypeDecoder,Long8TypeDecoder,LongTypeDecoder,Map32TypeDecoder,Map8TypeDecoder,NullTypeDecoder,SaslSymbol32TypeDecoder,SaslSymbol8TypeDecoder,ShortTypeDecoder,String32TypeDecoder,String8TypeDecoder,Symbol32TypeDecoder,Symbol8TypeDecoder,TimestampTypeDecoder,UnsignedByteTypeDecoder,UnsignedInteger0TypeDecoder,UnsignedInteger32TypeDecoder,UnsignedInteger8TypeDecoder,UnsignedLong0TypeDecoder,UnsignedLong64TypeDecoder,UnsignedLong8TypeDecoder,UnsignedShortTypeDecoder,UUIDTypeDecoder
Interface for a TypeDecoder that manages decoding of AMQP primitive types.
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the AMQP Encoding Code that this primitive type decoder can read.booleanReturns true if the type managed by this decoder is assignable to a Java primitive type.default booleanReturns true if the underlying type that is going to be decoded is an primitive type.default booleanReturns true if the underlying type is a zero width type that has no encoding beyond the encoding code.default ObjectreadPrimitiveArray(InputStream stream, StreamDecoderState state, int count) Read and return a Java primitive type array from the given stream of bytes up to the given count of elements.default ObjectreadPrimitiveArray(ProtonBuffer buffer, DecoderState state, int count) Read and return a Java primitive type array from the given stream of bytes up to the given count of elements.Methods inherited from interface org.apache.qpid.protonj2.codec.StreamTypeDecoder
getTypeClass, isArrayType, isNull, readArrayElements, readSize, readValue, skipValueMethods inherited from interface org.apache.qpid.protonj2.codec.TypeDecoder
getTypeClass, isArrayType, isNull, readArrayElements, readSize, readValue, skipValue
-
Method Details
-
isPrimitive
default boolean isPrimitive()Description copied from interface:TypeDecoderReturns true if the underlying type that is going to be decoded is an primitive type.- Specified by:
isPrimitivein interfaceStreamTypeDecoder<V>- Specified by:
isPrimitivein interfaceTypeDecoder<V>- Returns:
- true if the underlying type that is going to be decoded is an primitive type
-
isZeroWidth
default boolean isZeroWidth()Returns true if the underlying type is a zero width type that has no encoding beyond the encoding code.- Returns:
- true if the underlying type is a zero width type that has no encoding beyond the encoding code
-
isJavaPrimitive
boolean isJavaPrimitive()Returns true if the type managed by this decoder is assignable to a Java primitive type.- Returns:
- true if the type managed by this decoder is assignable to a Java primitive type
-
getTypeCode
int getTypeCode()Returns the AMQP Encoding Code that this primitive type decoder can read.- Returns:
- the AMQP Encoding Code that this primitive type decoder can read
-
readPrimitiveArray
default Object readPrimitiveArray(ProtonBuffer buffer, DecoderState state, int count) throws DecodeException Read and return a Java primitive type array from the given stream of bytes up to the given count of elements.- Parameters:
buffer- The source of bytes to read the primitive type from.state- The decoder state used when performing the decode operation.count- The number of elements that comprise the array to read.- Returns:
- an array made up of Java primitive values stored in the primitive typed array.
- Throws:
DecodeException- if an error occurs or this type is not a Java primitive type decoder.
-
readPrimitiveArray
default Object readPrimitiveArray(InputStream stream, StreamDecoderState state, int count) throws DecodeException Read and return a Java primitive type array from the given stream of bytes up to the given count of elements.- Parameters:
stream- The source of bytes to read the primitive type from.state- The decoder state used when performing the decode operation.count- The number of elements that comprise the array to read.- Returns:
- an array made up of Java primitive values stored in the primitive typed array.
- Throws:
DecodeException- if an error occurs or this type is not a Java primitive type decoder.
-