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

org.boon.slumberdb.serialization.JsonSerializerBytes Maven / Gradle / Ivy

package org.boon.slumberdb.serialization;

import org.boon.core.Function;
import org.boon.json.serializers.impl.JsonSimpleSerializerImpl;

import java.nio.charset.StandardCharsets;

/**
 * Created by Richard on 4/9/14.
 */
public class JsonSerializerBytes implements Function {


    /**
     * JSON valueObjectConverter we are using.
     */
    protected JsonSimpleSerializerImpl serializer = new JsonSimpleSerializerImpl();

    public JsonSerializerBytes(Class type) {
    }

    @Override
    public byte[] apply(T t) {
        return serializer.serialize(t).toString().getBytes(StandardCharsets.UTF_8);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy