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:

  1. ISO 8601 notation
  2. Compact notation
If the input does not match either format, an 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
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(com.fasterxml.jackson.core.JsonParser p, com.fasterxml.jackson.databind.DeserializationContext ctxt)
    Deserializes a JSON string into a TableDuration object.

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 a TableDuration object.
      Specified by:
      deserialize in class com.fasterxml.jackson.databind.JsonDeserializer<TableDuration>
      Parameters:
      p - the JsonParser providing the JSON input
      ctxt - the DeserializationContext in which the deserializer is operating
      Returns:
      a TableDuration object representing the parsed duration
      Throws:
      IOException - if the input string is not a valid duration format