Class CacheConfig

java.lang.Object
org.deltava.util.cache.CacheConfig

class CacheConfig extends Object
A bean to store cache configuration when initializing caches.
Since:
7.4
Version:
7.4
Author:
Luke
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the configuration bean.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Returns the expiration time of the cache.
    Returns the cache ID.
    int
    Returns the maximum size of the cache.
    double
    Returns the precision of a GeoLocation cache.
    int
     
    boolean
    Returns whether this is a geolocation cache.
    boolean
    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.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CacheConfig

      CacheConfig(String id)
      Creates the configuration bean.
      Parameters:
      id - the cache ID
  • 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

      public String getID()
      Returns the cache ID.
      Returns:
      the ID
    • 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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object