001package org.gbif.utils.text;
002
003import java.util.Comparator;
004
005/**
006 * A comparator based around Javas String.compareTo().
007 */
008public class StringComparator implements Comparator<String> {
009
010  public int compare(String arg0, String arg1) {
011    if (arg0 == null && arg1 == null) {
012      return 0;
013    } else if (arg0 == null) {
014      return 1;
015    } else if (arg1 == null) {
016      return -1;
017    }
018    return arg0.compareTo(arg1);
019  }
020
021}