/** * Finds all the string representations for all the targets. * * @return a non-null list */ public static List<String> allString() { List<String> result = new ArrayList<>(); for (SupportedTarget st : SupportedTarget.values()) result.addAll(st.findString()); return result; }
/** * Finds a supported target from a string value. * * @param search a string (may be null) * @return the matching target, or null if none matched */ public static SupportedTarget which(String search) { SupportedTarget result = null; for (SupportedTarget st : values()) { for (String s : st.findString()) { if (s.equalsIgnoreCase(search)) { result = st; break; } } } return result; }