Class GsonRedisSerializer<T>

java.lang.Object
io.github.xezzon.zeroweb.common.redis.GsonRedisSerializer<T>
All Implemented Interfaces:
org.springframework.data.redis.serializer.RedisSerializer<T>

public class GsonRedisSerializer<T> extends Object implements org.springframework.data.redis.serializer.RedisSerializer<T>
Author:
xezzon
  • Constructor Summary

    Constructors
    Constructor
    Description
    GsonRedisSerializer(com.google.common.reflect.TypeToken<T> typeToken)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    deserialize(byte[] bytes)
     
    byte[]
    serialize(T value)
     

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.data.redis.serializer.RedisSerializer

    canSerialize, getTargetType
  • Constructor Details

    • GsonRedisSerializer

      public GsonRedisSerializer(com.google.common.reflect.TypeToken<T> typeToken)
  • Method Details

    • serialize

      public byte[] serialize(T value) throws org.springframework.data.redis.serializer.SerializationException
      Specified by:
      serialize in interface org.springframework.data.redis.serializer.RedisSerializer<T>
      Throws:
      org.springframework.data.redis.serializer.SerializationException
    • deserialize

      public T deserialize(byte[] bytes) throws org.springframework.data.redis.serializer.SerializationException
      Specified by:
      deserialize in interface org.springframework.data.redis.serializer.RedisSerializer<T>
      Throws:
      org.springframework.data.redis.serializer.SerializationException