/** * @param resources The named resources * @return A {@link List} of all the factories names - in same order as they appear in the input * collection */ public static List<String> getNameList(Collection<? extends NamedResource> resources) { if (GenericUtils.isEmpty(resources)) { return Collections.emptyList(); } List<String> names = new ArrayList<>(resources.size()); for (NamedResource r : resources) { names.add(r.getName()); } return names; }
@Override public String transform(NamedResource input) { if (input == null) { return null; } else { return input.getName(); } }
/** * @param name The factory name - ignored if {@code null}/empty * @return The matching {@link BuiltinSignatures} whose factory name matches (case * <U>insensitive</U>) the provided name - {@code null} if no match */ public static BuiltinSignatures fromFactoryName(String name) { return NamedResource.findByName(name, String.CASE_INSENSITIVE_ORDER, VALUES); }
@Override public int compare(NamedResource r1, NamedResource r2) { String n1 = r1.getName(); String n2 = r2.getName(); return String.CASE_INSENSITIVE_ORDER.compare(n1, n2); }
public static String getIdentityFileName(NamedResource r) { return getIdentityFileName((r == null) ? null : r.getName()); }