I
- the input type of the converterO
- the output type of the converterpublic interface Converter<I,O>
Caster
.Modifier and Type | Method and Description |
---|---|
O |
convert(I in,
Caster<?> caster)
Converts an object.
|
static <I,O> Converter<I[],O[]> |
forArray(Class<O> outputComponentType,
Converter<? super I,? extends O> converter)
Returns a converter that converts an array by using a given converter to convert each element
in the array.
|
static <I,O> Converter<I,O> |
fromFunction(Function<I,O> function)
Returns a converter that applies the given function on the object to convert and returns its
result.
|
O convert(I in, Caster<?> caster)
in
- the object to convertcaster
- a Caster
, in case needed for conversionstatic <I,O> Converter<I,O> fromFunction(Function<I,O> function)
function
- the function that performs the conversionstatic <I,O> Converter<I[],O[]> forArray(Class<O> outputComponentType, Converter<? super I,? extends O> converter)
outputComponentType
- the element type of the result of conversion.converter
- the converter used to convert a single element