Top Description Fields Constructors Methods
net.sf.ehcache

public Class CacheEntry

extends Object
Class Inheritance

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.

Author
Geert Bevin
Version
$Id: CacheEntry.java 10789 2018-04-26 02:08:13Z adahanne $

Field Summary

Modifier and TypeField and Description
private final Element
private final Object

Constructor Summary

AccessConstructor and Description
public
CacheEntry(Object
the key of the entry
key
,
Element
the element of the entry or null if no element corresponds to the key at this time
element
)

Creates a new cache entry.

Method Summary

Modifier and TypeMethod and Description
public Element

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.
getElement
()

Retrieves the element of this cache entry.

public Object

Returns:

the request key
getKey
()

Retrieves the key of this cache entry.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

elementback to summary
private final Element element
keyback to summary
private final Object key

Constructor Detail

CacheEntryback to summary
public CacheEntry(Object key, Element element)

Creates a new cache entry.

Parameters
key:Object

the key of the entry

element:Element

the element of the entry or null if no element corresponds to the key at this time

Method Detail

getElementback to summary
public Element getElement()

Retrieves the element of this cache entry.

Returns:Element

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.

getKeyback to summary
public Object getKey()

Retrieves the key of this cache entry.

Returns:Object

the request key