private String toString(String prefix) throws UnsupportedEncodingException {
        StringBuffer buf = new StringBuffer();
        if (!state.isEmpty()) {
            buf.append(prefix.length() == 0 ? "." : prefix).append("?");
            String[] arr = state.keySet().toArray(new String[state.keySet().size()]);
            for (int i = 0; i < arr.length; ++i) {
                buf.append(arr[i]).append("=").append(URLEncoder.encode(state.get(arr[i]), "UTF-8"));
                if (i < arr.length - 1) {
                    buf.append("&");
                }
            }
            buf.append(" ");
        }
        if (prefix.length() > 0) {
            prefix += "/";
        }
        String[] keys = children.keySet().toArray(new String[children.keySet().size()]);
        Arrays.sort(keys);
        for (String loc : keys) {
            buf.append(children.get(loc).toString(prefix + URLEncoder.encode(loc, "UTF-8")));
        }
        return buf.toString();
    }
Returns a string representation of this node state.

@param prefix The prefix to use for this string.
@return A string representation of this.
@throws UnsupportedEncodingException Thrown if the host system does not support UTF-8 encoding.
documentapi/src/main/java/com/yahoo/documentapi/messagebus/systemstate/rule/NodeState.java