Interface Mapper<S,T>
- Type Parameters:
S- the source typeT- the target type
- All Known Subinterfaces:
Mapper.BiMapper<S,,T> Mapper.UniMapper<S,T>
A mapper is responsible for converting a source type
S into a target type T.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA subtype ofMapperthat can convert the source typeSinto the target typeT, but can also convert the target typeTback into the source typeS.static final recordProvides additional information about the mapping.static interface -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <S,T> Mapper.BiMapper <S, T> bi(@NotNull BiFunction<S, Mapper.MappingContext<S, T>, MappingResult<T>> from, @NotNull BiFunction<T, Mapper.MappingContext<T, S>, MappingResult<S>> into) Creates anMapper.BiMapperthat can convert from a source typeSinto a target typeT, but can also reversely convert from the target typeTinto the source typeS.static <S,T> Mapper.UniMapper <S, T> uni(@NotNull BiFunction<S, Mapper.MappingContext<S, T>, MappingResult<T>> mapper)
-
Method Details
-
uni
static <S,T> Mapper.UniMapper<S,T> uni(@NotNull @NotNull BiFunction<S, Mapper.MappingContext<S, T>, MappingResult<T>> mapper) - Type Parameters:
S- the source typeT- the target type- Parameters:
mapper- theBiFunctionthat converts the source type into the target type- Returns:
- a new
Mapper.UniMapper
-
bi
static <S,T> Mapper.BiMapper<S,T> bi(@NotNull @NotNull BiFunction<S, Mapper.MappingContext<S, T>, MappingResult<T>> from, @NotNull @NotNull BiFunction<T, Mapper.MappingContext<T, S>, MappingResult<S>> into) Creates anMapper.BiMapperthat can convert from a source typeSinto a target typeT, but can also reversely convert from the target typeTinto the source typeS.- Type Parameters:
S- the source typeT- the target type- Parameters:
from- theBiFunctionthat converts the source type into the target typeinto- theBiFunctionthat converts the target type into the source type- Returns:
- a new
Mapper.UniMapper
-