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 TypeMethodDescriptionboolean
int
Returns the expiration time of the cache.getID()
Returns the cache ID.int
Returns the maximum size of the cache.double
Returns the precision of a GeoLocation cache.int
hashCode()
boolean
isGeo()
Returns whether this is a geolocation cache.boolean
isRemote()
Returns whether this is a remote cache.void
setExpiryTime
(int time) Sets the cache expiration time.void
setGeo
(boolean isGeo) Sets whether this is a GeoLocation cache.void
setMaxSize
(int size) Sets the maximum size of the cache.void
setPrecision
(double amt) Sets the preicsion of a GeoLocation cache.void
setRemote
(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
-