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

com.tosan.tools.tracker.starter.serialization.NumberSerializer Maven / Gradle / Ivy

The newest version!
package com.tosan.tools.tracker.starter.serialization;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;

import java.io.IOException;

/**
 * @author AmirHossein ZamanZade
 * @since 5/17/2023
 */
public class NumberSerializer extends JsonSerializer {

    private final BaseFieldMaskSerializer baseSerializer;

    public NumberSerializer(BaseFieldMaskSerializer baseSerializer) {
        this.baseSerializer = baseSerializer;
    }

    @Override
    public void serialize(Number value, JsonGenerator jsonGenerator, SerializerProvider serializers) throws IOException {
        baseSerializer.serialize(value.toString(), jsonGenerator, serializers);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy