Hello,
I'm starting to use Selma Mapping.
So far, so good, everything is working fine beside the compatibility with Lombok annotation (very useful for boiler plate code like getter setter ...) and a few time where I forgot to regenerate the mapper implementation.
Most of the time I'm using natural mapping (the attribute's name are the same).
I've recently tried to map an Enum to a String
Example :
public enum NumberEnum { ONE, TWO; }
public SourceBean {
private NumberEnum myNumber;
}
public DestinationBean {
private String myNumber;
}
Shouldn't the default behavior for the mapping be : the function name() ?
To get such behavior, I had to write a custom mapper :
public class EnumCustomMapper {
public String myNumberAsString(NumberEnum source) {
return source.name();
}
}
Is there an easier way ?
Cheers
HV