Package com.storedobject.common
Class ListUtility
java.lang.Object
com.storedobject.common.ListUtility
A utility class that provides methods to convert various types of collections
and iterables into lists or arrays.
- Author:
- Syam
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T[]Converts anIterableinto an array.static <T> T[]array(Collection<T> list) Converts aCollectioninto an array.static <T> List<T> static <T> List<T> static <T> List<T> list(T[] list) Converts an array into aList.
-
Method Details
-
list
-
list
-
list
-
array
-
array
Converts aCollectioninto an array. The method creates a new array of the same size as the providedCollectionand populates it with the elements from theCollection.- Type Parameters:
T- the type of elements in theCollection- Parameters:
list- theCollectionto be converted into an array- Returns:
- an array containing all elements from the given
Collection
-