Enum KryoSerializer

java.lang.Object
java.lang.Enum<KryoSerializer>
org.mybatis.caches.redis.KryoSerializer
All Implemented Interfaces:
Serializable, Comparable<KryoSerializer>, Serializer

public enum KryoSerializer extends Enum<KryoSerializer> implements Serializer
SerializeUtil with Kryo, which is faster and less space consuming.
Author:
Lei Jiang(ladd.cn@gmail.com)
  • Enum Constant Details

  • Method Details

    • values

      public static KryoSerializer[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static KryoSerializer valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • serialize

      public byte[] serialize(Object object)
      Description copied from interface: Serializer
      Serialize method
      Specified by:
      serialize in interface Serializer
      Parameters:
      object -
      Returns:
      serialized bytes
    • unserialize

      public Object unserialize(byte[] bytes)
      Description copied from interface: Serializer
      Unserialize method
      Specified by:
      unserialize in interface Serializer
      Parameters:
      bytes -
      Returns:
      unserialized object