Class ListUtil


  • public final class ListUtil
    extends Object
    • Method Detail

      • addArray

        public static <T> void addArray​(List<T> list,
                                        T[] array)
        Add all items in an array to a list.
      • newList

        public static <T> List<T> newList()
      • toStringArray

        public static String[] toStringArray​(List<?> list)
        Convert a List to a String[]
      • newListFromCollection

        public static <T> List<T> newListFromCollection​(Collection<T> c)
        Create a new List from a Collection
      • newListFromIterator

        public static <T> List<? extends T> newListFromIterator​(Iterator<? extends T> iter)
        Create a new List from a Collection
      • newList

        public static <T> List<T> newList​(T m1)
        Create a new List with one member.
      • newList

        public static <T> List<T> newList​(T m1,
                                          T m2)
        Create a new List with two members.
      • newList

        public static <T> List<T> newList​(T m1,
                                          T m2,
                                          T m3)
        Create a new List with three members.
      • newList

        public static <T> List<T> newList​(T m1,
                                          T m2,
                                          T m3,
                                          T m4)
        Create a new List with four members.
      • newList

        public static <T> List<T> newList​(T m1,
                                          T m2,
                                          T m3,
                                          T m4,
                                          T m5)
        Create a new List with four members.
      • newListFromArray

        public static <T> List<T> newListFromArray​(T[] items)
      • reverse

        public static <T> List<T> reverse​(List<T> list)
        Return a new List in reverse order. Because the List is new, it works on any list, modifiable or not.