public final class ConversionHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <S> List<S> |
convertToArray(Object value,
Function<Object,S> conversionFunction)
Converts a list of objects to a list of the specified type.
|
static <S> List<Map<String,S>> |
convertToArrayOfMap(Object value,
Function<Object,S> conversionFunction)
Converts a list of maps to a list of maps with values of the specified type.
|
static <S> Map<String,S> |
convertToMap(Object value,
Function<Object,S> conversionFunction)
Converts a map of objects to a map of the specified type.
|
static <S> Map<String,List<S>> |
convertToMapOfArray(Object value,
Function<Object,S> conversionFunction)
Converts a map of lists to a map with lists of the specified type.
|
static <T,S> T |
convertToNDimensionalArray(Object value,
Function<Object,S> conversionFunction,
int dimensionCount)
Converts an n-dimensional array to a nested list with elements of the
specified type.
|
static <S> S |
convertToSimpleType(Object value,
Function<Object,S> conversionFunction)
Converts a single object to the specified type.
|
public static <S> S convertToSimpleType(Object value, Function<Object,S> conversionFunction)
S - the type to convert to.value - the object to convert.conversionFunction - the function to apply for conversion.S, or null if conversion fails.public static <S> Map<String,S> convertToMap(Object value, Function<Object,S> conversionFunction)
S - the type of values in the resulting map.value - the map of objects to convert.conversionFunction - the function to apply for conversion of each value.S, or null if conversion
fails.public static <S> List<S> convertToArray(Object value, Function<Object,S> conversionFunction)
S - the type of elements in the resulting list.value - the list of objects to convert.conversionFunction - the function to apply for conversion of each item.S, or null if
conversion fails.public static <S> List<Map<String,S>> convertToArrayOfMap(Object value, Function<Object,S> conversionFunction)
S - the type of values in the maps of the resulting
list.value - the list of maps to convert.conversionFunction - the function to apply for conversion of each map's
values.S, or null if
conversion fails.public static <S> Map<String,List<S>> convertToMapOfArray(Object value, Function<Object,S> conversionFunction)
S - the type of elements in the lists of the resulting
map.value - the map of lists to convert.conversionFunction - the function to apply for conversion of each list's
elements.S, or null if conversion
fails.public static <T,S> T convertToNDimensionalArray(Object value, Function<Object,S> conversionFunction, int dimensionCount)
T - the type of the nested structure.S - the type of elements in the nested structure.value - the n-dimensional array to convert.conversionFunction - the function to apply for conversion of each
element.dimensionCount - the depth of the nested structure.S, or null if
conversion fails.Copyright © 2025. All rights reserved.