Interface LazyList<T>

Type Parameters:
T - type of the provided object
All Superinterfaces:
Collection<T>, Iterable<T>, List<T>, SequencedCollection<T>

public interface LazyList<T> extends List<T>
Wrapper for list of LazyValues while keeping laziness.
  • Method Details

    • add

      void add(Supplier<T> supplier)
      Add another lazy item to the list.
      Parameters:
      supplier - to be invoke only when necessary
    • create

      static <T> LazyList<T> create(List<LazyValue<T>> lazyValues)
      Create wrapper from provided list of LazyValues.
      Type Parameters:
      T - type of the provided object
      Parameters:
      lazyValues - to be wrapped seamlessly while keeping laziness
      Returns:
      List invoking underlined LazyValues only when raw value is needed.