public class CollectionUtils extends Object
Constructor and Description |
---|
CollectionUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> com.google.common.collect.ImmutableList<T> |
copyOfOrEmpty(List<T> input)
Creates an immutable list with the elements of the given list.
|
static <K,V> com.google.common.collect.ImmutableMap<K,V> |
copyOfOrEmpty(Map<K,V> input)
Creates an immutable map with the elements of the given map.
|
static <T> com.google.common.collect.ImmutableSet<T> |
copyOfOrEmpty(Set<T> input)
Creates an immutable set with the elements of the given set.
|
public static <T> com.google.common.collect.ImmutableList<T> copyOfOrEmpty(@Nullable List<T> input)
null
, it returns an empty list.input
- The list used to build the immutable one.public static <T> com.google.common.collect.ImmutableSet<T> copyOfOrEmpty(@Nullable Set<T> input)
null
, it returns an empty set.input
- The set used to build the immutable one.public static <K,V> com.google.common.collect.ImmutableMap<K,V> copyOfOrEmpty(@Nullable Map<K,V> input)
null
, it returns an empty map.input
- The map used to build the immutable one.Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.