Package tenapull.data.deserialize
Class EpochTimestamp.Deserializer
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<java.sql.Timestamp>
tenapull.data.deserialize.EpochTimestamp.Deserializer
- All Implemented Interfaces:
com.fasterxml.jackson.databind.deser.NullValueProvider
- Enclosing class:
- EpochTimestamp
public static class EpochTimestamp.Deserializer
extends com.fasterxml.jackson.databind.JsonDeserializer<java.sql.Timestamp>
Deserializes a JSON integer representing seconds into a java.sql.Timestamp
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description Deserializer()
-
Method Summary
Modifier and Type Method Description java.sql.Timestamp
deserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt)
Obtains the timestamp as text and passes to the static deserialize method, which does the work of converting to java.sql.Timestampstatic java.sql.Timestamp
deserialize(java.lang.String timestamp)
Static utility which is invoked by the instance deserialize method, and can also be invoked by other classes.Methods inherited from class com.fasterxml.jackson.databind.JsonDeserializer
deserialize, deserializeWithType, deserializeWithType, findBackReference, getDelegatee, getEmptyAccessPattern, getEmptyValue, getEmptyValue, getKnownPropertyNames, getNullAccessPattern, getNullValue, getNullValue, getObjectIdReader, handledType, isCachable, replaceDelegatee, supportsUpdate, unwrappingDeserializer
-
Constructor Details
-
Deserializer
public Deserializer()
-
-
Method Details
-
deserialize
public java.sql.Timestamp deserialize(com.fasterxml.jackson.core.JsonParser jp, com.fasterxml.jackson.databind.DeserializationContext ctxt) throws java.io.IOException, com.fasterxml.jackson.core.JsonProcessingExceptionObtains the timestamp as text and passes to the static deserialize method, which does the work of converting to java.sql.Timestamp- Specified by:
deserialize
in classcom.fasterxml.jackson.databind.JsonDeserializer<java.sql.Timestamp>
- Parameters:
jp
-ctxt
-- Returns:
- The converted timestamp
- Throws:
java.io.IOException
com.fasterxml.jackson.core.JsonProcessingException
-
deserialize
public static java.sql.Timestamp deserialize(java.lang.String timestamp)Static utility which is invoked by the instance deserialize method, and can also be invoked by other classes. Takes an epoch timestamp string in seconds, adds three zeros to convert to milliseconds, parses as an int, and then converts to a java.sql.Timestamp- Parameters:
timestamp
- string in seconds- Returns:
- the converted timestamp
-