public class NullSafeCopies extends Object
Modifier and Type | Method and Description |
---|---|
static <E> List<E> |
copyOf(E[] array) |
static <E> List<E> |
copyOf(Iterable<E> list) |
static <E> List<E> |
copyOf(List<E> list) |
static <K,V> Map<K,V> |
copyOf(Map<K,V> map) |
static <E> List<E> |
copyWithNullOf(E[] array)
Copies given array into immutable
List with keeping null value if provided. |
static <E> List<E> |
copyWithNullOf(Iterable<E> iterable)
|
static <E> List<E> |
copyWithNullOf(List<E> list)
Copies given List with keeping null value if provided.
|
static <K,V> Map<K,V> |
copyWithNullOf(Map<K,V> map)
Copies given Map with keeping null value if provided.
|
public static <E> List<E> copyWithNullOf(@Nullable List<E> list)
list
- instance to copy (maybe null
)null
then immutable copy;
null
otherwisepublic static <K,V> Map<K,V> copyWithNullOf(@Nullable Map<K,V> map)
map
- instance to copy (maybe null
)null
then immutable copy;
null
otherwisepublic static <E> List<E> copyWithNullOf(@Nullable Iterable<E> iterable)
iterable
- instance to copy (maybe null
)null
then immutable copy;
null
otherwiseCopyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.