public class CollectionUtils extends Object
| Constructor and Description |
|---|
CollectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Set<T> |
asSet(T... elements)
Converts the given array of elements to a set.
|
static Collection<?> |
convertToCollection(Object object)
Converts the given array or collection object (possibly primitive array) to type Collection
|
static Object[] |
convertToObjectArray(Object object)
Converts the given array object (possibly primitive array) to type Object[]
|
static <T> List<T> |
subList(List<T> list,
int fromIndex,
int toIndex)
Gets a list containing all elements from the given index to the given index.
|
public static <T> List<T> subList(List<T> list, int fromIndex, int toIndex)
list - The original listfromIndex - The from indextoIndex - The to indexpublic static <T> Set<T> asSet(T... elements)
elements - The elementspublic static Collection<?> convertToCollection(Object object)
object - The array or collectionCopyright © 2016. All Rights Reserved.