Class TtlCache.CachedValue<V>

java.lang.Object
com.activeviam.tech.core.internal.cache.TtlCache.CachedValue<V>
Type Parameters:
V - the type of the value
Enclosing class:
TtlCache<K,V>

public static class TtlCache.CachedValue<V> extends Object
Adds timestamp information to the cached values.
  • Method Details

    • invalid

      public static <V> TtlCache.CachedValue<V> invalid(long time)
      Create an invalid cached value.
      Type Parameters:
      V - the contained type.
      Parameters:
      time - the prescribed creation time
      Returns:
      the invalid cached value.
    • temporary

      public static <V> TtlCache.CachedValue<V> temporary(long time)
      Create a temporary CachedValue, with the #beingCreated flag set to true. A temporary value is always invalid.
      Type Parameters:
      V - The contained type.
      Parameters:
      time - the prescribed creation time
      Returns:
      a temporary cached value.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object