Interface MutableEntry<K,​V>

    • Method Detail

      • exists

        boolean exists()
        Checks for the existence of the entry in the cache
        Returns:
        true if the entry exists
      • remove

        void remove()
        Removes the entry from the Cache.

        This has the same semantics as calling Cache.remove(K).

      • getValue

        V getValue()
        Returns the value stored in the cache.

        If the cache is configured to use read-through, and this method would return null because the entry is missing from the cache, the Cache's CacheLoader is called in an attempt to load the entry.

        Specified by:
        getValue in interface Cache.Entry<K,​V>
        Returns:
        the value corresponding to this entry
      • setValue

        void setValue​(V value)
        Sets or replaces the value associated with the key.

        If exists() is false and setValue is called then a mapping is added to the cache visible once the EntryProcessor completes. Moreover a second invocation of exists() will return true.

        Parameters:
        value - the value to update the entry with
        Throws:
        java.lang.ClassCastException - if the implementation supports and is configured to perform runtime-type-checking, and value type is incompatible with that which has been configured for the Cache