public final class CollectionUtils extends Object
Internal API: these methods are part of the internal API and may be removed, have their signature change, or have their access level decreased from public to protected, package, or private in future versions without notice.
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
concat(List<T> inputs,
T newValue)
Concat new value to existing inputs and returns new outputs.
|
static boolean |
isEmpty(Collection<?> collection)
Check if a collection is null or empty.
|
static <T> String |
join(Iterable<T> values,
String separator)
Join elements of a collection to a final string using a given separator.
|
static <T,U> List<U> |
map(Collection<T> inputs,
Mapper<T,U> mapper)
Map input values to output values.
|
public static boolean isEmpty(Collection<?> collection)
collection - Collection to check.public static <T> String join(Iterable<T> values, String separator)
values is null, null will be returned.separator is null, an empty string is used instead.T - Type of elements in the collection.values - The values to join.separator - Value separator.public static <T,U> List<U> map(Collection<T> inputs, Mapper<T,U> mapper)
T - Type of input values.U - Type of output values.inputs - Input values.mapper - Mapper function.Copyright © 2018. All rights reserved.