public final class ListUtils extends Object
Modifier and Type | Method and Description |
---|---|
static boolean |
contains(List<?> target,
Object element) |
static boolean |
containsAll(List<?> target,
Collection<?> elements) |
static boolean |
containsAll(List<?> target,
Object[] elements) |
static boolean |
isEmpty(List<?> target) |
static int |
size(List<?> target) |
static <T extends Comparable<? super 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) |
public static int size(List<?> target)
public static boolean isEmpty(List<?> target)
public static boolean containsAll(List<?> target, Collection<?> elements)
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.
T
- the type of the list elements.list
- the list which content should be ordered.Collections.sort(List)
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.
T
- the type of the list elements.list
- the list which content should be ordered.c
- the comparator.Collections.sort(List, Comparator)
Copyright © 2016 The THYMELEAF team. All rights reserved.