All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.twitch4j.common.util.MilliInstantDeserializer Maven / Gradle / Ivy

package com.github.twitch4j.common.util;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;

import java.io.IOException;
import java.time.DateTimeException;
import java.time.Instant;

public class MilliInstantDeserializer extends JsonDeserializer {
    @Override
    public Instant deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, DateTimeException, ArithmeticException {
        return Instant.ofEpochMilli(p.getValueAsLong());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy