Example usage for org.springframework.data.redis.serializer SerializationException SerializationException

List of usage examples for org.springframework.data.redis.serializer SerializationException SerializationException

Introduction

In this page you can find the example usage for org.springframework.data.redis.serializer SerializationException SerializationException.

Prototype

public SerializationException(String msg) 

Source Link

Document

Constructs a new SerializationException instance.

Usage

From source file:com.redis.cluster.support.serializer.DefaultKeySerializer.java

@Override
public byte[] serialize(Object t) throws SerializationException {
    clazz.set(t.getClass());/*from   ww  w. j a va2s.  c  o m*/
    if (clazz.get().equals(String.class) || clazz.get().equals(Long.class)
            || clazz.get().equals(Integer.class)) {
        String string = String.valueOf(t);
        return (string == null ? null : string.getBytes(charset));
    }
    throw new SerializationException("Key just support String, Integer, Long!");
}