when I try to map enum type (someone has decided to use int instead of string) I get
org.modelmapper.ConfigurationException: ModelMapper configuration errors:
1) Cannot map final type x.y.z.enums.TerminalType.
1 error
at org.modelmapper.internal.Errors.throwConfigurationExceptionIfErrorsExist(Errors.java:241)
at org.modelmapper.internal.ExplicitMappingBuilder.visitPropertyMap(ExplicitMappingBuilder.java:229)
at org.modelmapper.PropertyMap.configure(PropertyMap.java:380)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
public enum TerminalType { ABC("ABC", 1);
private String code;
private Integer intCode;
TerminalType(String code, Integer intCode,) {
this.code=code;
this.intCode = intCode;
}
map().setTerminalType(source.getTerminalType().getIntCode());
What's wrong with this?
Thanks
Tomas