Package org.cadixdev.lorenz.io
Class MappingsWriterConfig.Utils
- java.lang.Object
-
- org.cadixdev.lorenz.io.MappingsWriterConfig.Utils
-
- Enclosing class:
- MappingsWriterConfig
public static class MappingsWriterConfig.Utils extends java.lang.ObjectUtility 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 typeT, and returns acomparatorthat compares using that key when the lengths are both equal, and comparing based on length otherwise.
-
-
-
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 typeT, and returns acomparatorthat 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
-
-