public Object remove()

in myfaces-html5-core/src/main/java/org/apache/myfaces/html5/behavior/ClientBehaviorDeltaStateHelper.java [224:253]


    public Object remove(Serializable key, Object valueOrKey) {
        // Comment by lu4242 : The spec javadoc says if it is a Collection
        // or Map deal with it. But the intention of this method is work
        // with add(?,?) and put(?,?,?), this ones return instances of
        // InternalMap and InternalList to prevent mixing, so to be
        // consistent we'll cast to those classes here.

        Object collectionOrMap = _fullState.get(key);
        Object returnValue = null;
        if (collectionOrMap instanceof InternalMap) {
            if (_createDeltas()) {
                returnValue = _removeValueOrKeyFromMap(_deltas, key,
                                                       valueOrKey, true);
                _removeValueOrKeyFromMap(_fullState, key, valueOrKey, false);
            } else {
                returnValue = _removeValueOrKeyFromMap(_fullState, key,
                                                       valueOrKey, false);
            }
        } else if (collectionOrMap instanceof InternalList) {
            if (_createDeltas()) {
                returnValue = _removeValueOrKeyFromCollectionDelta(_deltas,
                                                                   key, valueOrKey);
                _removeValueOrKeyFromCollection(_fullState, key, valueOrKey);
            } else {
                returnValue = _removeValueOrKeyFromCollection(_fullState, key,
                                                              valueOrKey);
            }
        }
        return returnValue;
    }