com.fasterxml.clustermate.json.IpAndPortSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clustermate-json Show documentation
Show all versions of clustermate-json Show documentation
Converters for ClusterMate and StoreMate datatypes,
for Jackson-based JSON serialization
(as well as other dataformats Jackson supports, like Smile)
The 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());
}
}