Interface Cache
-
- All Known Implementing Classes:
FormattingCache,MessageCache,MessageCache2
public interface Cache
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description booleanclear()clear all components in the cacheCacheItemget(String key)get a component's cached data by keyStringgetDropId()get a id of translation droplonggetExpiredTime()get expired timelonggetLastClean()get time of last cleanintgetXCapacity()get the cache capacitybooleanisExpired()Deprecated.Use theisExpiredmethod.Set<String>keySet()get the set of cached keysbooleanput(String key, CacheItem cacheItem)put strings to cache by keybooleanremove(String key)remove a component from cache by keyvoidsetExpiredTime(long millis)set expired timevoidsetLastClean(long millis)set time of last cleanvoidsetXCapacity(int capacityX)set the cache's capacity by specifying the count of componentsintsize()get count of current cached components
-
-
-
Method Detail
-
get
CacheItem get(String key)
get a component's cached data by key- Parameters:
key-- Returns:
- CacheItem object instance that holds the cached data (messages and associated properties)
-
put
boolean put(String key, CacheItem cacheItem)
put strings to cache by key- Parameters:
key- cache keycacheItem- item to be stored in the cache- Returns:
- false if failed to put
-
remove
boolean remove(String key)
remove a component from cache by key- Parameters:
key-- Returns:
- false if failed to remove
-
clear
boolean clear()
clear all components in the cache- Returns:
- false if failed to clear
-
size
int size()
get count of current cached components- Returns:
- count of cached components
-
getExpiredTime
long getExpiredTime()
get expired time- Returns:
- long time
-
setExpiredTime
void setExpiredTime(long millis)
set expired time- Parameters:
millis-
-
getLastClean
long getLastClean()
get time of last clean- Returns:
- long time
-
setLastClean
void setLastClean(long millis)
set time of last clean- Parameters:
millis-
-
setXCapacity
void setXCapacity(int capacityX)
set the cache's capacity by specifying the count of components- Parameters:
capacityX-
-
getXCapacity
int getXCapacity()
get the cache capacity- Returns:
- cache capacity
-
isExpired
boolean isExpired()
Deprecated.Use theisExpiredmethod.
-
getDropId
String getDropId()
get a id of translation drop- Returns:
- a drop id
-
-