@Override
public String encode(ENUM fromJava) throws AchillesTranscodingException {
if(fromJava == null) return null;
if (!fromJava.getClass().isEnum()) {
throw new AchillesTranscodingException(format("Object '%s' to be encoded should be an enum", fromJava));
}
if (!enumValues.contains(fromJava)) {
throw new AchillesTranscodingException(format("Cannot find matching enum values for '%s' from possible enum constants '%s' ", fromJava, enumValues));
}
return ((Enum<?>) fromJava).name();
}