Class CodecRedisCacheProperties
java.lang.Object
org.jwcarman.codec.autoconfigure.CodecRedisCacheProperties
@ConfigurationProperties(prefix="codec.redis.cache")
public class CodecRedisCacheProperties
extends Object
Settings for serializing Redis cache values through the application's
CodecFactory.
Cache values are heterogeneous but a codec is typed, so each cache that should go through
codec names its value type; unlisted caches keep Spring Boot's default serializer. A backend
whose format is self-describing (Apache Fory) can serve every cache from one codec for
Object — set default-type to java.lang.Object for that.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCache name to the fully qualified class name of the values it holds.The value type for caches not listed undergetCaches().booleanWhether codec serializes Redis cache values.voidSets the cache name to value type mapping.voidsetDefaultType(String defaultType) Sets the value type for caches not listed undergetCaches().voidsetEnabled(boolean enabled) Sets whether codec serializes Redis cache values.
-
Constructor Details
-
CodecRedisCacheProperties
public CodecRedisCacheProperties()Creates the properties with their defaults.
-
-
Method Details
-
isEnabled
public boolean isEnabled()Whether codec serializes Redis cache values.- Returns:
trueunless disabled
-
setEnabled
public void setEnabled(boolean enabled) Sets whether codec serializes Redis cache values.- Parameters:
enabled-falseto leave every cache on Spring Boot's serializer
-
getDefaultType
The value type for caches not listed undergetCaches().- Returns:
- the fully qualified class name, or
nullto leave them on Boot's serializer
-
setDefaultType
Sets the value type for caches not listed undergetCaches().- Parameters:
defaultType- the fully qualified class name, ornull
-
getCaches
-
setCaches
-