docs: static boolean addToJSON(StringBuilder sb, String name, String value, boolean jsonEscapeName, boolean jsonEscapeValue, boolean trim, boolean isFirstField) {
          // if name or value is null just return
          if (name == null || value == null)
              return false;
  
          // add comma if isFirstField == false
          if (!isFirstField)
              sb.append(",");
          // trim value if requested
          if (trim)
              value = value.trim();
          // escape value if requested
          if (jsonEscapeValue)
              value = jsonEscape2(value);
          // escape name if requested
          if (jsonEscapeName)
              name = jsonEscape2(name);
          // append name : value to sb
          sb.append("\"" + name + "\":\"").append(value).append("\"");
          return true;
      }