Class AlphaNumericComparator<T>

All Implemented Interfaces:

public class AlphaNumericComparator<T> extends Object implements Comparator<T>
Comparator for Objects, that compares based on their converted values. The objects will be converted to a String value using the given Function. That value will be compared in a human readable fashion by trying to parse numbers that appear in the keys as integers and compare those, too.

Heavily influenced by

  • Constructor Details

    • AlphaNumericComparator

      public AlphaNumericComparator(Function<T,String> converter)
      Constructs a comparator with a converter function
      converter - that generates a String value from the arguments given to, Object)
  • Method Details