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 protectedJsonArrayValueDeserializer(com.fasterxml.jackson.databind.node.ArrayNode array)Constructor for a serializer. -
Method Summary
Modifier and Type Method Description static JsonArrayValueDeserializercreate(com.fasterxml.jackson.databind.node.ArrayNode array)Factory method to create a json value deserializer.booleangetBoolean()Retrieves abooleanvalue from the underlying data source.bytegetByte()Retrieves abytevalue from the underlying data source.chargetChar()Retrieves acharvalue from the underlying data source.doublegetDouble()Retrieves adoublevalue from the underlying data source.<T extends java.lang.Enum<T>>
TgetEnumeration(java.lang.Class<T> clazz)Retrieves aEnumerationvalue from the underlying data source.floatgetFloat()Retrieves afloatvalue from the underlying data source.intgetInt()Retrieves anintvalue from the underlying data source.longgetLong()Retrieves alongvalue from the underlying data source.shortgetShort()Retrieves ashortvalue from the underlying data source.java.lang.StringgetString()Retrieves aStringvalue 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:IValueDeserializerRetrieves abooleanvalue from the underlying data source.- Specified by:
getBooleanin interfaceIValueDeserializer- Returns:
- The retrieved value
-
getByte
public byte getByte() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializerRetrieves abytevalue from the underlying data source.- Specified by:
getBytein interfaceIValueDeserializer- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException- on format errors
-
getChar
public char getChar()Description copied from interface:IValueDeserializerRetrieves acharvalue from the underlying data source.- Specified by:
getCharin interfaceIValueDeserializer- Returns:
- The retrieved value
-
getShort
public short getShort() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializerRetrieves ashortvalue from the underlying data source.- Specified by:
getShortin interfaceIValueDeserializer- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException- on format errors
-
getInt
public int getInt() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializerRetrieves anintvalue from the underlying data source.- Specified by:
getIntin interfaceIValueDeserializer- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException- on format errors
-
getLong
public long getLong() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializerRetrieves alongvalue from the underlying data source.- Specified by:
getLongin interfaceIValueDeserializer- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException- on format errors
-
getFloat
public float getFloat() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializerRetrieves afloatvalue from the underlying data source.- Specified by:
getFloatin interfaceIValueDeserializer- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException- on format errors
-
getDouble
public double getDouble() throws java.lang.NumberFormatExceptionDescription copied from interface:IValueDeserializerRetrieves adoublevalue from the underlying data source.- Specified by:
getDoublein interfaceIValueDeserializer- Returns:
- The retrieved value
- Throws:
java.lang.NumberFormatException- on format errors
-
getString
public java.lang.String getString()Description copied from interface:IValueDeserializerRetrieves aStringvalue from the underlying data source.- Specified by:
getStringin 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:IValueDeserializerRetrieves aEnumerationvalue from the underlying data source.- Specified by:
getEnumerationin 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
-