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

com.cedarsoftware.io.writers.DurationWriter Maven / Gradle / Ivy

There is a newer version: 4.30.0
Show newest version
package com.cedarsoftware.io.writers;

import java.io.IOException;
import java.io.Writer;
import java.time.Duration;

import com.cedarsoftware.io.JsonWriter;
import com.cedarsoftware.io.WriterContext;
import com.cedarsoftware.io.Writers;

public class DurationWriter extends Writers.PrimitiveUtf8StringWriter {
    @Override
    public void writePrimitiveForm(Object o, Writer output, WriterContext context) throws IOException {
        Duration d = (Duration) o;
        JsonWriter.writeJsonUtf8String(output, d.toString());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy