public WorklogInput build() { return new WorklogInput(self, issueUri, author, updateAuthor, comment, startDate, minutesSpent, visibility, adjustEstimate, adjustEstimateValue); } }
@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 Promise<Void> addWorklog(URI worklogUri, WorklogInput worklogInput) { final UriBuilder uriBuilder = UriBuilder.fromUri(worklogUri) .queryParam("adjustEstimate", worklogInput.getAdjustEstimate().restValue); switch (worklogInput.getAdjustEstimate()) { case NEW: uriBuilder.queryParam("newEstimate", Strings.nullToEmpty(worklogInput.getAdjustEstimateValue())); break; case MANUAL: uriBuilder.queryParam("reduceBy", Strings.nullToEmpty(worklogInput.getAdjustEstimateValue())); break; } return post(uriBuilder.build(), worklogInput, new WorklogInputJsonGenerator()); }
@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 Promise<Void> addWorklog(URI worklogUri, WorklogInput worklogInput) { final UriBuilder uriBuilder = UriBuilder.fromUri(worklogUri) .queryParam("adjustEstimate", worklogInput.getAdjustEstimate().restValue); switch (worklogInput.getAdjustEstimate()) { case NEW: uriBuilder.queryParam("newEstimate", Strings.nullToEmpty(worklogInput.getAdjustEstimateValue())); break; case MANUAL: uriBuilder.queryParam("reduceBy", Strings.nullToEmpty(worklogInput.getAdjustEstimateValue())); break; } return post(uriBuilder.build(), worklogInput, new WorklogInputJsonGenerator()); }
public WorklogInput build() { return new WorklogInput(self, issueUri, author, updateAuthor, comment, startDate, minutesSpent, visibility, adjustEstimate, adjustEstimateValue); } }