public NodeState setState(String key, String value) {
        if (key == null || key.length() == 0) {
            return this;
        }
        int pos = key.lastIndexOf("/");
        if (pos > -1) {
            getChild(key.substring(0, pos), true).setState(key.substring(pos + 1), value);
        }
        else {
            if (value == null || value.length() == 0) {
                return removeState(key);
            }
            else {
                state.put(key, value);
            }
        }
        return this;
    }
Sets some arbitrary state data in this node. The key can be a location string, in which case the necessary
intermediate nodes are traversed and even created if missing.

@param key   The key to set.
@param value The value to assign to the key.
@return This, to allow chaining.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/systemstate/rule/NodeState.java