/** * Return the enum for the passed label. * * @param label Label value. * @return Associated enum, or <code>null</code> if the label value is not found. */ public static ServiceExceptionType getByLabel(String label) { for (ServiceExceptionType type : ServiceExceptionType.values()) { if (type.label.equalsIgnoreCase(label)) { return type; } } return null; }
/** * Return the enum for the passed id. * * @param id Id value. * @return Associated enum, or <code>null</code> if the id value is not found. */ public static ServiceExceptionType getById(String id) { if (id == null) { return null; } for (ServiceExceptionType type : ServiceExceptionType.values()) { if (type.id.equals(id)) { return type; } } return null; }