public class CacheEntry<V> extends Object implements Serializable
This class represents an entry in a class.
Each entry holds an object and some statistics on that object, like its expiration date, last accessed date and the amount of times it has been request from the cache.
Cache,
Serialized Form| Constructor and Description |
|---|
CacheEntry()
Default constructor, creates a new
CacheEntry instance. |
CacheEntry(V entryObj)
Creates a new
CacheEntry object instance. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(String key)
Returns
true if this entry contains the mapping for the specified
property name key. |
Date |
getExpirationDate()
Deprecated.
|
Map<String,Serializable> |
getExtendedProperties()
Retrieves the properties
Map instance. |
int |
getHits()
Deprecated.
|
long |
getLastAccessedTimeMillis()
Deprecated.
|
V |
getObject()
Retrieves the object associated with this cache entry.
|
Object |
getProperty(String key)
Retrieve the property value associated with the key
key. |
void |
incrementHits()
Deprecated.
|
void |
resetHits()
Deprecated.
|
void |
setExpirationDate(Date expirationDate)
Deprecated.
|
void |
setExtendedProperties(Map<String,Serializable> newProperties)
Sets the new properties
Map instance. |
void |
setLastAccessedTimeNow()
Deprecated.
|
void |
setObject(V object)
Sets/Updates the object associated to this cache entry.
|
void |
setProperty(String key,
Serializable value)
Set the property of name
key with the specified value
value. |
public CacheEntry()
Default constructor, creates a new CacheEntry instance.
public CacheEntry(V entryObj)
Creates a new CacheEntry object instance.
entryObj - the object instance to associate with the cache entrypublic V getObject()
Retrieves the object associated with this cache entry.
public void setObject(V object)
Sets/Updates the object associated to this cache entry.
object - the new object to store in this cache entry.public void setProperty(String key, Serializable value)
Set the property of name key with the specified value
value.
Properties can have a null value, but key names do not. When a property
already exists in the cache entry, the property's value is updated. When the
name is null, the set operation is canceled.
key - the property's keyvalue - the property's valuepublic Object getProperty(String key)
Retrieve the property value associated with the key key.
Properties can have a null value, but key names must be not
null. When value of null is returned, it does mean
the key is not found in the entry or the associated property has a
null value. The two cases can be distinguished with the
containsKey() method.
key - the property keypublic boolean containsKey(String key)
Returns true if this entry contains the mapping for the specified
property name key.
key - the property nametrue if this entry contains the mapping for the specified
property name key.public Map<String,Serializable> getExtendedProperties()
Retrieves the properties Map instance.
Map instancepublic void setExtendedProperties(Map<String,Serializable> newProperties)
Sets the new properties Map instance. The operation is
ignored if the newProperties is null.
newProperties - the new properties@Deprecated public final int getHits()
Retrieves the number of hits of the entry (the number of times the entry was requested).
@Deprecated public final void resetHits()
Resets the number of times the entry was requested.
@Deprecated public final void incrementHits()
Increments the number of hits by one.
@Deprecated public final Date getExpirationDate()
Retrieves the entry's expiration date.
@Deprecated public final void setExpirationDate(Date expirationDate)
Sets the entry's expiration date.
expirationDate - the expiration date@Deprecated public final void setLastAccessedTimeNow()
Set the last accessed date to the current time.
@Deprecated public long getLastAccessedTimeMillis()
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.