Class ValueCache<T>

java.lang.Object
net.botwithus.rs3.btree.ValueCache<T>
Type Parameters:
T - the type of the value to store

public class ValueCache<T> extends Object
A simple cache for storing a value and checking if it is still valid.
  • Constructor Details

    • ValueCache

      public ValueCache(T result, int expirationTime)
    • ValueCache

      public ValueCache(T result)
  • Method Details

    • setValue

      public void setValue(T result)
      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

      public T getResult()
      Get the value of the cache
      Returns:
      the value stored in the cache
    • getInitialExpirationTime

      public int getInitialExpirationTime()
    • getBooleanResultType

      public ValueCache.ResultType getBooleanResultType()
      Get the value of the cache as a boolean
      Returns:
      the value stored in the cache