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

com.fasterxml.clustermate.json.IpAndPortSerializer Maven / Gradle / Ivy

Go to download

Converters for ClusterMate and StoreMate datatypes, for Jackson-based JSON serialization (as well as other dataformats Jackson supports, like Smile)

There is a newer version: 0.10.5
Show newest version
package com.fasterxml.clustermate.json;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdScalarSerializer;
import com.fasterxml.storemate.shared.IpAndPort;

public class IpAndPortSerializer extends StdScalarSerializer
{
    public IpAndPortSerializer() {
        super(IpAndPort.class);
    }
    
    @Override
    public void serialize(IpAndPort value, final JsonGenerator jgen, SerializerProvider provider)
            throws IOException, JsonGenerationException
    {
        jgen.writeString(value.toString());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy