@Override public JSONObject generate(final WorklogInput worklogInput) throws JSONException { final JSONObject res = new JSONObject() .put("self", worklogInput.getSelf()) .put("comment", worklogInput.getComment()) .put("started", dateTimeFormatter.print(worklogInput.getStartDate())) .put("timeSpent", worklogInput.getMinutesSpent() + "m"); putGeneratedIfNotNull("visibility", worklogInput.getVisibility(), res, visibilityGenerator); putGeneratedIfNotNull("author", worklogInput.getAuthor(), res, basicUserJsonGenerator); putGeneratedIfNotNull("updateAuthor", worklogInput.getUpdateAuthor(), res, basicUserJsonGenerator); return res; }
@Override public JSONObject generate(final WorklogInput worklogInput) throws JSONException { final JSONObject res = new JSONObject() .put("self", worklogInput.getSelf()) .put("comment", worklogInput.getComment()) .put("started", dateTimeFormatter.print(worklogInput.getStartDate())) .put("timeSpent", worklogInput.getMinutesSpent() + "m"); putGeneratedIfNotNull("visibility", worklogInput.getVisibility(), res, visibilityGenerator); putGeneratedIfNotNull("author", worklogInput.getAuthor(), res, basicUserJsonGenerator); putGeneratedIfNotNull("updateAuthor", worklogInput.getUpdateAuthor(), res, basicUserJsonGenerator); return res; }