My Enum
public enum ExamStausEnum {
RESULTAWAITED("Result Awaiting"),
PASSED("Passed"),
FAILED("Failed");
private String value;
ExamStausEnum(String value) {
this.value = value;
}
@JsonValue
public String getValue() {
return value;
}
}
Generic Iterator Enum
static <E extends Enum <E>> void foo(Class<E> elemType) {
for (E e : java.util.EnumSet.allOf(elemType)) {
System.out.println(e);
}
}
Result :
RESULTAWAITED
PASSED
FAILED
How can I print the constructor values ?
Result Awaiting
Passed
Failed
System.out.println(e.getValue())?toString()on your enum?