- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
private static <T extends Comparable<T>> int compareTo(final T c1, final T c2) {
final boolean f1, f2;
return (f1 = c1 == null) ^ (f2 = c2 == null) ? f1 ? -1 : 1 : f1 && f2 ? 0 : c1.compareTo(c2);
}
BigDecimal newDiscountPrice = .....;
BigDecimal oldDiscountPrice = ......;
if (compareTo(newDiscountPrice, oldDiscountPrice) != 0) {
....
}
Видимо ObjectUtils.notEqual(newDiscountPrice, oldDiscountPrice) или старого доброго
!(newDiscountPrice==null? oldDiscountPrice==null: newDiscountPrice.equals(oldDiscountPrice ))
недостаточно)