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

com.liberologico.cloudesire.cmw.model.serializer.PortsDeserializer Maven / Gradle / Ivy

The newest version!
package com.liberologico.cloudesire.cmw.model.serializer;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.liberologico.cloudesire.cmw.model.dto.DockerComposeServiceDTO;

import java.io.IOException;

public class PortsDeserializer extends JsonDeserializer
{
    @Override
    public DockerComposeServiceDTO.Ports deserialize( JsonParser jp, DeserializationContext ctxt ) throws IOException
    {
        String[] portsPair = jp.getValueAsString().split( ":" );
        return new DockerComposeServiceDTO.Ports( portsPair );
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy