Class Lazy<T>

java.lang.Object
dev.latvian.mods.kubejs.util.Lazy<T>
All Implemented Interfaces:
Supplier<T>

public class Lazy<T> extends Object implements Supplier<T>
  • Method Details

    • of

      public static <T> Lazy<T> of(Supplier<T> supplier)
    • of

      public static <T> Lazy<T> of(Supplier<T> supplier, Duration expires)
    • serviceLoader

      public static <T> Lazy<T> serviceLoader(Class<T> type)
    • map

      public static <K, V> Lazy<Map<K,V>> map(Consumer<Map<K,V>> supplier)
    • identityMap

      public static <K, V> Lazy<Map<K,V>> identityMap(Consumer<Map<K,V>> supplier)
    • get

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

      public void forget()