Class StickySupplier<T>

java.lang.Object
me.hsgamer.hscore.common.CachedValue<T>
me.hsgamer.hscore.common.supplier.StickySupplier<T>
Type Parameters:
T - the value's type.
All Implemented Interfaces:
Supplier<T>

public final class StickySupplier<T> extends CachedValue<T> implements Supplier<T>
a class that uses Supplier and caches it to use after.
  • Constructor Details

    • StickySupplier

      public StickySupplier(@NotNull @NotNull Supplier<T> origin)
      ctor.
      Parameters:
      origin - the original Supplier.
    • StickySupplier

      public StickySupplier(@NotNull T origin)
      ctor.
      Parameters:
      origin - the original StickySupplier.
  • Method Details

    • get

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

      public T generate()
      Description copied from class: CachedValue
      Generate the value
      Specified by:
      generate in class CachedValue<T>
      Returns:
      the value