Class SimpleCache

java.lang.Object
io.ipinfo.api.cache.SimpleCache
All Implemented Interfaces:
Cache

public class SimpleCache
extends Object
implements Cache
  • Constructor Details

    • SimpleCache

      public SimpleCache​(Duration duration)
  • Method Details

    • get

      public Object get​(String key)
      Description copied from interface: Cache
      Gets an arbitrary object stored in cache.
      Specified by:
      get in interface Cache
      Parameters:
      key - the key that maps to the object.
      Returns:
      the value mapped to from `key`.
    • set

      public boolean set​(String key, Object val)
      Description copied from interface: Cache
      Sets a key/value pair in the cache.
      Specified by:
      set in interface Cache
      Parameters:
      key - the key.
      val - the value.
      Returns:
      if caching was successful.
    • clear

      public boolean clear()
      Description copied from interface: Cache
      Clears all entries in the cache.
      Specified by:
      clear in interface Cache
      Returns:
      if clear was successful.