Class Cache<T>
java.lang.Object
swervelib.core.parser.Cache<T>
Cache for frequently requested data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetValue()Get the most up to date cached value.booleanisStale()Return whether the cache is stale.update()Update the cache value and timestamp.updateSupplier(Supplier<T> supplier) Update the supplier to a new source.updateValidityPeriod(long validityPeriod) Update the validity period for the cached value, also updates the value.
-
Constructor Details
-
Cache
-
-
Method Details
-
isStale
public boolean isStale()Return whether the cache is stale.- Returns:
- The stale state of the cache.
-
update
-
updateSupplier
-
updateValidityPeriod
-
getValue
-