java.lang.Object
net.botwithus.rs3.btree.ValueCache<T>
- Type Parameters:
T
- the type of the value to store
A simple cache for storing a value and checking if it is still valid.
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the value of the cache as a booleanint
Get the value of the cacheboolean
Set the value of the cache and the expiration timevoid
setExpirationTime
(int expirationTime) void
Set the value of the cache
-
Constructor Details
-
ValueCache
-
ValueCache
-
-
Method Details
-
setValue
Set the value of the cache- Parameters:
result
- the value to store
-
setExpirationTime
public void setExpirationTime(int expirationTime) -
isValidResult
public boolean isValidResult()Set the value of the cache and the expiration time- Returns:
- the value to store
-
getResult
Get the value of the cache- Returns:
- the value stored in the cache
-
getInitialExpirationTime
public int getInitialExpirationTime() -
getBooleanResultType
Get the value of the cache as a boolean- Returns:
- the value stored in the cache
-