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

pl.allegro.tech.hermes.api.jackson.EndpointAddressDeserializer Maven / Gradle / Ivy

There is a newer version: 2.6.22
Show newest version
package pl.allegro.tech.hermes.api.jackson;

import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonNode;
import pl.allegro.tech.hermes.api.EndpointAddress;

import java.io.IOException;

public class EndpointAddressDeserializer extends JsonDeserializer {

    @Override
    public EndpointAddress deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {
        JsonNode node = jp.getCodec().readTree(jp);
        return new EndpointAddress(node.asText());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy