jmapper-framework / jmapper-core

Elegance, high performance and robustness all in one java bean mapper
http://jmapper-framework.github.io/jmapper-core
Apache License 2.0
227 stars 41 forks source link

map Enum class to same Enum class #61

Closed l-salih closed 7 years ago

l-salih commented 7 years ago

Hi! I would like to map an enum class to the same enum class but i get an exception:

.add(attribute("dogEnum").value("otherDogEnum"))

JMapperException: java.lang.IllegalArgumentException: No enum constant

If I add an conversation like this it does work:

.add(conversion("otherDogEnumToDogEnum")
                                .from("otherDogEnum").to("dogEnum")
                                .type(JMapConversion.Type.DYNAMIC)
                                .body("return ${source};"))
avurro commented 7 years ago

Hi @ls3642 , Just the time to create a test and fix it, give me few hours

avurro commented 7 years ago

I haven't any error, are you sure that Enum is the same ? can you provide complete code ?