public interface MutableListFactory
| Modifier and Type | Method and Description |
|---|---|
<T> MutableList<T> |
empty() |
<T> MutableList<T> |
fromStream(Stream<? extends T> stream) |
default <T> MutableList<T> |
of()
Same as
empty(). |
default <T> MutableList<T> |
of(T... items)
Same as
with(Object[]). |
default <T> MutableList<T> |
ofAll(Iterable<? extends T> iterable)
Same as
withAll(Iterable). |
default <T> MutableList<T> |
ofInitialCapacity(int capacity)
Same as
empty(). |
default <T> MutableList<T> |
with()
Same as
empty(). |
<T> MutableList<T> |
with(T... items)
Creates a new list using the passed
items argument as the backing store. |
<T> MutableList<T> |
withAll(Iterable<? extends T> iterable) |
<T> MutableList<T> |
withInitialCapacity(int capacity)
Same as
empty(). |
<T> MutableList<T> |
withNValues(int size,
Function0<? extends T> factory) |
default <T> MutableList<T> |
wrapCopy(T... array)
Creates a new list by first copying the array passed in.
|
<T> MutableList<T> empty()
default <T> MutableList<T> of()
empty().default <T> MutableList<T> with()
empty().default <T> MutableList<T> of(T... items)
with(Object[]).<T> MutableList<T> with(T... items)
items argument as the backing store.
!!! WARNING: This method uses the passed in array, so can be very unsafe if the original array is held onto anywhere else. !!!
default <T> MutableList<T> wrapCopy(T... array)
default <T> MutableList<T> ofInitialCapacity(int capacity)
empty(). but takes in initial capacity.<T> MutableList<T> withInitialCapacity(int capacity)
empty(). but takes in initial capacity.default <T> MutableList<T> ofAll(Iterable<? extends T> iterable)
withAll(Iterable).<T> MutableList<T> withAll(Iterable<? extends T> iterable)
<T> MutableList<T> fromStream(Stream<? extends T> stream)
<T> MutableList<T> withNValues(int size, Function0<? extends T> factory)
Copyright © 2004–2022. All rights reserved.