Class CacheEntry


  • public class CacheEntry
    extends java.lang.Object
    Entry for cache.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected long cachedate
      The cache data.
      protected java.lang.Object data
      The cache data.
      protected long ttl
      The time to live.
    • Constructor Summary

      Constructors 
      Constructor Description
      CacheEntry​(java.lang.Object data, long cachedate, long ttl)
      Create a new cache entry.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getCacheDate()
      Get the cachedate.
      java.lang.Object getData()
      Get the data.
      long getTimeToLive()
      Get the ttl.
      boolean isExpired​(long now)
      Test if a cache entry is expired.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • data

        protected java.lang.Object data
        The cache data.
      • cachedate

        protected long cachedate
        The cache data.
      • ttl

        protected long ttl
        The time to live.
    • Constructor Detail

      • CacheEntry

        public CacheEntry​(java.lang.Object data,
                          long cachedate,
                          long ttl)
        Create a new cache entry.
    • Method Detail

      • getData

        public java.lang.Object getData()
        Get the data.
        Returns:
        the data.
      • getCacheDate

        public long getCacheDate()
        Get the cachedate.
        Returns:
        the cachedate.
      • getTimeToLive

        public long getTimeToLive()
        Get the ttl.
        Returns:
        the ttl.
      • isExpired

        public boolean isExpired​(long now)
        Test if a cache entry is expired.
        Parameters:
        now - The current time (-1 for never expire).
        Returns:
        True, if it is expired.