ObjectTools.java 699 Bytes
package com.wd.capability.layout.uitls;

/**
 * Author LiuKun
 * date:2023/3/21
 * desc:
 */
public class ObjectTools {
    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;
        }

        return hashCode(target) == hashCode(source);
    }
}