Package tech.mappie.api
Class TransformableValue
-
- All Implemented Interfaces:
public final class TransformableValue<FROM extends Object, TO extends Object>The result of an explicit mapping definition which can be transformed.
-
-
Constructor Summary
Constructors Constructor Description TransformableValue()
-
Method Summary
-
-
Method Detail
-
transform
final Unit transform(Function1<FROM, TO> function)
Transforms the result value of a mapping. See the documentation
For example
Person::age fromProperty PersonDto::dateOfBirth transform { it.periodUntil(Clock.todayIn(TimeZone.UTC)) }will generate an explicit mapping transforming
PersonDto.dateOfBirthto the period between it and today.- Parameters:
function- the transformation function to transform the value with.
-
-
-
-