Package tech.mappie.api
Class MultipleObjectMappingConstructor
-
- All Implemented Interfaces:
public final class MultipleObjectMappingConstructor<TO extends Object>
-
-
Constructor Summary
Constructors Constructor Description MultipleObjectMappingConstructor()
-
Method Summary
Modifier and Type Method Description final TOgetTo()final <TO_TYPE extends Any, FROM_TYPE extends Any> TransformableValue<FROM_TYPE, TO_TYPE>fromProperty(KProperty<TO_TYPE> $self, KProperty<FROM_TYPE> source)Explicitly construct a mapping to TO from property source source. final <TO_TYPE extends Any> UnitfromValue(KProperty<TO_TYPE> $self, TO_TYPE value)Explicitly construct a mapping to TO from a value source value. final KProperty<?>parameter(String name)Reference a constructor parameter in lieu of a property reference, if it not exists as a property. -
-
Method Detail
-
fromProperty
final <TO_TYPE extends Any, FROM_TYPE extends Any> TransformableValue<FROM_TYPE, TO_TYPE> fromProperty(KProperty<TO_TYPE> $self, KProperty<FROM_TYPE> source)
Explicitly construct a mapping to TO from property source source.
For example
Person::name fromProperty PersonDto::fullNamewill generate an explicit mapping, setting constructor parameter
Person.nametoPersonDto.fullName.
-
fromValue
final <TO_TYPE extends Any> Unit fromValue(KProperty<TO_TYPE> $self, TO_TYPE value)
Explicitly construct a mapping to TO from a value source value.
For example
Person::name fromValue "John Doe"will generate an explicit mapping, setting constructor parameter
Person.nameto"John Doe".
-
parameter
final KProperty<?> parameter(String name)
Reference a constructor parameter in lieu of a property reference, if it not exists as a property.
For example
parameter("name") fromProperty PersonDto::fullNamewill generate an explicit mapping, setting constructor parameter
nametoPersonDto.fullName.
-
-
-
-