- All Implemented Interfaces:
EntityValueEqualityFunction<T>, java.util.function.BiFunction<T,T,java.lang.Boolean>
public class ComparableEqualityFunction<T extends java.lang.Comparable<? super T>>
extends java.lang.Object
implements EntityValueEqualityFunction<T>
This Function overrides the default Bid Field comparison of using equals() with compare().
It is needed because BigDecimals' equals() takes into account the number's scale, which means
0.0 != 0.00
This can cause strange behaviours, especially when comparing UI values against DB values.
Using compare() instead solves this problem as it ignores scale when the values are the same.
Created by yuvalr on 5/22/16.