Class ListFactory


  • public final class ListFactory
    extends java.lang.Object
    The factory class ListFactory provides factory methods for create new Map objects
    • Constructor Summary

      Constructors 
      Constructor Description
      ListFactory()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.util.List<T> newArrayList​(java.lang.Iterable<T> iterable, T... elements)
      Factory method for create new ArrayList from the given optional iterable and the given optional elements.
      static <T> java.util.List<T> newArrayList​(java.util.Collection<T> collection, T... elements)
      Factory method for create new ArrayList from the given optional collection and the given optional elements.
      static <T> java.util.List<T> newArrayList​(java.util.Iterator<T> iterator, T... elements)
      Factory method for create new ArrayList from the given optional iterator and the given optional elements.
      static <T> java.util.List<T> newArrayList​(T... elements)
      Factory method for create new ArrayList from the given optional elements.
      static <T> java.util.List<T> newLinkedList​(java.util.Collection<T> collection, T... elements)
      Factory method for create new LinkedList from the given optional collection and the given optional elements.
      static <T> java.util.List<T> newLinkedList​(T... elements)
      Factory method for create new LinkedList from the given optional elements.
      static java.util.List<java.lang.Integer> newRangeList​(int start, int end)
      Creates a new Integer List with the given range that is defined through start and end.
      • Methods inherited from class java.lang.Object

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

      • ListFactory

        public ListFactory()
    • Method Detail

      • newArrayList

        @SafeVarargs
        public static <T> java.util.List<T> newArrayList​(java.util.Iterator<T> iterator,
                                                         T... elements)
        Factory method for create new ArrayList from the given optional iterator and the given optional elements.
        Type Parameters:
        T - the generic type of the elements
        Parameters:
        iterator - the optional iterator that will be added to the new list
        elements - the optional elements to be added in the new ArrayList.
        Returns:
        the new ArrayList as List.
      • newArrayList

        @SafeVarargs
        public static <T> java.util.List<T> newArrayList​(java.lang.Iterable<T> iterable,
                                                         T... elements)
        Factory method for create new ArrayList from the given optional iterable and the given optional elements.
        Type Parameters:
        T - the generic type of the elements
        Parameters:
        iterable - the optional iterable that will be added to the new list
        elements - the optional elements to be added in the new ArrayList.
        Returns:
        the new ArrayList as List.
      • newArrayList

        @SafeVarargs
        public static <T> java.util.List<T> newArrayList​(java.util.Collection<T> collection,
                                                         T... elements)
        Factory method for create new ArrayList from the given optional collection and the given optional elements.
        Type Parameters:
        T - the generic type of the elements
        Parameters:
        collection - the optional collection that will be added to the new list
        elements - the optional elements to be added in the new ArrayList.
        Returns:
        the new ArrayList as List.
      • newArrayList

        @SafeVarargs
        public static <T> java.util.List<T> newArrayList​(T... elements)
        Factory method for create new ArrayList from the given optional elements.
        Type Parameters:
        T - the generic type of the elements
        Parameters:
        elements - the elements to add in the new ArrayList.
        Returns:
        the new ArrayList as List.
      • newRangeList

        public static java.util.List<java.lang.Integer> newRangeList​(int start,
                                                                     int end)
        Creates a new Integer List with the given range that is defined through start and end. For instance if the start is 5 and the end is 9 the resulted List will be [5,6,7,8,9]
        Parameters:
        start - The number to start
        end - The number to end minus one
        Returns:
        the generated Integer List
      • newLinkedList

        @SafeVarargs
        public static <T> java.util.List<T> newLinkedList​(java.util.Collection<T> collection,
                                                          T... elements)
        Factory method for create new LinkedList from the given optional collection and the given optional elements.
        Type Parameters:
        T - the generic type of the elements
        Parameters:
        collection - the optional collection that will be added to the new list
        elements - the optional elements to be added in the new LinkedList.
        Returns:
        the new LinkedList as List.
      • newLinkedList

        @SafeVarargs
        public static <T> java.util.List<T> newLinkedList​(T... elements)
        Factory method for create new LinkedList from the given optional elements.
        Type Parameters:
        T - the generic type of the elements
        Parameters:
        elements - the elements to add in the new LinkedList.
        Returns:
        the new LinkedList as List.