ehcache

net.sf.ehcache
Class CacheEntry

java.lang.Object
  extended by net.sf.ehcache.CacheEntry

public class CacheEntry
extends Object

Helper class to tie a key to an element.

This is used for operations that are identified by a key but that could benefit from additional information that's available in an element when it can be found in the cache. If the element isn't available, it will be null.

Version:
$Id: CacheEntry.java 5594 2012-05-07 16:04:31Z cdennis $
Author:
Geert Bevin

Constructor Summary
CacheEntry(Object key, Element element)
          Creates a new cache entry.
 
Method Summary
 Element getElement()
          Retrieves the element of this cache entry.
 Object getKey()
          Retrieves the key of this cache entry.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheEntry

public CacheEntry(Object key,
                  Element element)
Creates a new cache entry.

Parameters:
key - the key of the entry
element - the element of the entry or null if no element corresponds to the key at this time
Method Detail

getKey

public Object getKey()
Retrieves the key of this cache entry.

Returns:
the request key

getElement

public Element getElement()
Retrieves the element of this cache entry.

Returns:
the element that corresponds to this key or null if the cache entry didn't have an element that belong to the key at the time of creation.

ehcache

Copyright 2001-2016, Terracotta, Inc.