com.softicar.platform.common.core.comparator.Comparators Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.core.comparator;
import java.util.Comparator;
/**
* Utility methods for {@link Comparator}.
*
* @author Oliver Richers
*/
public class Comparators {
/**
* Returns a null-safe natural order {@link Comparator}.
*
* This is the same as
*
*
* {@code Comparator.thenComparing(Comparator.naturalOrder())}.
*
*
* @param
* @return the respective {@link Comparator}
*/
public static > Comparator naturalOrderNullsFirst() {
return Comparator.nullsFirst(Comparator.naturalOrder());
}
}