Class BigDecimalUtils


  • public class BigDecimalUtils
    extends java.lang.Object
    Author:
    Michael Weiss
    • Constructor Summary

      Constructors 
      Constructor Description
      BigDecimalUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean equalIgnoreScale​(java.util.Collection<java.math.BigDecimal> collection1, java.util.Collection<java.math.BigDecimal> collection2)  
      static <T> boolean equalIgnoreScaleOnValues​(java.util.Map<T,​java.math.BigDecimal> map1, java.util.Map<T,​java.math.BigDecimal> map2)
      Compares if two maps with BigDecimal values are numerically equivalent, i.e, if the keys are Object.equals(Object) and the values numerically equivalent.
      static int hashCodeIgnoringScale​(java.util.Collection<java.math.BigDecimal> collection)  
      static int hashCodeIgnoringScale​(java.util.Map<?,​java.math.BigDecimal> map)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BigDecimalUtils

        public BigDecimalUtils()
    • Method Detail

      • equalIgnoreScale

        public static boolean equalIgnoreScale​(java.util.Collection<java.math.BigDecimal> collection1,
                                               java.util.Collection<java.math.BigDecimal> collection2)
      • equalIgnoreScaleOnValues

        public static <T> boolean equalIgnoreScaleOnValues​(java.util.Map<T,​java.math.BigDecimal> map1,
                                                           java.util.Map<T,​java.math.BigDecimal> map2)
        Compares if two maps with BigDecimal values are numerically equivalent, i.e, if the keys are Object.equals(Object) and the values numerically equivalent.
        Parameters:
        map1 - the first map
        map2 - the second map
        Returns:
        true if the values are numerically equivalent
      • hashCodeIgnoringScale

        public static int hashCodeIgnoringScale​(java.util.Map<?,​java.math.BigDecimal> map)
      • hashCodeIgnoringScale

        public static int hashCodeIgnoringScale​(java.util.Collection<java.math.BigDecimal> collection)