Class SimpleObjectCache<T>

  • All Implemented Interfaces:
    ObjectCache<T>

    public class SimpleObjectCache<T>
    extends java.lang.Object
    implements ObjectCache<T>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addObject​(ObjectKey<T> objectKey, T object)
      Adds an object under the given key to the cache.
      void clear()
      Clear the cache.
      T getObject​(ObjectKey<T> objectKey)
      Get the object which is found under the given key.
      T removeObject​(ObjectKey<T> objectKey)
      Removes an object from the cache.
      • Methods inherited from class java.lang.Object

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

      • SimpleObjectCache

        public SimpleObjectCache()
    • Method Detail

      • getObject

        public T getObject​(ObjectKey<T> objectKey)
        Description copied from interface: ObjectCache
        Get the object which is found under the given key. Returns null when no object is found.
        Specified by:
        getObject in interface ObjectCache<T>
        Returns:
        Object or null if there was no object with the given key in the cache.
      • addObject

        public void addObject​(ObjectKey<T> objectKey,
                              T object)
        Description copied from interface: ObjectCache
        Adds an object under the given key to the cache.
        Specified by:
        addObject in interface ObjectCache<T>
        Parameters:
        objectKey - the ObjectKey
        object - the object to be added
      • removeObject

        public T removeObject​(ObjectKey<T> objectKey)
        Description copied from interface: ObjectCache
        Removes an object from the cache.
        Specified by:
        removeObject in interface ObjectCache<T>
        Parameters:
        objectKey - ObjectKey
        Returns:
        the bean if it was mapped before or null
      • clear

        public void clear()
        Description copied from interface: ObjectCache
        Clear the cache.
        Specified by:
        clear in interface ObjectCache<T>