com.avaje.ebeaninternal.util.ValueUtil Maven / Gradle / Ivy
package com.avaje.ebeaninternal.util;
import java.math.BigDecimal;
import java.net.URL;
public class ValueUtil {
/**
* Helper method to check if two objects are equal.
*/
@SuppressWarnings("unchecked")
public static boolean areEqual(Object obj1, Object obj2) {
if (obj1 == null) {
return (obj2 == null);
}
if (obj2 == null) {
return false;
}
if (obj1 == obj2) {
return true;
}
if (obj1 instanceof BigDecimal) {
// Use comparable for BigDecimal as equals
// uses scale in comparison...
if (obj2 instanceof BigDecimal) {
Comparable