smartstruct
smartstruct copied to clipboard
Add lifecycle methods (after & before)
It would be very helpful to have annotations for BeforeMapping & AfterMapping like the original mapstruct has.
Example usage:
class Source {}
class Target {
Service _service;
void setSevice(Service service) {
_service = service;
}
}
@Mapper()
abstract class SourceToTargetMapper {
Service _service;
SourceToTargetMapper(Service service) {
_service = service;
}
Target fromSource(Source source);
@AfterMapping()
void afterMapping(Target target) {
target.setService(_service);
}
}
Hi, like the idea a lot, should also be relatively easy to implement