Class DisabledCacheManager

java.lang.Object
com.okta.sdk.impl.cache.DisabledCacheManager
All Implemented Interfaces:
CacheManager

public class DisabledCacheManager extends Object implements CacheManager
A disabled implementation that does nothing. This alleviates a CacheManager user (component) from ever needing to check for null. Non-null guarantees reduce a program's cyclomatic complexity and simplify testing.
Since:
0.5.0
  • Constructor Details

    • DisabledCacheManager

      public DisabledCacheManager()
  • Method Details

    • getCache

      public <K, V> Cache<K,V> getCache(String name)
      Always returns a DisabledCache instance to ensure non-null guarantees.
      Specified by:
      getCache in interface CacheManager
      Type Parameters:
      K - type of cache key
      V - type of cache value
      Parameters:
      name - the name of the cache to acquire.
      Returns:
      returns a DisabledCache instance to ensure non-null guarantees.