Class AbstractPrimitiveTypeDecoder<V>
- java.lang.Object
-
- org.apache.qpid.protonj2.codec.decoders.AbstractPrimitiveTypeDecoder<V>
-
- Type Parameters:
V
- The type that this primitive decoder handles.
- All Implemented Interfaces:
PrimitiveTypeDecoder<V>
,StreamTypeDecoder<V>
,TypeDecoder<V>
- Direct Known Subclasses:
AbstractArrayTypeDecoder
,AbstractBinaryTypeDecoder
,AbstractListTypeDecoder
,AbstractMapTypeDecoder
,AbstractStringTypeDecoder
,AbstractSymbolTypeDecoder
,BooleanTypeDecoder
,ByteTypeDecoder
,CharacterTypeDecoder
,Decimal128TypeDecoder
,Decimal32TypeDecoder
,Decimal64TypeDecoder
,DoubleTypeDecoder
,FloatTypeDecoder
,Integer32TypeDecoder
,Integer8TypeDecoder
,List0TypeDecoder
,LongTypeDecoder
,NullTypeDecoder
,ShortTypeDecoder
,TimestampTypeDecoder
,UnsignedByteTypeDecoder
,UnsignedInteger0TypeDecoder
,UnsignedInteger32TypeDecoder
,UnsignedInteger8TypeDecoder
,UnsignedLong0TypeDecoder
,UnsignedLong64TypeDecoder
,UnsignedLong8TypeDecoder
,UnsignedShortTypeDecoder
,UUIDTypeDecoder
public abstract class AbstractPrimitiveTypeDecoder<V> extends Object implements PrimitiveTypeDecoder<V>
Abstract base for all Described Type decoders which implements the generic methods common to all the implementations.
-
-
Constructor Summary
Constructors Constructor Description AbstractPrimitiveTypeDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isArrayType()
boolean
isJavaPrimitive()
V[]
readArrayElements(InputStream stream, StreamDecoderState state, int count)
Reads a series of this type that have been encoded into the body of an Array type.V[]
readArrayElements(ProtonBuffer buffer, DecoderState state, int count)
Reads a series of this type that have been encoded into the body of an Array type.-
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.decoders.PrimitiveTypeDecoder
getTypeCode
-
Methods inherited from interface org.apache.qpid.protonj2.codec.StreamTypeDecoder
getTypeClass, readValue, skipValue
-
Methods inherited from interface org.apache.qpid.protonj2.codec.TypeDecoder
getTypeClass, readValue, skipValue
-
-
-
-
Method Detail
-
isArrayType
public boolean isArrayType()
- Specified by:
isArrayType
in interfaceStreamTypeDecoder<V>
- Specified by:
isArrayType
in interfaceTypeDecoder<V>
- Returns:
- true if the underlying type that is going to be decoded is an array type
-
isJavaPrimitive
public boolean isJavaPrimitive()
- Specified by:
isJavaPrimitive
in interfacePrimitiveTypeDecoder<V>
- Returns:
- true if the type managed by this decoder is assignable to a Java primitive type.
-
readArrayElements
public V[] readArrayElements(ProtonBuffer buffer, DecoderState state, int count) throws DecodeException
Description copied from interface:TypeDecoder
Reads a series of this type that have been encoded into the body of an Array type.When encoded into an array the values are encoded in series following the identifier for the type, this method is given a count of the number of instances that are encoded and should read each in succession and returning them in a new array.
- Specified by:
readArrayElements
in interfaceTypeDecoder<V>
- Parameters:
buffer
- the source of encoded data.state
- the current state of the decoder.count
- the number of array elements encoded in the buffer.- Returns:
- the next instance in the stream that this decoder handles.
- Throws:
DecodeException
- if an error is encountered while reading the next value.
-
readArrayElements
public V[] readArrayElements(InputStream stream, StreamDecoderState state, int count) throws DecodeException
Description copied from interface:StreamTypeDecoder
Reads a series of this type that have been encoded into the body of an Array type.When encoded into an array the values are encoded in series following the identifier for the type, this method is given a count of the number of instances that are encoded and should read each in succession and returning them in a new array.
- Specified by:
readArrayElements
in interfaceStreamTypeDecoder<V>
- Parameters:
stream
- the source of encoded data.state
- the current state of the decoder.count
- the number of array elements encoded in the buffer.- Returns:
- the next instance in the stream that this decoder handles.
- Throws:
DecodeException
- if an error is encountered while reading the next value.
-
-