I have a mapped field in a custom entity. The requirement is: for any value received take the related value eg. if 10 is imported then set the value to TEST1. I wanted to understand what would be the best approach ie via switch, macro, enum. Also how should I implement it since in macro if I write #define.TEST1(10) then I will also need to write #deine.10("TEST1) as such for around 20 fields and also enum does not allow for specific value. Adding such comparison in switch will result in lot of hard coding.
Also in which method should I place this since I want this transformation to happen only in case of import operation & not export.