Module watamebot

Class CachedObject<T>

java.lang.Object
net.foxgenesis.property.CachedObject<T>

public class CachedObject<T> extends Object
  • Constructor Details

    • CachedObject

      public CachedObject(@NotNull @NotNull Supplier<T> supplier, long duration)
    • CachedObject

      public CachedObject(@NotNull @NotNull Supplier<T> supplier, long duration, boolean getNow)
  • Method Details

    • get

      @Nullable public T get()
    • getAsync

      @NotNull public @NotNull CompletableFuture<T> getAsync()
    • set

      public void set(T value)
    • invalidate

      public void invalidate()
    • getExpirationTime

      @NotNull public @NotNull Duration getExpirationTime()