code: public static String format(Object object) {
          Gson gson = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
          JsonParser jp = new JsonParser();
          JsonElement je = jp.parse(gson.toJson(object));
          String prettyJsonString = gson.toJson(je);
          //简单处理function
          String[] lines = prettyJsonString.split("\n");
          lines = replaceFunctionQuote(lines);
          StringBuilder stringBuilder = new StringBuilder();
          for (String line : lines) {
              stringBuilder.append(line);
          }
          return stringBuilder.toString();
      }
docs: 格式化对象为Json
  
  @param object
  @return