Package kos.core

Class Lang.Lazy<T>

  • Type Parameters:
    T -
    All Implemented Interfaces:
    Supplier<T>
    Enclosing class:
    Lang

    public static class Lang.Lazy<T>
    extends Object
    implements Supplier<T>
    Wraps elements that should be load lazily to avoid issues when loading them using Dependency Injection libraries other than SPI.
    • Field Detail

      • supplier

        private final Supplier<T> supplier
      • data

        private T data
    • Constructor Detail

      • Lazy

        public Lazy()
    • Method Detail

      • get

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

        public void set​(T newData)