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

com.boozallen.drift.detection.TimestampDeserializer Maven / Gradle / Ivy

Go to download

The drift detection domain contains the domain objects representing what's needed to use drift detection

There is a newer version: 1.10.0
Show newest version
package com.boozallen.drift.detection;

/*-
 * #%L
 * Drift Detection::Domain
 * %%
 * Copyright (C) 2021 Booz Allen
 * %%
 * This software package is licensed under the Booz Allen Public License. All Rights Reserved.
 * #L%
 */

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

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

/**
 * Deserializer for the drift detection result timestamp.
 */
public class TimestampDeserializer extends JsonDeserializer {

    @Override
    public Instant deserialize(JsonParser parser, DeserializationContext context) throws IOException {
        String timestamp = parser.getText();
        return Instant.parse(timestamp);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy