public Object put()

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


    public Object put(Serializable key, String mapKey, Object value) {
        boolean returnSet = false;
        Object returnValue = null;
        if (_createDeltas()) {
            //Track delta case
            Map<String, Object> mapValues = (Map<String, Object>) _deltas
                    .get(key);
            if (mapValues == null) {
                mapValues = new InternalMap<String, Object>();
                _deltas.put(key, mapValues);
            }
            if (mapValues.containsKey(mapKey)) {
                returnValue = mapValues.put(mapKey, value);
                returnSet = true;
            } else {
                mapValues.put(mapKey, value);
            }
        }

        //Handle change on full map
        Map<String, Object> mapValues = (Map<String, Object>) _fullState
                .get(key);
        if (mapValues == null) {
            mapValues = new InternalMap<String, Object>();
            _fullState.put(key, mapValues);
        }
        if (returnSet) {
            mapValues.put(mapKey, value);
        } else {
            returnValue = mapValues.put(mapKey, value);
        }
        return returnValue;
    }