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

com.fasterxml.clustermate.json.KeySpaceSerializer 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)

The newest version!
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());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy