Class TableDurationDeserializer
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<TableDuration>
com.datastax.astra.internal.serdes.tables.TableDurationDeserializer
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
public class TableDurationDeserializer
extends com.fasterxml.jackson.databind.JsonDeserializer<TableDuration>
A custom deserializer for converting JSON strings into
TableDuration objects.
Supports both ISO 8601 duration notation (e.g., "P1Y2M10DT2H30M") and compact notation (e.g., "1y2mo10d2h30m").
The deserializer attempts to parse the input string in the following order:
- ISO 8601 notation
- Compact notation
IOException is thrown.-
Nested Class Summary
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.JsonDeserializer
com.fasterxml.jackson.databind.JsonDeserializer.None -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt) Deserializes a JSON string into aTableDurationobject.Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getAbsentValue, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, logicalType, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
TableDurationDeserializer
public TableDurationDeserializer()Default constructor.
-
-
Method Details
-
deserialize
public TableDuration deserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws IOException Deserializes a JSON string into aTableDurationobject.- Specified by:
deserializein classcom.fasterxml.jackson.databind.JsonDeserializer<TableDuration>- Parameters:
p- theJsonParserproviding the JSON inputctxt- theDeserializationContextin which the deserializer is operating- Returns:
- a
TableDurationobject representing the parsed duration - Throws:
IOException- if the input string is not a valid duration format
-