ObjectUtil.java 773 Bytes
package com.wd.common.utils;

/**
 * @author LiuKun
 * @date 2023/4/26  20:19
 * @Description:objectUti
 */
public class ObjectUtil {

    public static boolean isNull(Object obj) {
        return obj == null;
    }

    public static boolean isNotNull(Object obj) {
        return obj != null;
    }

    public static int hashCode(Object obj) {
        return obj.hashCode();
    }

    public static boolean equals(Object source, Object target) {

        if (isNull(source)) {
            return false;
        }

        if (isNull(target)) {
            return false;
        }

        if (target == source) {
            return true;
        }

        if (hashCode(target) == hashCode(source)) {
            return true;
        }

        return false;
    }
}