I want to avoid the human mistake in mapping objects together so I use the map-struct
package. but there are situations I should manually assign fields like renaming them. like this method
@Mapper(componentModel = "spring")
public interface ItemMapper extends EntityMapper<ItemDTO, Item> {
@Mapping(target = "itemTeplate", source = "template")
Item toEntity(Entity entity);
}
Is there any way to generate the class field names dynamically for this usage and get an error when changing the naming and have an autocomplete class like fields? like below picture
@Mapper(componentModel = "spring")
public interface ItemMapper extends EntityMapper<ItemDTO, Item> {
@Mapping(target = EntityFields.ITEM_TEMPLATE, source = ItemFields.TEMPLATE)
Item toEntity(Entity entity);
}