Class LazyValue<T>

java.lang.Object
com.github.victools.jsonschema.generator.impl.LazyValue<T>
Type Parameters:
T - type of wrapped value

public class LazyValue<T> extends Object
Wrapper for a value that should only be lazily initialised when being accessed for the first time.
  • Constructor Details

    • LazyValue

      public LazyValue(Supplier<? extends T> supplier)
      Constructor, not yet invoking the given Supplier.
      Parameters:
      supplier - value look-up to be performed the first time get() is being called
  • Method Details

    • get

      public T get()
      Look-up the wrapped value, loading it on first invocation.
      Returns:
      wrapped value