public static String getStringValueFromInt(int i) { for (Status status : Status.values()) { if (status.getValue() == i) { return status.toString(); } } // throw an IllegalArgumentException or return null throw new IllegalArgumentException("the given number doesn't match any Status."); } public static void main(String[] args) { System.out.println(Status.getStringValueFromInt(1)); // OUTPUT: START }