com.fasterxml.clustermate.json.KeySpaceSerializer 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)
package com.fasterxml.clustermate.json;
import java.io.IOException;
import com.fasterxml.clustermate.api.KeySpace;
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;
public class KeySpaceSerializer extends StdScalarSerializer
{
public KeySpaceSerializer() { super(KeySpace.class); }
@Override
public void serialize(KeySpace value, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonGenerationException
{
jgen.writeNumber(value.getLength());
}
}