...
For every enum field of a model we create, we should create corresponding Java enum in constants package.
For ex.
Code Block | ||
---|---|---|
| ||
public enum BatchNumberUniqueness { GLOBALLY("01globally"), MANUFACTURER("02manufacturer"); private String stringValue; private BatchNumberUniqueness(final String stringValue) { this.stringValue = stringValue; } public String getStringValue() { return stringValue; } public static final BatchNumberUniqueness parseString(final String string) { if ("01globally".equals(string)) { return GLOBALLY; } else if ("02manufacturer".equals(string)) { return MANUFACTURER; } else { return null; } } } |
...