com.github.andyshao.lang.DoubleOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Gear Show documentation
Show all versions of Gear Show documentation
Enhance and formating the coding of JDK
The newest version!
package com.github.andyshao.lang;
import java.util.Comparator;
import java.util.Objects;
/**
*
*
* Title:
* Descript:
* Copyright: Copryright(c) Apr 11, 2019
* Encoding: UNIX UTF-8
*
* @author Andy.Shao
*
*/
public final class DoubleOperation {
/**
* get double {@link Comparator}
* @return {@link Comparator}
*/
public static final Comparator comparator() {
return (o1, o2) -> {
if(Objects.isNull(o1) && Objects.nonNull(o2)) return -1;
else if(Objects.isNull(o1) && Objects.isNull(o2)) return 0;
else if(Objects.nonNull(o1) && Objects.isNull(o2)) return 1;
return Double.compare(o1, o2);
};
}
private DoubleOperation() {}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy