<commit_before>package com.andyadc.scaffold.serialization;

import com.andyadc.scaffold.serialization.binary.JDKSerializer;
import com.andyadc.scaffold.serialization.compression.CompressorType;
import com.andyadc.scaffold.serialization.json.FastjsonSerializer;
import com.andyadc.scaffold.serialization.json.JacksonSerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author andaicheng
 * @version 2016/12/30
 */
public class SerializerExecutor {

    private static final Logger LOG = LoggerFactory.getLogger(SerializerExecutor.class);

    public static <T> byte[] serialize(T object) {
        return null;
    }

    public static <T> T deserialize(byte[] bytes) {
        return null;

    }

    public static <T> byte[] serialize(T object, boolean compress) {
        return null;

    }

    public static <T> T deserialize(byte[] bytes, boolean compress) {
        return null;

    }

    public static <T> String toJson(T object) {
        return null;

    }

    public static <T> T fromJson(String json, Class<T> clazz) {
        return null;

    }

    public static <T> byte[] serialize(T object, SerializerType serializerType, CompressorType compressorType, boolean compress, boolean serializerLogPrint) {
        return null;

    }

    public static <T> T deserialize(byte[] bytes, SerializerType serializerType, CompressorType compressorType, boolean compress, boolean serializerLogPrint) {
        if (compress) {
            print(bytes, null, false, true, serializerLogPrint);

            bytes = decompress(bytes, compressorType);

            print(bytes, null, false, false, serializerLogPrint);
        }

        T object = null;
        if (serializerType == SerializerType.FST_BINARY) {

        } else if (serializerType == SerializerType.KRYO_BINARY) {

        } else if (serializerType == SerializerType.JDK_BINARY) {
            object = JDKSerializer.deserialize(bytes);
        } else {
            throw new SerializerException("Invalid serializer type of binary : " + serializerType);
        }

        if (!compress) {
            print(bytes, object.getClass(), false, false, serializerLogPrint);<commit_msg>SerializerExecutor<commit_after>package com.andyadc.scaffold.serialization;

import com.andyadc.scaffold.serialization.binary.FSTSerializer;
import com.andyadc.scaffold.serialization.binary.JDKSerializer;
import com.andyadc.scaffold.serialization.compression.CompressorType;
import com.andyadc.scaffold.serialization.json.FastjsonSerializer;
import com.andyadc.scaffold.serialization.json.JacksonSerializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author andaicheng
 * @version 2016/12/30
 */
public class SerializerExecutor {

    private static final Logger LOG = LoggerFactory.getLogger(SerializerExecutor.class);

    public static <T> byte[] serialize(T object) {
        return null;
    }

    public static <T> T deserialize(byte[] bytes) {
        return null;

    }

    public static <T> byte[] serialize(T object, boolean compress) {
        return null;

    }

    public static <T> T deserialize(byte[] bytes, boolean compress) {
        return null;

    }

    public static <T> String toJson(T object) {
        return null;

    }

    public static <T> T fromJson(String json, Class<T> clazz) {
        return null;

    }

    public static <T> byte[] serialize(T object, SerializerType serializerType, CompressorType compressorType, boolean compress, boolean serializerLogPrint) {
        return null;

    }

    public static <T> T deserialize(byte[] bytes, SerializerType serializerType, CompressorType compressorType, boolean compress, boolean serializerLogPrint) {
        if (compress) {
            print(bytes, null, false, true, serializerLogPrint);
            bytes = decompress(bytes, compressorType);
            print(bytes, null, false, false, serializerLogPrint);
        }

        T object = null;
        if (serializerType == SerializerType.FST_BINARY) {
            object = FSTSerializer.deserialize(bytes);
        } else if (serializerType == SerializerType.KRYO_BINARY) {

        } else if (serializerType == SerializerType.JDK_BINARY) {
            object = JDKSerializer.deserialize(bytes);
        } else {
            throw new SerializerException("Invalid serializer type of binary : " + serializerType);
        }

        if (!compress) {
            print(bytes, object.getClass(), false, false, serializerLogPrint);
{'fraction_non_alphanumeric': 0.09537636810364084, 'fraction_numerical': 0.004467277194549922, 'mean_word_length': 3.173345759552656, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '264563', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1255, 'n_words': 319}