class IndexableHelper
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
(package private) static <T> Indexable<T> |
frozenFromArray(T[] array) |
(package private) static <T> Indexable<T> |
frozenFromList(java.util.List<T> list)
Create a frozen indexable from a list.
|
(package private) static <T> Indexable<T> |
frozenFromList(java.util.List<T> list,
java.util.function.Function<? super T,? extends T> elementCloner)
Create a frozen indexable from a list while keeping possibly mutable elements safe.
|
@NotNull static <T> Indexable<T> frozenFromList(@NotNull java.util.List<T> list)
T
- element type of indexable/listlist
- list to be wrapped by an indexable@NotNull static <T> Indexable<T> frozenFromList(@NotNull java.util.List<T> list, @NotNull java.util.function.Function<? super T,? extends T> elementCloner)
T
- element type of indexable/listlist
- list to be wrapped by an indexableelementCloner
- function called for each requested element which returns a copy it