Interface MutableListFactory
- All Known Implementing Classes:
MutableListFactoryImpl
public interface MutableListFactory
-
Method Summary
Modifier and Type Method Description <T> MutableList<T>
empty()
<T> MutableList<T>
fromStream(Stream<? extends T> stream)
default <T> MutableList<T>
of()
Same asempty()
.default <T> MutableList<T>
of(T... items)
Same aswith(Object[])
.default <T> MutableList<T>
ofAll(Iterable<? extends T> iterable)
Same aswithAll(Iterable)
.default <T> MutableList<T>
ofInitialCapacity(int capacity)
Same asempty()
.default <T> MutableList<T>
with()
Same asempty()
.<T> MutableList<T>
with(T... items)
Creates a new list using the passeditems
argument as the backing store.<T> MutableList<T>
withAll(Iterable<? extends T> iterable)
<T> MutableList<T>
withInitialCapacity(int capacity)
Same asempty()
.<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.
-
Method Details
-
empty
- Since:
- 6.0
-
of
Same asempty()
. -
with
Same asempty()
. -
of
Same aswith(Object[])
. -
with
Creates a new list using the passeditems
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. !!!
-
wrapCopy
Creates a new list by first copying the array passed in. -
ofInitialCapacity
Same asempty()
. but takes in initial capacity. -
withInitialCapacity
Same asempty()
. but takes in initial capacity. -
ofAll
Same aswithAll(Iterable)
. -
withAll
-
fromStream
- Since:
- 10.0.
-
withNValues
-