public boolean containsValue()

in base/src/main/java/org/apache/commons/chain2/impl/ContextBase.java [167:191]


    public boolean containsValue(Object value) {
        // Case 1 -- no local properties
        if (descriptors == null) {
            return super.containsValue(value);

        // Case 2 -- value found in the underlying Map
        } else if (super.containsValue(value)) {
            return true;
        }

        // Case 3 -- check the values of our readable properties
        for (PropertyDescriptor aPd : pd) {
            if (aPd.getReadMethod() != null) {
                Object prop = readProperty(aPd);
                if (value == null) {
                    if (prop == null) {
                        return true;
                    }
                } else if (value.equals(prop)) {
                    return true;
                }
            }
        }
        return false;
    }