Class MappingsWriterConfig.Utils

  • Enclosing class:
    MappingsWriterConfig

    public static class MappingsWriterConfig.Utils
    extends java.lang.Object
    Utility functions for assisting in the creation of a mappings writer configuration.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.util.Comparator<T> comparingLength​(java.util.function.Function<? super T,​java.lang.String> keyExtractor)
      Accepts a function that extracts a string sort key from a type T, and returns a comparator that compares using that key when the lengths are both equal, and comparing based on length otherwise.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • comparingLength

        public static <T> java.util.Comparator<T> comparingLength​(java.util.function.Function<? super T,​java.lang.String> keyExtractor)
        Accepts a function that extracts a string sort key from a type T, and returns a comparator that compares using that key when the lengths are both equal, and comparing based on length otherwise.
        Type Parameters:
        T - The type of the object being compared
        Parameters:
        keyExtractor - The function used to extract the sort key
        Returns:
        The comparator