java.lang.Object
com.maxmind.db.NoCache
All Implemented Interfaces:
NodeCache

public class NoCacheextends Object implements NodeCache
A no-op cache singleton.
  • Field Details

    • INSTANCE

      private static final NoCache INSTANCE
      The single instance, shared by every reader.
  • Constructor Details

    • NoCache

      private NoCache()
      Utility class, not intended for instantiation.
  • Method Details

    • get

      public Object get(int key, NodeCache.Loader loader) throws IOException
      Description copied from interface: NodeCache
      Get a value from the cache, loading it if necessary.
      Specified by:
      get in interface NodeCache
      Parameters:
      key - the cache key
      loader - the loader to use if the key is not in cache
      Returns:
      the cached or loaded value
      Throws:
      IOException - if loading fails
    • getInstance

      public static NoCache getInstance()
      Get the singleton instance.
      Returns:
      the NoCache singleton