com.ibm.commerce.edp.utils

Class Comparer

  • java.lang.Object
    • com.ibm.commerce.edp.utils.Comparer


  • public class Comparer
    extends java.lang.Object
    This class is a facility to compare objects.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Comparer() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static boolean compare(java.lang.Object object1, java.lang.Object object2)
      This method compares two objects, assuming same type.
      static boolean isNegative(java.math.BigDecimal amount)
      This method checks if amount is negative.
      static boolean isPositive(java.math.BigDecimal amount)
      This method checks if amount is positive.
      static boolean isZero(java.math.BigDecimal amount)
      This method checks if amount is zero.
      • Methods inherited from class java.lang.Object

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

      • Comparer

        public Comparer()
    • Method Detail

      • isNegative

        public static boolean isNegative(java.math.BigDecimal amount)
        This method checks if amount is negative.
        Parameters:
        amount - Amount to be checked
        Returns:
        If amount is negative
      • isPositive

        public static boolean isPositive(java.math.BigDecimal amount)
        This method checks if amount is positive.
        Parameters:
        amount - Amount to be checked
        Returns:
        If amount is positive
      • isZero

        public static boolean isZero(java.math.BigDecimal amount)
        This method checks if amount is zero.
        Parameters:
        amount - Amount to be checked
        Returns:
        If amount is zero
      • compare

        public static boolean compare(java.lang.Object object1,
                                      java.lang.Object object2)

        This method compares two objects, assuming same type.

        Object.equals() is always called. If the first parameter implements comparable, it also invokes Comparable.compareTo().

        This method is null-safe, that is, it can receive nulls as parameters.

        Parameters:
        object1 - First object to be compared
        object2 - Second object to be compared
        Returns:
        If object1 and object2 are the dame