public interface CacheItem
| Modifier and Type | Field and Description |
|---|---|
static long |
NEVER_EXPIRE
Indicates that an item should never expire.
|
static long |
NEVER_REFRESH
Indicates that an item should never refresh.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
getKey()
Returns the item's key, used to identify the item within the cache.
|
CacheLoader |
getLoader()
Returns the
CacheLoader used to refresh this item. |
Object[] |
getLoaderParams()
Returns the additional parameters required by the
CacheLoader.load(Object...) method. |
String |
getScope()
Returns the item's scope.
|
long |
getTicksAtCreation()
Returns the number of ticks that had passed at the moment the item was created.
|
long |
getTicksToExpire()
Returns the number of ticks that are required for the item to expire.
|
long |
getTicksToRefresh()
Returns the number of ticks the are required for the item to be refreshed.
|
Object |
getValue()
Returns the item's value.
|
boolean |
isExpired(long currentTicks)
Returns true if the item has expired according to the number of ticks specified.
|
boolean |
needsRefresh(long currentTicks)
Returns true if the item needs to be refreshed according to the number of ticks specified.
|
static final long NEVER_EXPIRE
static final long NEVER_REFRESH
String getScope()
Object getKey()
Object getValue()
long getTicksAtCreation()
long getTicksToExpire()
long getTicksToRefresh()
CacheLoader getLoader()
CacheLoader used to refresh this item.Object[] getLoaderParams()
CacheLoader.load(Object...) method.boolean isExpired(long currentTicks)
currentTicks - the current number of ticksboolean needsRefresh(long currentTicks)
currentTicks - the current number of ticksCopyright © 2018 CrafterCMS. All rights reserved.