Package de.alpharogroup.collections.list
Class ListFactory
- java.lang.Object
-
- de.alpharogroup.collections.list.ListFactory
-
public final class ListFactory extends java.lang.ObjectThe factory classListFactoryprovides factory methods for create newMapobjects
-
-
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 newArrayListfrom 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 newArrayListfrom 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 newArrayListfrom the given optional iterator and the given optional elements.static <T> java.util.List<T>newArrayList(T... elements)Factory method for create newArrayListfrom the given optional elements.static <T> java.util.List<T>newLinkedList(java.util.Collection<T> collection, T... elements)Factory method for create newLinkedListfrom the given optional collection and the given optional elements.static <T> java.util.List<T>newLinkedList(T... elements)Factory method for create newLinkedListfrom the given optional elements.static java.util.List<java.lang.Integer>newRangeList(int start, int end)Creates a newIntegerListwith the given range that is defined through start and end.
-
-
-
Method Detail
-
newArrayList
@SafeVarargs public static <T> java.util.List<T> newArrayList(java.util.Iterator<T> iterator, T... elements)Factory method for create newArrayListfrom 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 listelements- the optional elements to be added in the newArrayList.- Returns:
- the new
ArrayListasList.
-
newArrayList
@SafeVarargs public static <T> java.util.List<T> newArrayList(java.lang.Iterable<T> iterable, T... elements)Factory method for create newArrayListfrom 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 listelements- the optional elements to be added in the newArrayList.- Returns:
- the new
ArrayListasList.
-
newArrayList
@SafeVarargs public static <T> java.util.List<T> newArrayList(java.util.Collection<T> collection, T... elements)Factory method for create newArrayListfrom 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 listelements- the optional elements to be added in the newArrayList.- Returns:
- the new
ArrayListasList.
-
newArrayList
@SafeVarargs public static <T> java.util.List<T> newArrayList(T... elements)
Factory method for create newArrayListfrom the given optional elements.- Type Parameters:
T- the generic type of the elements- Parameters:
elements- the elements to add in the newArrayList.- Returns:
- the new
ArrayListasList.
-
newRangeList
public static java.util.List<java.lang.Integer> newRangeList(int start, int end)Creates a newIntegerListwith the given range that is defined through start and end. For instance if the start is 5 and the end is 9 the resultedListwill be [5,6,7,8,9]- Parameters:
start- The number to startend- The number to end minus one- Returns:
- the generated
IntegerList
-
newLinkedList
@SafeVarargs public static <T> java.util.List<T> newLinkedList(java.util.Collection<T> collection, T... elements)Factory method for create newLinkedListfrom 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 listelements- the optional elements to be added in the newLinkedList.- Returns:
- the new
LinkedListasList.
-
newLinkedList
@SafeVarargs public static <T> java.util.List<T> newLinkedList(T... elements)
Factory method for create newLinkedListfrom the given optional elements.- Type Parameters:
T- the generic type of the elements- Parameters:
elements- the elements to add in the newLinkedList.- Returns:
- the new
LinkedListasList.
-
-