Interface Mapper<I,O>
- Type Parameters:
I- The input typeO- The output type
- All Known Subinterfaces:
BooleanMapper,FloatMapper,IntMapper,ParseFunction<T>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A function that maps one type to another type.
-
Method Summary
Modifier and TypeMethodDescriptionMaps an object.Creates a mapper that converts objects to strings.static <T,S> Mapper <T, S> preserveNull(Mapper<T, S> mapper) Creates a mapper that preservesnullvalues.Creates a mapper that chains this mapper and another mapper.static <T extends Transmittable<S>,S>
Mapper<T, S> transmitTo(Supplier<S> supplier) Creates a mapper that transmits data between two objects.
-
Method Details
-
map
Maps an object.- Parameters:
in- The original object- Returns:
- The mapped object.
-
then
Creates a mapper that chains this mapper and another mapper.- Type Parameters:
T- The output type of the resulting mapper- Parameters:
mapper- The mapper to chain with this mapper- Returns:
- A mapper that chains both mappers.
-
preserveNull
Creates a mapper that preservesnullvalues.- Type Parameters:
T- The input type of the mapperS- The output type of the mapper- Parameters:
mapper- The mapper to use for non-null values- Returns:
- A new mapper that preserves
nullvalues.
-
mapToString
Creates a mapper that converts objects to strings.- Type Parameters:
T- The input type- Returns:
- A mapper that converts objects to strings.
- See Also:
-
transmitTo
Creates a mapper that transmits data between two objects.- Type Parameters:
T- The source object typeS- The target object type- Parameters:
supplier- The supplier of the target object- Returns:
- A new mapper that transmits data.
-