001package org.gbif.utils.text;
002
003import java.util.Comparator;
004
005public class StringLengthComparator implements Comparator<String> {
006
007  public int compare(String o1, String o2) {
008    if (o2.length() == o1.length()) {
009      return o1.compareToIgnoreCase(o2);
010    }
011    return o2.length() - o1.length();
012  }
013
014}