package com.community.commom.redis;

/**
 * redis 序列化工具接口
 * @author gengxiang
 * @create 2017-09-06 18:04
 *
 **/
public interface RedisSerializer {
    /**
     * Deserialize
     *
     * @param source serialized data
     * @param tClass generic class type
     * @param <T>    generic class
     * @return object
     * @throws SerializationFailedException
     */
    <T> T deserialize(byte[] source, Class<T> tClass) throws SerializationFailedException;

    /**
     * Serialize
     *
     * @param object object
     * @return serialized data
     * @throws SerializationFailedException
     */
    byte[] serialize(Object object) throws SerializationFailedException;

}
