...
Code Block | ||
---|---|---|
| ||
public enum BatchNumberUniqueness { GLOBALLY("01globally"), MANUFACTURER("02manufacturer"); private final String stringValue; private BatchNumberUniqueness(final String stringValue) { this.stringValue = stringValue; } public String getStringValue() { return stringValue; } public static BatchNumberUniqueness parseString(final String string) { if (GLOBALLY.getStringValue().equals(stringBatchNumberUniqueness parsedEnum = null; for (BatchNumberUniqueness value : BatchNumberUniqueness.values()) { return GLOBALLY; } else if (MANUFACTURERvalue.getStringValue().equals(string)) { return MANUFACTURER; parsedEnum = value; break; } else { } throw new IllegalArgumentException(Preconditions.checkArgument(parsedEnum != null, "Couldn't parse BatchNumberUniquenessenum from string '" + string + "'"); return }parsedEnum; } @Override public String toString() { return stringValue; } } |
...