Exemplo n.º 1
0
 /**
  * Match for CheckType, some smart method, to also match after first "_" for convenience of input.
  *
  * @param input
  * @return
  */
 public static List<String> getCheckTypeTabMatches(final String input) {
   final String ref = input.toUpperCase().replace('-', '_').replace('.', '_');
   final List<String> res = new ArrayList<String>();
   for (final CheckType checkType : CheckType.values()) {
     final String name = checkType.name();
     if (name.startsWith(ref)) {
       res.add(name);
     }
   }
   if (ref.indexOf('_') == -1) {
     for (final CheckType checkType : CheckType.values()) {
       final String name = checkType.name();
       final String[] split = name.split("_", 2);
       if (split.length > 1 && split[1].startsWith(ref)) {
         res.add(name);
       }
     }
   }
   if (!res.isEmpty()) {
     Collections.sort(res);
     return res;
   }
   return null;
 }