Class CacheConfig
java.lang.Object
org.deltava.util.cache.CacheConfig
A bean to store cache configuration when initializing caches.
- Since:
- 7.4
- Version:
- 7.4
- Author:
- Luke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanintReturns the expiration time of the cache.getID()Returns the cache ID.intReturns the maximum size of the cache.doubleReturns the precision of a GeoLocation cache.inthashCode()booleanisGeo()Returns whether this is a geolocation cache.booleanisRemote()Returns whether this is a remote cache.voidsetExpiryTime(int time) Sets the cache expiration time.voidsetGeo(boolean isGeo) Sets whether this is a GeoLocation cache.voidsetMaxSize(int size) Sets the maximum size of the cache.voidsetPrecision(double amt) Sets the preicsion of a GeoLocation cache.voidsetRemote(boolean isRemote) Sets whether this is a remote cache.
-
Constructor Details
-
CacheConfig
-
-
Method Details
-
isGeo
public boolean isGeo()Returns whether this is a geolocation cache.- Returns:
- TRUE if geolocation, otherwise FALSE
-
isRemote
public boolean isRemote()Returns whether this is a remote cache.- Returns:
- TRUE if remote, otherwise FALSE
-
getMaxSize
public int getMaxSize()Returns the maximum size of the cache.- Returns:
- the maximum size
-
getExpiryTime
public int getExpiryTime()Returns the expiration time of the cache.- Returns:
- the expiration time in seconds
-
getPrecision
public double getPrecision()Returns the precision of a GeoLocation cache.- Returns:
- the precision rounding factor
-
getID
-
setGeo
public void setGeo(boolean isGeo) Sets whether this is a GeoLocation cache.- Parameters:
isGeo- TRUE if geolocation, otherwise FALSE
-
setRemote
public void setRemote(boolean isRemote) Sets whether this is a remote cache.- Parameters:
isRemote- TRUE if remote, otherwise FALSE
-
setMaxSize
public void setMaxSize(int size) Sets the maximum size of the cache.- Parameters:
size- the maximum number of cache entries
-
setExpiryTime
public void setExpiryTime(int time) Sets the cache expiration time.- Parameters:
time- the expiration time in seconds
-
setPrecision
public void setPrecision(double amt) Sets the preicsion of a GeoLocation cache.- Parameters:
amt- the rounding factor to apply
-
hashCode
-
equals
-