close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2010

Table Of Contents

4.4 Model Mapper

A 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.

Search Results

Table Of Contents