Class BigDecimalComparator

  • All Implemented Interfaces:
    java.util.Comparator<java.math.BigDecimal>

    public class BigDecimalComparator
    extends java.lang.Object
    implements java.util.Comparator<java.math.BigDecimal>
    A BigDecimal Comparator based on BigDecimal.compareTo(BigDecimal).
    Is useful if ones wants to use BigDecimal assertions based on BigDecimal.compareTo(BigDecimal) instead of BigDecimal.equals(Object) method.
    Author:
    Joel Costigliola
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compare​(java.math.BigDecimal bigDecimal1, java.math.BigDecimal bigDecimal2)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Comparator

        equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
    • Constructor Detail

      • BigDecimalComparator

        public BigDecimalComparator()
    • Method Detail

      • compare

        public int compare​(java.math.BigDecimal bigDecimal1,
                           java.math.BigDecimal bigDecimal2)
        Specified by:
        compare in interface java.util.Comparator<java.math.BigDecimal>