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 Details

    • CodecRedisCacheProperties

      public CodecRedisCacheProperties()
      Creates the properties with their defaults.
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Whether codec serializes Redis cache values.
      Returns:
      true unless disabled
    • setEnabled

      public void setEnabled(boolean enabled)
      Sets whether codec serializes Redis cache values.
      Parameters:
      enabled - false to leave every cache on Spring Boot's serializer
    • getDefaultType

      public String getDefaultType()
      The value type for caches not listed under getCaches().
      Returns:
      the fully qualified class name, or null to leave them on Boot's serializer
    • setDefaultType

      public void setDefaultType(String defaultType)
      Sets the value type for caches not listed under getCaches().
      Parameters:
      defaultType - the fully qualified class name, or null
    • getCaches

      public Map<String,String> getCaches()
      Cache name to the fully qualified class name of the values it holds.
      Returns:
      the mapping; empty by default
    • setCaches

      public void setCaches(Map<String,String> caches)
      Sets the cache name to value type mapping.
      Parameters:
      caches - cache name to fully qualified class name