public class CollectionUtil extends Object
Modifier and Type | Method and Description |
---|---|
static <S,T> void |
addCollectionToMapOfSets(Map<S,Set<T>> map,
S key,
Collection<T> values) |
static <S,T> void |
addToMapOfLists(Map<S,List<T>> map,
S key,
T value) |
static <S,T> void |
addToMapOfSets(Map<S,Set<T>> map,
S key,
T value) |
static <T> List<T> |
asArrayList(T[] values)
Arrays.asList cannot be reliably used for SQL parameters on MyBatis < 3.3.0
|
static <T> Set<T> |
asHashSet(T... elements) |
static <T> List<T> |
collectInList(Iterator<T> iterator) |
static boolean |
isEmpty(Collection<?> collection) |
static <T> List<List<T>> |
partition(List<T> list,
int partitionSize)
Chops a list into non-view sublists of length partitionSize.
|
static Map<String,Object> |
singletonMap(String key,
Object value)
Helper method that creates a singleton map.
|
public static Map<String,Object> singletonMap(String key, Object value)
public static <T> List<T> asArrayList(T[] values)
public static <T> Set<T> asHashSet(T... elements)
public static <S,T> void addCollectionToMapOfSets(Map<S,Set<T>> map, S key, Collection<T> values)
public static <T> List<List<T>> partition(List<T> list, int partitionSize)
public static boolean isEmpty(Collection<?> collection)
Copyright © 2021. All rights reserved.