All Downloads are FREE. Search and download functionalities are using the official Maven repository.

functionalj.function.Compare Maven / Gradle / Ivy

There is a newer version: 1.0.17
Show newest version
package functionalj.function;

public interface Compare {
    
    public static Integer compareOrNull(Integer a, Integer b) {
        if ((a == null) || (b == null))
            return null;
        
        return Integer.compare(a, b);
    }
    public static Integer compareOrNull(Long a, Long b) {
        if ((a == null) || (b == null))
            return null;
        
        return Long.compare(a, b);
    }
    public static Integer compareOrNull(Double a, Double b) {
        if ((a == null) || (b == null))
            return null;
        
        return Double.compare(a, b);
    }
    
    public static int comparePrimitive(int a, int b) {
        return Integer.compare(a, b);
    }
    public static int comparePrimitive(long a, long b) {
        return Long.compare(a, b);
    }
    public static int comparePrimitive(double a, double b) {
        return Double.compare(a, b);
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy