Class CacheItem

java.lang.Object
org.casbin.jcasbin.persist.cache.CacheItem

public class CacheItem extends Object
  • Field Details

  • Constructor Details

    • CacheItem

      CacheItem()
    • CacheItem

      public CacheItem(boolean value, Duration ttl)
      Constructs a CacheItem with a specified value and time-to-live (ttl).
      Parameters:
      value - The boolean value to be cached.
      ttl - The duration for which this item should remain in the cache.
  • Method Details

    • isExpired

      public boolean isExpired()
      Checks whether the cache item has expired based on the current time and its ttl.
      Returns:
      True if the cache item is expired, false otherwise.
    • getValue

      public boolean getValue()
      Retrieves the cached value.
      Returns:
      The boolean value stored in this cache item.