Class ListBuilder<E>

java.lang.Object
com.kingsrook.qqq.backend.core.utils.collections.ListBuilder<E>

public class ListBuilder<E> extends Object
List.of is "great", but annoying because it makes unmodifiable lists... So, replace it with this, which returns ArrayLists, which "don't suck" Can use it 3 ways: ListBuilder.of(value, value2, ...) => List (an ArrayList) ListBuilder.of(SomeList::new).with(value).with(value2)...build() => SomeList (the type you specify) new ListBuilder..with(value).with(value2)...build() => List (an ArrayList - for when you have more than 10 values...)
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
     
    static <E> List<E>
    of(E e1)
     
    static <E> List<E>
    of(E e1, E e2)
     
    static <E> List<E>
    of(E e1, E e2, E e3)
     
    static <E> List<E>
    of(E e1, E e2, E e3, E e4)
     
    static <E> List<E>
    of(E e1, E e2, E e3, E e4, E e5)
     
    static <E> List<E>
    of(E e1, E e2, E e3, E e4, E e5, E e6)
     
    static <E> List<E>
    of(E e1, E e2, E e3, E e4, E e5, E e6, E e7)
     
    static <E> List<E>
    of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8)
     
    static <E> List<E>
    of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9)
     
    static <E> List<E>
    of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10)
     
    with(E value)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ListBuilder

      public ListBuilder()
      Constructor
    • ListBuilder

      public ListBuilder(List<E> list)
      Constructor
  • Method Details

    • with

      public ListBuilder<E> with(E value)
    • build

      public List<E> build()
    • of

      public static <E> List<E> of(E e1)
    • of

      public static <E> List<E> of(E e1, E e2)
    • of

      public static <E> List<E> of(E e1, E e2, E e3)
    • of

      public static <E> List<E> of(E e1, E e2, E e3, E e4)
    • of

      public static <E> List<E> of(E e1, E e2, E e3, E e4, E e5)
    • of

      public static <E> List<E> of(E e1, E e2, E e3, E e4, E e5, E e6)
    • of

      public static <E> List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7)
    • of

      public static <E> List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8)
    • of

      public static <E> List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9)
    • of

      public static <E> List<E> of(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10)