Class CachingSupplier<T>

java.lang.Object
com.djrapitops.plan.delivery.domain.container.CachingSupplier<T>
All Implemented Interfaces:
Supplier<T>

public class CachingSupplier<T> extends Object implements Supplier<T>
Caching layer between Supplier and caller.

Refreshes the value if 30 seconds have passed since the last call.

  • Constructor Details

    • CachingSupplier

      public CachingSupplier(Supplier<T> original)
    • CachingSupplier

      public CachingSupplier(Supplier<T> original, long timeToLive)
  • Method Details

    • get

      public T get()
      Specified by:
      get in interface Supplier<T>