ObjectMappie2

abstract class ObjectMappie2<in FROM1, in FROM2, out TO> : Mappie<TO>

Base class for object mappers. See the documentation for a complete overview of how to generate object mappers.

For example

class PersonMapper : ObjectMappie2<PersonDto, AddressDto, Person>() {
override fun map(first: PersonDto, second: AddressDto) = mapping()
}

will generate a mapper from PersonDto and AddressDto to Person, assuming all dto's and Person have a resolvable mapping.

Parameters

FROM1

the first source type to map from.

FROM2

the second source type to map from.

TO

the target type to map to.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun map(first: FROM1, second: FROM2): TO

Map first and second to an instance of TO.

Link copied to clipboard
fun mapNullable(first: FROM1?, second: FROM2?): TO?

Map nullable first and second to an instance of TO.