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

com.treasuredata.client.model.StringToNumberSerializer Maven / Gradle / Ivy

There is a newer version: 1.1.1
Show newest version
package com.treasuredata.client.model;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;

import java.io.IOException;

class StringToNumberSerializer
        extends StdSerializer
{
    public StringToNumberSerializer()
    {
        super(String.class);
    }

    @Override
    public void serialize(String s, JsonGenerator jsonGenerator, SerializerProvider serializerProvider)
            throws IOException
    {
        jsonGenerator.writeNumber(Integer.parseInt(s));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy