com.atlassian.jira.rest.client.api.domain.input
Class WorklogInputBuilder

java.lang.Object
  extended by com.atlassian.jira.rest.client.api.domain.input.WorklogInputBuilder

public class WorklogInputBuilder
extends java.lang.Object

Builder class for WorklogInput. Allows to create new worklogInput instance by using convenient setters. Especially useful are methods to set estimate adjustment options: setAdjustEstimateAuto(), setAdjustEstimateLeave(), setAdjustEstimateManual(String) and setAdjustEstimateNew(String).
If you want ot create new WorklogInput from existing Worklog entity then use copyFromWorklog(com.atlassian.jira.rest.client.api.domain.Worklog) method.


Field Summary
static java.lang.String ESTIMATE_UNIT_MINUTES
           
 
Constructor Summary
WorklogInputBuilder(java.net.URI issueUri)
           
 
Method Summary
 WorklogInput build()
           
 WorklogInputBuilder copyFromWorklog(Worklog worklog)
           
 WorklogInputBuilder setAdjustEstimateAuto()
          Sets AdjustEstimate to AUTO - will automatically adjust the value based on the minutes spend specified on the worklog input.
 WorklogInputBuilder setAdjustEstimateLeave()
          Sets AdjustEstimate to LEAVE - leaves estimate as is.
 WorklogInputBuilder setAdjustEstimateManual(int reduceEstimateByMinutes)
          Sets AdjustEstimate to MANUAL - reduces remaining estimate by given value.
 WorklogInputBuilder setAdjustEstimateManual(java.lang.String reduceEstimateBy)
          Sets AdjustEstimate to MANUAL - reduces remaining estimate by given value.
 WorklogInputBuilder setAdjustEstimateNew(int newEstimateMinutes)
          Sets AdjustEstimate to NEW - sets estimate to specified value.
 WorklogInputBuilder setAdjustEstimateNew(java.lang.String newEstimate)
          Sets AdjustEstimate to NEW - sets estimate to specified value.
 WorklogInputBuilder setAuthor(BasicUser author)
           
 WorklogInputBuilder setComment(java.lang.String comment)
           
 WorklogInputBuilder setIssueUri(java.net.URI issueUri)
           
 WorklogInputBuilder setMinutesSpent(int minutesSpent)
           
 WorklogInputBuilder setSelf(java.net.URI self)
           
 WorklogInputBuilder setStartDate(org.joda.time.DateTime startDate)
           
 WorklogInputBuilder setUpdateAuthor(BasicUser updateAuthor)
           
 WorklogInputBuilder setVisibility(Visibility visibility)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ESTIMATE_UNIT_MINUTES

public static final java.lang.String ESTIMATE_UNIT_MINUTES
See Also:
Constant Field Values
Constructor Detail

WorklogInputBuilder

public WorklogInputBuilder(java.net.URI issueUri)
Method Detail

copyFromWorklog

public WorklogInputBuilder copyFromWorklog(Worklog worklog)

setAdjustEstimateNew

public WorklogInputBuilder setAdjustEstimateNew(java.lang.String newEstimate)
Sets AdjustEstimate to NEW - sets estimate to specified value.

Parameters:
newEstimate - new estimate value to set.
You can specify a time unit after a time value 'X', such as Xw, Xd, Xh or Xm, to represent weeks (w), days (d), hours (h) and minutes (m), respectively.
If you do not specify a time unit, minute will be assumed.
Returns:
this worklog input builder object

setAdjustEstimateNew

public WorklogInputBuilder setAdjustEstimateNew(int newEstimateMinutes)
Sets AdjustEstimate to NEW - sets estimate to specified value.

Parameters:
newEstimateMinutes - new estimate value to set, in minutes.
Returns:
this worklog input builder object

setAdjustEstimateLeave

public WorklogInputBuilder setAdjustEstimateLeave()
Sets AdjustEstimate to LEAVE - leaves estimate as is.

Returns:
this worklog input builder object

setAdjustEstimateManual

public WorklogInputBuilder setAdjustEstimateManual(java.lang.String reduceEstimateBy)
Sets AdjustEstimate to MANUAL - reduces remaining estimate by given value.

Parameters:
reduceEstimateBy - the amount to reduce the remaining estimate by
You can specify a time unit after a time value 'X', such as Xw, Xd, Xh or Xm, to represent weeks (w), days (d), hours (h) and minutes (m), respectively.
If you do not specify a time unit, minute will be assumed.
Returns:
this worklog input builder object

setAdjustEstimateManual

public WorklogInputBuilder setAdjustEstimateManual(int reduceEstimateByMinutes)
Sets AdjustEstimate to MANUAL - reduces remaining estimate by given value.

Parameters:
reduceEstimateByMinutes - the amount to reduce the remaining estimate by, in minutes.
Returns:
this worklog input builder object

setAdjustEstimateAuto

public WorklogInputBuilder setAdjustEstimateAuto()
Sets AdjustEstimate to AUTO - will automatically adjust the value based on the minutes spend specified on the worklog input.
This is the default option.

Returns:
this worklog input builder object

setSelf

public WorklogInputBuilder setSelf(java.net.URI self)

setIssueUri

public WorklogInputBuilder setIssueUri(java.net.URI issueUri)

setAuthor

public WorklogInputBuilder setAuthor(BasicUser author)

setUpdateAuthor

public WorklogInputBuilder setUpdateAuthor(BasicUser updateAuthor)

setComment

public WorklogInputBuilder setComment(java.lang.String comment)

setStartDate

public WorklogInputBuilder setStartDate(org.joda.time.DateTime startDate)

setMinutesSpent

public WorklogInputBuilder setMinutesSpent(int minutesSpent)

setVisibility

public WorklogInputBuilder setVisibility(Visibility visibility)

build

public WorklogInput build()


Copyright © 2015 Atlassian. All Rights Reserved.