ObjectMappie

abstract class ObjectMappie<FROM, 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 : ObjectMappie<PersonDto, Person>() {
override fun map(from: PersonDto) = mapping()
}

will generate a mapper from PersonDto to Person, assuming both PersonDto and Person have a resolvable mapping.

Parameters

FROM

the source type to map from.

TO

the target type to map to.

Inheritors

BigDecimalToStringMapper
BigIntegerToStringMapper
ByteToBigIntegerMapper
ByteToBigDecimalMapper
DoubleToBigDecimalMapper
FloatToBigDecimalMapper
IntToBigIntegerMapper
IntToBigDecimalMapper
LocalDateTimeToLocalTimeMapper
LocalDateTimeToLocalDateMapper
LongToBigIntegerMapper
LongToBigDecimalMapper
ShortToBigIntegerMapper
ShortToBigDecimalMapper
UUIDToStringMapper

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

A mapper for List to be used in TransformableValue.via.

Link copied to clipboard

A mapper for Set to be used in TransformableValue.via.

Functions

Link copied to clipboard
open fun map(from: FROM): TO

Map from to an instance of TO.

Link copied to clipboard
fun mapList(from: List<FROM>): List<TO>

Map each element in from to an instance of TO.

Link copied to clipboard
fun mapNullable(from: FROM?): TO?

Map nullable from to an instance of TO.

Link copied to clipboard
fun mapNullableList(from: List<FROM>?): List<TO>?

Map each element in from to an instance of TO if from is not null.

Link copied to clipboard
fun mapNullableSet(from: Set<FROM>?): Set<TO>?

Map each element in from to an instance of TO if from is not null.

Link copied to clipboard
fun mapSet(from: Set<FROM>): Set<TO>

Map each element in from to an instance of TO.