Package org.thymeleaf.util
Class ListUtils
- Object
-
- org.thymeleaf.util.ListUtils
-
public final class ListUtils extends Object
- Since:
- 1.0
- Author:
- Daniel Fernández
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
contains(List<?> target, Object element)
static boolean
containsAll(List<?> target, Object[] elements)
static boolean
containsAll(List<?> target, Collection<?> elements)
static boolean
isEmpty(List<?> target)
static int
size(List<?> target)
static <T extends Comparable<? super T>>
List<T>sort(List<T> list)
Creates an new instance of the list add the sorted list to it.static <T> List<T>
sort(List<T> list, Comparator<? super T> c)
Creates an new instance of the list add the sorted list to it.static List<?>
toList(Object target)
-
-
-
Method Detail
-
size
public static int size(List<?> target)
-
isEmpty
public static boolean isEmpty(List<?> target)
-
containsAll
public static boolean containsAll(List<?> target, Collection<?> elements)
-
sort
public static <T extends Comparable<? super T>> List<T> sort(List<T> list)
Creates an new instance of the list add the sorted list to it.
- Type Parameters:
T
- the type of the list elements.- Parameters:
list
- the list which content should be ordered.- Returns:
- a new sorted list.
- See Also:
Collections.sort(List)
-
sort
public static <T> List<T> sort(List<T> list, Comparator<? super T> c)
Creates an new instance of the list add the sorted list to it.
- Type Parameters:
T
- the type of the list elements.- Parameters:
list
- the list which content should be ordered.c
- the comparator.- Returns:
- a new sorted list.
- See Also:
Collections.sort(List, Comparator)
-
-