public class CollectionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
addToList(List<T> list,
Collection<T> addedElements)
Static helper that adds elements to an existing List, or
creates a new LinkedList if nothing was added before.
|
static <T> Map<String,T> |
addToMap(Map<String,T> map,
String key,
T value)
|
static <T> Set<T> |
addToSet(Set<T> set,
Collection<T> addedElements)
|
public static <T> Set<T> addToSet(Set<T> set, Collection<T> addedElements)
T - the type of the set and added elementsset - the set to which the elements are added, or null if no set exists yetaddedElements - the elements that are to be addedpublic static <T> List<T> addToList(List<T> list, Collection<T> addedElements)
T - the type of the list and added elementslist - the list to which the elements are added, or null if no list exists yetaddedElements - the elements that are to be addedpublic static <T> Map<String,T> addToMap(Map<String,T> map, String key, T value)
T - the type of the added valuemap - the map to which the value is added, or null if no map exists yetkey - the key at which the value is stored in the mapvalue - the value that is to be put into the mapCopyright © 2017–2019. All rights reserved.