Interface MutableListFactory
-
- All Known Implementing Classes:
MutableListFactoryImpl
public interface MutableListFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> MutableList<T>
empty()
<T> MutableList<T>
fromStream(java.util.stream.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(java.lang.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(java.lang.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 Detail
-
empty
<T> MutableList<T> empty()
- Since:
- 6.0
-
of
default <T> MutableList<T> of()
Same asempty()
.
-
with
default <T> MutableList<T> with()
Same asempty()
.
-
of
default <T> MutableList<T> of(T... items)
Same aswith(Object[])
.
-
with
<T> MutableList<T> with(T... items)
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
default <T> MutableList<T> wrapCopy(T... array)
Creates a new list by first copying the array passed in.
-
ofInitialCapacity
default <T> MutableList<T> ofInitialCapacity(int capacity)
Same asempty()
. but takes in initial capacity.
-
withInitialCapacity
<T> MutableList<T> withInitialCapacity(int capacity)
Same asempty()
. but takes in initial capacity.
-
ofAll
default <T> MutableList<T> ofAll(java.lang.Iterable<? extends T> iterable)
Same aswithAll(Iterable)
.
-
withAll
<T> MutableList<T> withAll(java.lang.Iterable<? extends T> iterable)
-
fromStream
<T> MutableList<T> fromStream(java.util.stream.Stream<? extends T> stream)
- Since:
- 10.0.
-
withNValues
<T> MutableList<T> withNValues(int size, Function0<? extends T> factory)
-
-