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

com.glookast.commons.timecode.json.TimecodeSerializer Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package com.glookast.commons.timecode.json;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import com.glookast.commons.timecode.AbstractTimecode;
import com.glookast.commons.timecode.Timecode;

import java.io.IOException;

public class TimecodeSerializer extends StdSerializer
{
    protected TimecodeSerializer()
    {
        super(Timecode.class);
    }

    @Override
    public void serialize(Timecode value, JsonGenerator gen, SerializerProvider provider) throws IOException
    {
        gen.writeString(value.toString(AbstractTimecode.StringType.STORAGE));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy