-
- Type Parameters:
T
- type of the provided object
- All Superinterfaces:
Collection<T>
,Iterable<T>
,List<T>
public interface LazyList<T> extends List<T>
Wrapper for list ofLazyValue
s while keeping laziness.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(Supplier<T> supplier)
Add another lazy item to the list.static <T> LazyList<T>
create(List<LazyValue<T>> lazyValues)
Create wrapper from provided list ofLazyValue
s.-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Method Detail
-
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 ofLazyValue
s.- Type Parameters:
T
- type of the provided object- Parameters:
lazyValues
- to be wrapped seamlessly while keeping laziness- Returns:
- List invoking underlined
LazyValue
s only when raw value is needed.
-
-