Class Sort.StringComparators

  • Enclosing class:
    Sort

    public static final class Sort.StringComparators
    extends Object
    Comparators for java.lang.Strings.

    Example

     #set( $list = $Sort.sort($list, $Sort.string.caseInsensitiveNullsFirst) )
     

    • Method Detail

      • getCaseSensitiveNullsFirst

        public Comparator<String> getCaseSensitiveNullsFirst()
        Get a case-sensitive comparator for strings that sorts null first.

        Use reversed() to sort in reverse order.

        Returns:
        The comparator.
      • getCaseSensitiveNullsLast

        public Comparator<String> getCaseSensitiveNullsLast()
        Get a case-sensitive comparator for strings that sorts null last.

        Use reversed() to sort in reverse order.

        Returns:
        The comparator.
      • getCaseInsensitiveNullsFirst

        public Comparator<String> getCaseInsensitiveNullsFirst()
        Get a case-insensitive comparator for strings that sorts null first.

        Use reversed() to sort in reverse order.

        Returns:
        The comparator.
      • getCaseInsensitiveNullsLast

        public Comparator<String> getCaseInsensitiveNullsLast()
        Get a case-insensitive comparator for strings that sorts null last.

        Use reversed() to sort in reverse order.

        Returns:
        The comparator.