com.ideaaedi.extspringcache.custom.ExtRedisSerializerCustomizer Maven / Gradle / Ivy
The newest version!
package com.ideaaedi.extspringcache.custom;
import org.springframework.data.redis.cache.RedisCacheConfiguration;
import org.springframework.data.redis.serializer.RedisSerializationContext;
import org.springframework.lang.NonNull;
/**
* redis序列化器定制器
*
* @author JustryDeng
* @since 2023-05-31 11:58:33
*/
public interface ExtRedisSerializerCustomizer {
/**
* 定制redis key序列化器
*
* 默认为:RedisSerializationContext.SerializationPair.fromSerializer(new StringRedisSerializer(StandardCharsets.UTF_8));
*
*
* @return redis key序列化器
*
* @see RedisCacheConfiguration#serializeKeysWith(RedisSerializationContext.SerializationPair)
*/
@NonNull
RedisSerializationContext.SerializationPair keySerializer();
/**
* 定制redis value序列化器
*
* 默认为:RedisSerializationContext.SerializationPair.fromSerializer(new JdkSerializationRedisSerializer(classLoader))
*
*
* @return redis value序列化器
*
* @see RedisCacheConfiguration#serializeValuesWith(RedisSerializationContext.SerializationPair)
*/
@NonNull
RedisSerializationContext.SerializationPair