close

Filter

loading table of contents...

Headless Server Developer Manual / Version 2307

Table Of Contents

4.5 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
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.