Package 

Interface CacheMethods


  • 
    public interface CacheMethods<T extends Object>
    
                        

    Interface defining methods for interacting with a cache.

    • Method Summary

      Modifier and Type Method Description
      abstract Boolean add(String key, T value) Adds an object to the cache.
      abstract T get(String key) Retrieves an object from the cache.
      abstract T remove(String key) Removes an object from the cache.
      abstract Unit empty() Clears the entire cache, removing all cached objects.
      abstract Boolean isEmpty() Checks if the cache is empty.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • add

         abstract Boolean add(String key, T value)

        Adds an object to the cache.

        Parameters:
        key - The unique key associated with the object.
        value - The object to be cached.
      • get

         abstract T get(String key)

        Retrieves an object from the cache.

        Parameters:
        key - The unique key associated with the object.
      • remove

         abstract T remove(String key)

        Removes an object from the cache.

        Parameters:
        key - The unique key associated with the object.
      • empty

         abstract Unit empty()

        Clears the entire cache, removing all cached objects.