@Override
    public byte[] serialize(Object object) throws SerializationException {
        if (object == null) {
            return new byte[0];
        }
        try {
            return JSON.toJSONBytes(object, SerializerFeature.WriteClassName);
        } catch (Exception ex) {
            throw new SerializationException("Could not serialize: " + ex.getMessage(), ex);
        }
    }
Fastjson for Spring Data Redis Serializer(Generic implement).
<p>
Compatible fastjson 1.2.x

@author lihengming
@author Victor.Zxy
@see RedisSerializer
@since 2.0.2
fastjson1-compatible/src/main/java/com/alibaba/fastjson/support/spring/GenericFastJsonRedisSerializer.java