/** * Used for creating {@link WorklogResult} objects that also capture a <code>adjustmentAmount</code> to be set. * * @param worklog the worklog * @param adjustmentAmount the adjustment amount in seconds * @return Creates a {@link WorklogResult} that contains the {@link Worklog} and the adjustment amount. The editable check will be required. */ public static WorklogAdjustmentAmountResult createAdjustmentAmount(final Worklog worklog, final Long adjustmentAmount) { return createAdjustmentAmount(worklog, adjustmentAmount, true); }
@Override public WorklogAdjustmentAmountResult validateDeleteWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, Long worklogId, String adjustmentAmount) { WorklogResult originalWorklogResult = validateDelete(jiraServiceContext, worklogId); if (originalWorklogResult != null && isValidAdjustmentAmount(jiraServiceContext, adjustmentAmount)) { return WorklogResultFactory.createAdjustmentAmount(originalWorklogResult, getDurationForFormattedString(adjustmentAmount, jiraServiceContext)); } return null; }
/** * Used for copying the {@link WorklogResult} received from the base <code>validate</code> method and adding on the * <code>adjustmentAmount</code>. * * @param worklogResult the worklog result to copy; must not be null. * @param adjustmentAmount the adjustment amount in seconds * @return Creates a {@link WorklogResult} that contains the {@link Worklog} and the adjustment amount. The editable check will be required. */ public static WorklogAdjustmentAmountResult createAdjustmentAmount(final WorklogResult worklogResult, final Long adjustmentAmount) { notNull("worklogResult", worklogResult); return createAdjustmentAmount(worklogResult.getWorklog(), adjustmentAmount, worklogResult.isEditableCheckRequired()); }
@Override public WorklogAdjustmentAmountResult validateCreateWithManuallyAdjustedEstimate(JiraServiceContext jiraServiceContext, WorklogAdjustmentAmountInputParameters params) { WorklogResult worklogResult = validateCreate(jiraServiceContext, params); if (isValidAdjustmentAmount(jiraServiceContext, params.getAdjustmentAmount(), params.getErrorFieldPrefix()) && worklogResult != null) { return WorklogResultFactory.createAdjustmentAmount(worklogResult, getDurationForFormattedString(params.getAdjustmentAmount(), jiraServiceContext)); } return null; }