You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using DTOs it is common to have classes with similar fields, and it can get annoying real quick to have to type the getter calls on the source object even though gensett can generate the setter calls on the target.
Imagine we have
And I want to write a hand-written mapper class or method
publicstaticUserDtomap(Useruser) {
vardto = newUserDto();
// dto:username,address// the line above is a gensett line which creates settersdto.setUsername(/* TODO: set me */);
dto.setAddress(/* TODO: set me */);
}
Proposal:
Add a new shorthand and capability to the library to enable mapping from source to object. target:<source>:field target:setm:<source>:field
Where source is the other object
publicstaticUserDtomap(Useruser) {
vardto = newUserDto();
// the line below is a gensett line which creates setters// map:dto:user:username,address// setm:dto:user:username,address// the result shall bedto.setUsername(user.getUsername());
dto.setAddress(user.getAddress());
}
The text was updated successfully, but these errors were encountered:
When using DTOs it is common to have classes with similar fields, and it can get annoying real quick to have to type the getter calls on the source object even though gensett can generate the setter calls on the target.
Imagine we have
And I want to write a hand-written mapper class or method
Proposal:
Add a new shorthand and capability to the library to enable mapping from source to object.
target:<source>:field
target:setm:<source>:field
Where
source
is the other objectThe text was updated successfully, but these errors were encountered: