Package kieker.common.record.io
Class JsonArrayValueDeserializer
java.lang.Object
kieker.common.record.io.AbstractValueDeserializer
kieker.common.record.io.JsonArrayValueDeserializer
- All Implemented Interfaces:
IValueDeserializer
public class JsonArrayValueDeserializer extends AbstractValueDeserializer implements IValueDeserializer
Deserialize an JSON array of values.
- Since:
- 1.15
- Author:
- Reiner Jung
-
Constructor Summary
Constructors Modifier Constructor Description protected
JsonArrayValueDeserializer(com.fasterxml.jackson.databind.node.ArrayNode array)
Constructor for a serializer. -
Method Summary
Modifier and Type Method Description static JsonArrayValueDeserializer
create(com.fasterxml.jackson.databind.node.ArrayNode array)
Factory method to create a json value deserializer.boolean
getBoolean()
Retrieves aboolean
value from the underlying data source.byte
getByte()
Retrieves abyte
value from the underlying data source.char
getChar()
Retrieves achar
value from the underlying data source.double
getDouble()
Retrieves adouble
value from the underlying data source.<T extends java.lang.Enum<T>>
TgetEnumeration(java.lang.Class<T> clazz)
Retrieves aEnumeration
value from the underlying data source.float
getFloat()
Retrieves afloat
value from the underlying data source.int
getInt()
Retrieves anint
value from the underlying data source.long
getLong()
Retrieves along
value from the underlying data source.short
getShort()
Retrieves ashort
value from the underlying data source.java.lang.String
getString()
Retrieves aString
value from the underlying data source.
-
Constructor Details
-
JsonArrayValueDeserializer
protected JsonArrayValueDeserializer(com.fasterxml.jackson.databind.node.ArrayNode array)Constructor for a serializer.- Parameters:
array
- input array node
-
-
Method Details
-
create
public static JsonArrayValueDeserializer create(com.fasterxml.jackson.databind.node.ArrayNode array)Factory method to create a json value deserializer.- Parameters:
array
- input array node- Returns:
- the value deserializer
-
getBoolean
public boolean getBoolean()Description copied from interface:IValueDeserializer
Retrieves aboolean
value from the underlying data source.- Specified by:
getBoolean
in interfaceIValueDeserializer
- Returns:
- The retrieved value
-
getByte
public byte getByte() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializer
Retrieves abyte
value from the underlying data source.- Specified by:
getByte
in interfaceIValueDeserializer
- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException
- on format errors
-
getChar
public char getChar()Description copied from interface:IValueDeserializer
Retrieves achar
value from the underlying data source.- Specified by:
getChar
in interfaceIValueDeserializer
- Returns:
- The retrieved value
-
getShort
public short getShort() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializer
Retrieves ashort
value from the underlying data source.- Specified by:
getShort
in interfaceIValueDeserializer
- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException
- on format errors
-
getInt
public int getInt() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializer
Retrieves anint
value from the underlying data source.- Specified by:
getInt
in interfaceIValueDeserializer
- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException
- on format errors
-
getLong
public long getLong() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializer
Retrieves along
value from the underlying data source.- Specified by:
getLong
in interfaceIValueDeserializer
- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException
- on format errors
-
getFloat
public float getFloat() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializer
Retrieves afloat
value from the underlying data source.- Specified by:
getFloat
in interfaceIValueDeserializer
- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException
- on format errors
-
getDouble
public double getDouble() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializer
Retrieves adouble
value from the underlying data source.- Specified by:
getDouble
in interfaceIValueDeserializer
- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException
- on format errors
-
getString
public java.lang.String getString()Description copied from interface:IValueDeserializer
Retrieves aString
value from the underlying data source.- Specified by:
getString
in interfaceIValueDeserializer
- Returns:
- The retrieved value
-
getEnumeration
public <T extends java.lang.Enum<T>> T getEnumeration(java.lang.Class<T> clazz) throws RecordInstantiationExceptionDescription copied from interface:IValueDeserializer
Retrieves aEnumeration
value from the underlying data source.- Specified by:
getEnumeration
in interfaceIValueDeserializer
- Type Parameters:
T
- the corresponding enumeration type- Parameters:
clazz
- enumeration type to be used- Returns:
- The retrieved value
- Throws:
RecordInstantiationException
- in case the received ordinal does not exist in the specified enumeration type
-