Interface MutableListFactory

All Known Implementing Classes:

public interface MutableListFactory
  • Method Details

    • empty

      <T> MutableList<T> empty()
    • of

      default <T> MutableList<T> of()
      Same as empty().
    • with

      default <T> MutableList<T> with()
      Same as empty().
    • of

      default <T> MutableList<T> of(T... items)
    • with

      <T> MutableList<T> with(T... items)
      Creates a new list using the passed 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. !!!

    • 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 as empty(). but takes in initial capacity.
    • withInitialCapacity

      <T> MutableList<T> withInitialCapacity(int capacity)
      Same as empty(). but takes in initial capacity.
    • ofAll

      default <T> MutableList<T> ofAll(Iterable<? extends T> iterable)
    • withAll

      <T> MutableList<T> withAll(Iterable<? extends T> iterable)
    • fromStream

      <T> MutableList<T> fromStream(Stream<? extends T> stream)
    • withNValues

      <T> MutableList<T> withNValues(int size, Function0<? extends T> factory)