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

org.cloudfoundry.multiapps.controller.api.model.ZonedDateTimeDeserializer Maven / Gradle / Ivy

There is a newer version: 1.183.0
Show newest version
package org.cloudfoundry.multiapps.controller.api.model;

import java.io.IOException;
import java.time.ZonedDateTime;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;

public class ZonedDateTimeDeserializer extends StdDeserializer {

    private static final long serialVersionUID = 1L;

    public ZonedDateTimeDeserializer() {
        super(ZonedDateTime.class);
    }

    @Override
    public ZonedDateTime deserialize(JsonParser parser, DeserializationContext context) throws IOException {
        String zonedDateTime = parser.getCodec()
                                     .readValue(parser, String.class);
        return ZonedDateTime.parse(zonedDateTime, Operation.DATE_TIME_FORMATTER);
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy