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

com.rapid7.container.analyzer.docker.util.InstantCustomDeserializer Maven / Gradle / Ivy

There is a newer version: 0.2.26
Show newest version
package com.rapid7.container.analyzer.docker.util;

import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer;
import java.time.Instant;
import java.time.format.DateTimeFormatter;

public class InstantCustomDeserializer extends InstantDeserializer {

  public static final InstantCustomDeserializer INSTANT = new InstantCustomDeserializer(Instant.class, InstantParser.INSTANT_FORMATTER);

  protected InstantCustomDeserializer(Class supportedType, DateTimeFormatter formatter) {
    super(supportedType, formatter, Instant::from, a -> Instant.ofEpochMilli(a.value), a -> Instant.ofEpochSecond(a.integer, a.fraction), null, true);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy