Class ObjectUtils
- java.lang.Object
-
- org.apache.flink.cdc.connectors.base.utils.ObjectUtils
-
-
Constructor Summary
Constructors Constructor Description ObjectUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcompare(Object obj1, Object obj2)Compares two comparable objects.static intdoubleCompare(double arg1, double arg2)Compares two Double numeric object.static BigDecimalminus(Object minuend, Object subtrahend)Returns the differenceBigDecimalwhose value is(minuend - subtrahend).static Objectplus(Object number, int augend)Returns a numberObjectwhose value is(number + augend), Note: This method will throwArithmeticExceptionif number overflows.
-
-
-
Method Detail
-
plus
public static Object plus(Object number, int augend) throws ArithmeticException
Returns a numberObjectwhose value is(number + augend), Note: This method will throwArithmeticExceptionif number overflows.- Throws:
ArithmeticException
-
minus
public static BigDecimal minus(Object minuend, Object subtrahend)
Returns the differenceBigDecimalwhose value is(minuend - subtrahend).
-
compare
public static int compare(Object obj1, Object obj2)
Compares two comparable objects.- Returns:
- The value
0ifnum1is equal to thenum2; a value less than0if thenum1is numerically less than thenum2; and a value greater than0if thenum1is numerically greater than thenum2. - Throws:
ClassCastException- if the compared objects are not instance ofComparableor not mutually comparable (for example, strings and integers).
-
doubleCompare
public static int doubleCompare(double arg1, double arg2)Compares two Double numeric object.- Returns:
- -1, 0, or 1 as this
arg1is numerically less than, equal to, or greater thanarg2.
-
-