mapstruct / mapstruct-examples

Examples for using MapStruct
Other
1.28k stars 511 forks source link

How to use the mapping in practice? #136

Closed cassiusvm closed 2 years ago

cassiusvm commented 2 years ago

The example here: https://github.com/mapstruct/mapstruct-examples/blob/3457f37c24ea7799b0752cc7ee8307283ab09ad2/mapstruct-mapping-with-cycles/src/main/java/org/mapstruct/example/mapper/EmployeeMapper.java

The generated mapping will be like:

Employee toEmployee(EmployeeDto employeeDto, CycleAvoidingMappingContext context) {...}

In practice, how to get a valid CycleAvoidingMappingContext object ?

cassiusvm commented 2 years ago

My fault! I forgot to see its unit test. I apologize.