I have a current state where an enum MyType represent Type table with columns as: ID Name And it's used to identify type using ID parameter with byId method: public enum MyType { FIRST_TYPE("First Type", 10), SECOND_TYPE("Second Type", 20); public static class Holder { static Map<Integer, MyType > idMap = new HashMap<>(); private Holder() { } } private MyType(String name, Integer id) { this.name = name; this.id = id; Holder.idMap.put(id, this); } public String getName() { return name; } public static MyType byId(Integer id) { return Holder.idMap.get(id); } My new requirement is to support also