public class CollectionUtils extends Object
| Constructor and Description |
|---|
CollectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Comparable<? super T>> |
asSortedList(Collection<T> c)
Given a collection, return it as a list sorted with the default comparator
|
static <T> List<T> |
asSortedList(Collection<T> c,
Comparator<T> comparator)
Given a collection, return it as a list sorted with the given comparator
|
public static <T extends Comparable<? super T>> List<T> asSortedList(Collection<T> c)
T - is the type of the listc - is the collection to sortpublic static <T> List<T> asSortedList(Collection<T> c, Comparator<T> comparator)
T - is the type of the listc - is the collection to sortcomparator - is the function to compare two items in the collectionCopyright © 2017. All rights reserved.