public class Transform
Transformation utilities.
This includes:
| Type Params | Return Type | Name and description |
|---|---|---|
<OUT> |
public static OUT |
convertItem(Object input, java.util.function.Function<Object, OUT> transformer)Converts an item using a specified transformer. |
<OUT> |
public static OUT |
convertItemOrNull(Object input, java.util.function.Function<Object, OUT> transformer)Converts an item using a specified transformer. |
<OUT> |
public static java.util.Collection<OUT> |
convertItems(java.util.Collection<?> inputs, java.util.Collection<OUT> target, java.util.function.Function<Object, OUT> transformer)Converts a collection type using a specified transformer |
<OUT> |
public static java.util.Collection<OUT> |
convertItemsDropNull(java.util.Collection<?> inputs, java.util.Collection<OUT> target, java.util.function.Function<Object, OUT> transformer)Converts a collection type using a specified transformer |
<I, O> |
public static java.util.List<O> |
toList(java.util.Collection<I> collection, java.util.function.Function<I, O> tx)Transforms a collection to a list. |
<I, O> |
public static java.util.List<O> |
toList(Iterable<I> collection, java.util.function.Function<I, O> tx)Transforms an iterable data set to a list. |
<I, O> |
public static java.util.Set<O> |
toSet(java.util.Collection<I> collection, java.util.function.Function<I, O> tx)Transforms a collection to a set. |
<I, O> |
public static java.util.Set<O> |
toSet(Iterable<I> collection, java.util.function.Function<I, O> tx)Transforms an iterable data set to a set. |
Converts an item using a specified transformer.
The following type are recursively unfolded before conversion:
input - Object to converttransformer - Transformer. Is p-asses an unfolded value.OUT - Type to convert to.null.Converts an item using a specified transformer.
THe following types are recursively unfolded before conversion:
input - Object to converttransformer - Transformer. Is passed an unfolded value.OUT - Type to convert to.null.Converts a collection type using a specified transformer
A number of non-iterable types are unfolded before conversion. See convertItems.Collections are flattened. Null values will raise exceptions.
inputs - Objects to convert.transformer - Transformer. Is passed an unfolded value.target - Collection to add to.OUT - Type to convert to.null. Will contain no null values.Converts a collection type using a specified transformer
A number of non-iterable types are unfolded before conversion. See convertItems.Collections are flattened. Null values are dropped. Empty Provider and java.util.Optional instances are treated like nulls. A null collection will be dropped.
inputs - Objects to convert.transformer - Transformer. Is passed an unfolded value.target - Collection to add to.OUT - Type to convert to.null. Will contain no null values.Transforms a collection to a list.
collection - Input datatx - TransformerTransforms an iterable data set to a list.
collection - Input datatx - TransformerTransforms a collection to a set.
collection - Input datatx - TransformerTransforms an iterable data set to a set.
collection - Input datatx - Transformer