static String toConfigString(String input) {
        if (input == null) {
            return "null";
        }
        StringBuilder ret = new StringBuilder(2 + input.length());
        ret.append("\"");
        for (int i = 0, len = input.length(); i < len; ++i) {
            if (input.charAt(i) == '\\') {
                ret.append("\\\\");
            } else if (input.charAt(i) == '"') {
                ret.append("\\\"");
            } else if (input.charAt(i) == '\n') {
                ret.append("\\n");
            } else if (input.charAt(i) == 0) {
                ret.append("\\x00");
            } else {
                ret.append(input.charAt(i));
            }
        }
        ret.append("\"");
        return ret.toString();
    }
Convert a string value to a quoted value suitable for use in a config string.
<p>
Adds double quotes before and after, and adds backslash-escapes to any double quotes that was contained in the
string.  A null pointer will produce the special unquoted string null that the config library will convert back
to a null pointer.

@param input the String to be escaped
@return an escaped String
messagebus/src/main/java/com/yahoo/messagebus/routing/RoutingSpec.java