public class CacheItem
extends java.lang.Object
| Constructor and Description |
|---|
CacheItem(boolean value,
java.time.Duration ttl)
Constructs a CacheItem with a specified value and time-to-live (ttl).
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getValue()
Retrieves the cached value.
|
boolean |
isExpired()
Checks whether the cache item has expired based on the current time and its ttl.
|
public CacheItem(boolean value,
java.time.Duration ttl)
value - The boolean value to be cached.ttl - The duration for which this item should remain in the cache.public boolean isExpired()
public boolean getValue()
Copyright © 2017–2025. All rights reserved.