Package tech.mappie.api
Class EnumMappie
-
- All Implemented Interfaces:
public abstract class EnumMappie<FROM extends Enum<?>, TO extends Enum<?>> implements Mappie<TO>
Base class for enum mappers. See the documentation for a complete overview of how to generate enum mappers.
For example
class PersonMapper : EnumMappie<Color, Colour>() { override fun map(from: Color) = mapping() }will generate a mapper from
ColortoColour, assuming bothColorandColourhave a resolvable mapping.
-
-
Constructor Summary
Constructors Constructor Description EnumMappie()
-
Method Summary
Modifier and Type Method Description TOmap(FROM from)Map from to an instance of TO. final TOmapNullable(FROM from)Map nullable from to an instance of TO. final List<TO>mapList(List<FROM> from)Map each element in from to an instance of TO. final Set<TO>mapSet(Set<FROM> from)Map each element in from to an instance of TO.
-