public static RequestEvent getById(int id) { for (RequestEvent type : RequestEvent.values()) { if (type.getId() == id) { return type; } } return null; }
public static RequestEvent getByName(String name) { for (RequestEvent type : RequestEvent.values()) { if (type.name().equalsIgnoreCase(name)) { return type; } } return null; }