Package com.amazonaws.util
Class ComparableUtils
- java.lang.Object
-
- com.amazonaws.util.ComparableUtils
-
public class ComparableUtils extends Object
-
-
Constructor Summary
Constructors Constructor Description ComparableUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> int
safeCompare(Comparable<T> d1, T d2)
Does a safe comparison of twoComparable
objects accounting for nulls
-
-
-
Method Detail
-
safeCompare
public static <T> int safeCompare(Comparable<T> d1, T d2)
Does a safe comparison of twoComparable
objects accounting for nulls- Parameters:
d1
- First objectd2
- Second object- Returns:
- A positive number if the object double is larger, a negative number if the second object is larger, or 0 if they are equal. Null is considered less than any non-null value
-
-