class AppcRunTasks {

    protected String buildPayloadFromUserParams(Map<String, Object> userParams) {
        if (userParams == null || userParams.size() == 0) {
            return null;
        }

        String payload = "{}";
        for (Map.Entry<String, Object> entry : userParams.entrySet()) {
            payload = JsonUtils.addJsonValue(payload, entry.getKey(), (String) entry.getValue());
        }

        payload = payload.replaceAll("\"", "\\\\\"");
        payload = payload.replaceAll("\n", "");
        return payload;
    }

}