Class DisabledCache<K,V>

java.lang.Object
com.okta.sdk.impl.cache.DisabledCache<K,V>
All Implemented Interfaces:
Cache<K,V>

public class DisabledCache<K,V> extends Object implements Cache<K,V>
A disabled implementation that does nothing. This is useful for a CacheManager implementation to return instead of retuning null. Non-null guarantees reduce a program's cyclomatic complexity.
Since:
0.5.0
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    get(K key)
    This implementation does not do anything and always returns null.
    put(K key, V value)
    This implementation does not do anything (no caching) and always returns null.
    remove(K key)
    This implementation does not do anything (no caching) and always returns null.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DisabledCache

      public DisabledCache()
  • Method Details

    • get

      public V get(K key)
      This implementation does not do anything and always returns null.
      Specified by:
      get in interface Cache<K,V>
      Parameters:
      key - the key that the value was previous added with
      Returns:
      null always.
    • put

      public V put(K key, V value)
      This implementation does not do anything (no caching) and always returns null.
      Specified by:
      put in interface Cache<K,V>
      Parameters:
      key - the key used to identify the object being stored.
      value - the value to be stored in the cache.
      Returns:
      null always.
    • remove

      public V remove(K key)
      This implementation does not do anything (no caching) and always returns null.
      Specified by:
      remove in interface Cache<K,V>
      Parameters:
      key - the key used to identify the object being stored.
      Returns:
      null always.