I have looked this link : Convert from enum ordinal to enum type
and tried to get the enum value. But is not working. My enum class is :
public enum OrderStatus {
OPEN(0),
DELIVERED(1),
CANCELLED(3),
PARTIALLY(4)
}
I will pass the values 0,1,3,4 where 2 is missing , so it has no such order. How to get enum by passing 0,1,3 or 4 in groovy or java.