public class ListUtils extends Object
Constructor and Description |
---|
ListUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
isEmpty(List<T> list)
checks whether a list is null or empty
|
static <T> boolean |
isNotEmpty(List<T> list)
checks whether a list contains at least one entry
|
static <T> void |
mergeLists(List<T> baseList,
List<T> newItems)
merges the entries from newItems into the baseList
this implementation does adopt items from the baseList to the newItems in the same order - without creating a new list - without touching existing entries (which should not be removed) This implementation only works if .equals() of the type T is implemented in a proper way |
static <T> Iterable<T> |
nullSafe(Iterable<T> it)
Get a nullsafe Iterable.
|
public static <T> Iterable<T> nullSafe(Iterable<T> it)
it
- the iterable collection or nullpublic static <T> void mergeLists(List<T> baseList, List<T> newItems)
baseList
- the base list which will be alterednewItems
- the new entries which should be merged into the the existing listpublic static <T> boolean isEmpty(List<T> list)
list
- the list to checkpublic static <T> boolean isNotEmpty(List<T> list)
list
- the list to checkCopyright © 2012–2019 tinyMediaManager. All rights reserved.