Class StringsPlume.NullableStringComparator

java.lang.Object
org.plumelib.util.StringsPlume.NullableStringComparator
All Implemented Interfaces:
Serializable, Comparator<@Nullable String>
Enclosing class:
StringsPlume

@Deprecated public static class StringsPlume.NullableStringComparator extends Object implements Comparator<@Nullable String>, Serializable
Deprecated.
use Comparator.nullsFirst(Comparator.naturalOrder())
Same as built-in String comparison, but accept null arguments, and place them at the beginning.
See Also:
  • Constructor Details

    • NullableStringComparator

      public NullableStringComparator()
      Deprecated.
      Create a new NullableStringComparator.
  • Method Details

    • compare

      @Pure public int compare(@Nullable String s1, @Nullable String s2)
      Deprecated.
      Compare two Strings lexicographically. Null is considered less than any non-null String.
      Specified by:
      compare in interface Comparator<@Nullable String>
      Parameters:
      s1 - first string to compare
      s2 - second string to compare
      Returns:
      a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second