All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nakedobjects.noa.reflect.NullUtils Maven / Gradle / Ivy

The newest version!
package org.nakedobjects.noa.reflect;

import org.nakedobjects.noa.adapter.Naked;

public class NullUtils {

    public static boolean nullSafeEquals(
            Object previous,
            Object value) {
        if (previous == null && value == null) return true;
        if (previous == null || value == null) return false;
        if (previous.equals(value)) return true;
        if (previous instanceof Naked && value instanceof Naked) {
            Naked previousNV = (Naked) previous;
            Naked valueNV = (Naked) value;
            return nullSafeEquals(previousNV.getObject(), valueNV.getObject());
        }
        return false;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy