fix of issue #7386 (#7401)

This commit is contained in:
Alessio Fachechi 2018-01-20 07:05:32 +01:00 committed by William Cheng
parent a61d23265d
commit 6bf84d5fa7

View File

@ -16,10 +16,12 @@ public enum {{datatypeWithEnum}} {
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static {{datatypeWithEnum}} fromValue(String v) {
for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) {
if (String.valueOf(b.value).equals(v)) {