public class CollectionUtils extends Object
| Constructor and Description |
|---|
CollectionUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T,U> Map<T,List<U>> |
deepCopiedUnmodifiableMap(Map<T,? extends List<U>> map)
Perform a deep copy of the provided map of lists, and make the result unmodifiable.
|
static <T,U> Map<T,List<U>> |
deepCopyMap(Map<T,? extends List<U>> map)
Perform a deep copy of the provided map of lists.
|
static <T,U> Map<T,List<U>> |
deepUnmodifiableLinkedMap(Map<T,? extends List<U>> map)
Create an unmodifiable version of the provdied map of lists.
|
static <T,U> Map<T,List<U>> |
deepUnmodifiableMap(Map<T,? extends List<U>> map)
Create an unmodifiable version of the provdied map of lists.
|
static <T> boolean |
isNullOrEmpty(Collection<T> collection) |
static String |
join(Collection<String> toJoin,
String separator)
Joins a collection of strings with the given separator into a single string.
|
static <T> List<T> |
mergeLists(List<T> list1,
List<T> list2)
Returns a new list containing the second list appended to the first list.
|
public static <T> boolean isNullOrEmpty(Collection<T> collection)
public static <T> List<T> mergeLists(List<T> list1, List<T> list2)
public static String join(Collection<String> toJoin, String separator)
toJoin - Collection containing items to join.separator - String to join items with.public static <T,U> Map<T,List<U>> deepCopyMap(Map<T,? extends List<U>> map)
public static <T,U> Map<T,List<U>> deepUnmodifiableMap(Map<T,? extends List<U>> map)
deepCopyMap(Map), or use deepCopiedUnmodifiableMap(Map)public static <T,U> Map<T,List<U>> deepUnmodifiableLinkedMap(Map<T,? extends List<U>> map)
deepCopyMap(Map), or use deepCopiedUnmodifiableMap(Map)public static <T,U> Map<T,List<U>> deepCopiedUnmodifiableMap(Map<T,? extends List<U>> map)
deepCopyMap(Map) followed by deepUnmodifiableMap(Map), because only one intermediate map copy
is created.Copyright © 2017. All rights reserved.