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

public interface PrimitiveTypeDecoder<V> extends TypeDecoder<V>, StreamTypeDecoder<V>
Interface for a TypeDecoder that manages decoding of AMQP primitive types.
  • Method Details

    • isPrimitive

      default boolean isPrimitive()
      Description copied from interface: TypeDecoder
      Returns true if the underlying type that is going to be decoded is an primitive type.
      Specified by:
      isPrimitive in interface StreamTypeDecoder<V>
      Specified by:
      isPrimitive in interface TypeDecoder<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.