public enum Status {
DEVELOPMENT,
SUSPENDED,
ACTIVE,
DEACTIVATED,
EXPIRED;
public static Status fromValue(String v) {
if (StringUtils.isBlank(v))
return null;
int index = NumberUtils.toInt(v);
return Status.values()[index];
}
}
is gernated as
export enum Status {
"SUSPENDED",
"EXPIRED",
"DEVELOPMENT",
"ACTIVE",
"DEACTIVATED"
}
This seems to be the problem:
return enumElement.getEnclosedElements().stream()
.filter(e -> ElementKind.ENUM_CONSTANT.equals(e.getKind()))
.map(e -> new EnumValue(e.getSimpleName().toString()))
.collect(Collectors.toSet()); //<-- Collectors.toSet() does not make any guarantees on anything, in fact it is also an unordered Collector
is gernated as
This seems to be the problem: