Package org.casbin.jcasbin.persist.cache
Class CacheItem
java.lang.Object
org.casbin.jcasbin.persist.cache.CacheItem
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
value
private boolean value -
expiresAt
-
ttl
-
-
Constructor Details
-
CacheItem
CacheItem() -
CacheItem
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.
-