Headless Server Developer Manual / Version 2307
Table Of ContentsA model mapper can be used to convert domain model objects to a more suitable representation.
For example, a Calendar
object can be converted to a ZonedDateTime
Object.
@Bean public ModelMapper<GregorianCalendar, ZonedDateTime> dateModelMapper() { return gregorianCalendar -> Optional.of(gregorianCalendar.toZonedDateTime()); }
Example 4.1. Creating a ModelMapper for Calendar objects
Beans of type ModelMapper
are picked up automatically and configured in the GraphQL
wiring Factory.