com.atlassian.jira.issue
Class IssueInputParametersImpl

java.lang.Object
  extended by com.atlassian.jira.issue.IssueInputParametersImpl
All Implemented Interfaces:
IssueInputParameters

public class IssueInputParametersImpl
extends java.lang.Object
implements IssueInputParameters

Since:
v4.1

Constructor Summary
IssueInputParametersImpl()
           
IssueInputParametersImpl(java.util.Map<java.lang.String,java.lang.String[]> actionParameters)
          Can be used to quickly convert some "web-style" parameters (which can be the result of a form submit with the fields rendered create/edit html) to an IssueInputParameters object.
 
Method Summary
 IssueInputParameters addCustomFieldValue(java.lang.Long customFieldId, java.lang.String... values)
          Adds a value for a custom field with the specified id.
 IssueInputParameters addCustomFieldValue(java.lang.String fullCustomFieldKey, java.lang.String... values)
          Adds a value for a custom field with the specified full key.
 java.util.Map<java.lang.String,java.lang.String[]> getActionParameters()
          This provides the "web-style" parameters that JIRA fields expect to perform their functions.
 java.lang.Long[] getAffectedVersionIds()
           
 java.lang.String getAssigneeId()
           
 java.lang.String getCommentValue()
           
 java.lang.Long[] getComponentIds()
           
 java.lang.String[] getCustomFieldValue(java.lang.Long customFieldId)
           
 java.lang.String[] getCustomFieldValue(java.lang.String fullCustomFieldKey)
           
 java.lang.String getDescription()
           
 java.lang.String getDueDate()
           
 java.lang.String getEnvironment()
           
 java.util.Map<java.lang.String,java.lang.Object> getFieldValuesHolder()
           
 java.lang.Long[] getFixVersionIds()
           
 java.lang.String getIssueTypeId()
           
 java.lang.Long getOriginalEstimate()
           
 java.lang.String getPriorityId()
           
 java.lang.Long getProjectId()
           
 java.util.Collection<java.lang.String> getProvidedFields()
           
 java.lang.String getReporterId()
           
 java.lang.String getResolutionDate()
           
 java.lang.String getResolutionId()
           
 java.lang.Long getSecurityLevelId()
           
 java.lang.String getStatusId()
           
 java.lang.String getSummary()
           
 java.lang.Long getTimeSpent()
           
 boolean isFieldPresent(java.lang.String fieldId)
           
 boolean isFieldSet(java.lang.String fieldId)
           
 boolean retainExistingValuesWhenParameterNotProvided()
           
 IssueInputParameters setAffectedVersionIds(java.lang.Long... affectedVersionIds)
           
 IssueInputParameters setAssigneeId(java.lang.String assigneeId)
           
 IssueInputParameters setComment(java.lang.String comment)
          Set a comment value with no visibility restrictions.
 IssueInputParameters setComment(java.lang.String comment, java.lang.Long projectRoleId)
          Set a comment value with a project role restriction.
 IssueInputParameters setComment(java.lang.String comment, java.lang.String groupId)
          Set a comment value with a group restriction.
 IssueInputParameters setComponentIds(java.lang.Long... componentIds)
           
 IssueInputParameters setDescription(java.lang.String description)
           
 IssueInputParameters setDueDate(java.lang.String dueDate)
           
 IssueInputParameters setEnvironment(java.lang.String environment)
           
 void setFieldValuesHolder(java.util.Map<java.lang.String,java.lang.Object> fieldValuesHolder)
          If set the validation will use the seed values from this field values holder.
 IssueInputParameters setFixVersionIds(java.lang.Long... fixVersionIds)
           
 IssueInputParameters setIssueTypeId(java.lang.String issueTypeId)
           
 IssueInputParameters setOriginalEstimate(java.lang.Long originalEstimate)
           
 IssueInputParameters setPriorityId(java.lang.String priorityId)
           
 IssueInputParameters setProjectId(java.lang.Long projectId)
           
 void setProvidedFields(java.util.Collection<java.lang.String> providedFields)
          Use this to indicate which fields validation should be performed on, if left alone then the systems configured fields for either create/update will be used.
 IssueInputParameters setReporterId(java.lang.String reporterId)
           
 IssueInputParameters setResolutionDate(java.lang.String resolutionDate)
           
 IssueInputParameters setResolutionId(java.lang.String resolutionId)
           
 void setRetainExistingValuesWhenParameterNotProvided(boolean retain)
           
 IssueInputParameters setSecurityLevelId(java.lang.Long securityLevelId)
           
 IssueInputParameters setStatusId(java.lang.String statusId)
           
 IssueInputParameters setSummary(java.lang.String summary)
           
 IssueInputParameters setTimeSpent(java.lang.Long timeSpent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IssueInputParametersImpl

public IssueInputParametersImpl()

IssueInputParametersImpl

public IssueInputParametersImpl(java.util.Map<java.lang.String,java.lang.String[]> actionParameters)
Can be used to quickly convert some "web-style" parameters (which can be the result of a form submit with the fields rendered create/edit html) to an IssueInputParameters object.

Parameters:
actionParameters - provides the default starting values for this object.
Method Detail

setProjectId

public IssueInputParameters setProjectId(java.lang.Long projectId)
Specified by:
setProjectId in interface IssueInputParameters
Parameters:
projectId - sets the project id for the issue.
Returns:
this object.

getProjectId

public java.lang.Long getProjectId()
Specified by:
getProjectId in interface IssueInputParameters
Returns:
the set project id, null if one does not exist or if it is not a valid number.

setIssueTypeId

public IssueInputParameters setIssueTypeId(java.lang.String issueTypeId)
Specified by:
setIssueTypeId in interface IssueInputParameters
Parameters:
issueTypeId - sets the issue type for the issue.
Returns:
this object.

getIssueTypeId

public java.lang.String getIssueTypeId()
Specified by:
getIssueTypeId in interface IssueInputParameters
Returns:
the set issue type id, null if one does not exist.

setPriorityId

public IssueInputParameters setPriorityId(java.lang.String priorityId)
Specified by:
setPriorityId in interface IssueInputParameters
Parameters:
priorityId - sets the priority for the issue.
Returns:
this object.

getPriorityId

public java.lang.String getPriorityId()
Specified by:
getPriorityId in interface IssueInputParameters
Returns:
the set priority id, null if one does not exist.

setResolutionId

public IssueInputParameters setResolutionId(java.lang.String resolutionId)
Specified by:
setResolutionId in interface IssueInputParameters
Parameters:
resolutionId - sets the resolution for the issue.
Returns:
this object.

getResolutionId

public java.lang.String getResolutionId()
Specified by:
getResolutionId in interface IssueInputParameters
Returns:
the set resolution id, null if one does not exist.

setStatusId

public IssueInputParameters setStatusId(java.lang.String statusId)
Specified by:
setStatusId in interface IssueInputParameters
Parameters:
statusId - sets the status of the issue.
Returns:
this object.

getStatusId

public java.lang.String getStatusId()
Specified by:
getStatusId in interface IssueInputParameters
Returns:
the set status id, null if one does not exist.

setSummary

public IssueInputParameters setSummary(java.lang.String summary)
Specified by:
setSummary in interface IssueInputParameters
Parameters:
summary - sets the summary for the issue.
Returns:
this object.

getSummary

public java.lang.String getSummary()
Specified by:
getSummary in interface IssueInputParameters
Returns:
the set summary, null if one does not exist.

setDescription

public IssueInputParameters setDescription(java.lang.String description)
Specified by:
setDescription in interface IssueInputParameters
Parameters:
description - sets the description for the issue.
Returns:
this object.

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface IssueInputParameters
Returns:
the set description, null if one does not exist.

setEnvironment

public IssueInputParameters setEnvironment(java.lang.String environment)
Specified by:
setEnvironment in interface IssueInputParameters
Parameters:
environment - sets the environment of the issue.
Returns:
this object.

getEnvironment

public java.lang.String getEnvironment()
Specified by:
getEnvironment in interface IssueInputParameters
Returns:
the set environment, null if one does not exist.

setAssigneeId

public IssueInputParameters setAssigneeId(java.lang.String assigneeId)
Specified by:
setAssigneeId in interface IssueInputParameters
Parameters:
assigneeId - sets the assignee id for the issue.
Returns:
this object.

getAssigneeId

public java.lang.String getAssigneeId()
Specified by:
getAssigneeId in interface IssueInputParameters
Returns:
the set assginee, null if one does not exist.

setReporterId

public IssueInputParameters setReporterId(java.lang.String reporterId)
Specified by:
setReporterId in interface IssueInputParameters
Parameters:
reporterId - sets the reporter id for the issue.
Returns:
this object.

getReporterId

public java.lang.String getReporterId()
Specified by:
getReporterId in interface IssueInputParameters
Returns:
the set reporter, null if one does not exist.

setComponentIds

public IssueInputParameters setComponentIds(java.lang.Long... componentIds)
Specified by:
setComponentIds in interface IssueInputParameters
Parameters:
componentIds - sets the components id's on the issue.
Returns:
this object.

getComponentIds

public java.lang.Long[] getComponentIds()
Specified by:
getComponentIds in interface IssueInputParameters
Returns:
the set component id's, null if they do not exist or if they are not valid numbers.

setFixVersionIds

public IssueInputParameters setFixVersionIds(java.lang.Long... fixVersionIds)
Specified by:
setFixVersionIds in interface IssueInputParameters
Parameters:
fixVersionIds - sets the fix version id's on the issue.
Returns:
this object.

getFixVersionIds

public java.lang.Long[] getFixVersionIds()
Specified by:
getFixVersionIds in interface IssueInputParameters
Returns:
the set fix version id's, null if they do not exist or if they are not valid numbers.

setAffectedVersionIds

public IssueInputParameters setAffectedVersionIds(java.lang.Long... affectedVersionIds)
Specified by:
setAffectedVersionIds in interface IssueInputParameters
Parameters:
affectedVersionIds - sets the affected version id's= on the issue.
Returns:
this object.

getAffectedVersionIds

public java.lang.Long[] getAffectedVersionIds()
Specified by:
getAffectedVersionIds in interface IssueInputParameters
Returns:
the set affected version id's, null if they do not exist or if they are not valid numbers.

setDueDate

public IssueInputParameters setDueDate(java.lang.String dueDate)
Specified by:
setDueDate in interface IssueInputParameters
Parameters:
dueDate - the formatted string that JIRA will accept as a date that will be set on the issue.
Returns:
this object.

getDueDate

public java.lang.String getDueDate()
Specified by:
getDueDate in interface IssueInputParameters
Returns:
the set due date, null if one does not exist.

setResolutionDate

public IssueInputParameters setResolutionDate(java.lang.String resolutionDate)
Specified by:
setResolutionDate in interface IssueInputParameters
Parameters:
resolutionDate - the formatted string that JIRA will accept as a date that will be set on the issue.
Returns:
this object.

getResolutionDate

public java.lang.String getResolutionDate()
Specified by:
getResolutionDate in interface IssueInputParameters
Returns:
the set resolution date, null if one does not exist.

setSecurityLevelId

public IssueInputParameters setSecurityLevelId(java.lang.Long securityLevelId)
Specified by:
setSecurityLevelId in interface IssueInputParameters
Parameters:
securityLevelId - sets the security level id on the issue.
Returns:
this object.

getSecurityLevelId

public java.lang.Long getSecurityLevelId()
Specified by:
getSecurityLevelId in interface IssueInputParameters
Returns:
the set security level id, null if one does not exist or it is not a valid number.

setOriginalEstimate

public IssueInputParameters setOriginalEstimate(java.lang.Long originalEstimate)
Specified by:
setOriginalEstimate in interface IssueInputParameters
Parameters:
originalEstimate - sets the original estimate on the issue.
Returns:
this object.

getOriginalEstimate

public java.lang.Long getOriginalEstimate()
Specified by:
getOriginalEstimate in interface IssueInputParameters
Returns:
the set original estimate, null if one does not exist or it is not a valid number.

setTimeSpent

public IssueInputParameters setTimeSpent(java.lang.Long timeSpent)
Specified by:
setTimeSpent in interface IssueInputParameters
Parameters:
timeSpent - sets the time spent on the issue.
Returns:
this object.

getTimeSpent

public java.lang.Long getTimeSpent()
Specified by:
getTimeSpent in interface IssueInputParameters
Returns:
the set time spent, null if one does not exist or it is not a valid number.

addCustomFieldValue

public IssueInputParameters addCustomFieldValue(java.lang.Long customFieldId,
                                                java.lang.String... values)
Description copied from interface: IssueInputParameters
Adds a value for a custom field with the specified id. This will put a value in the web-style parameters with a key of the form "customfield_PROVIDED_ID". If you want to specify the key then use the method IssueInputParameters.addCustomFieldValue(String, String...).

Specified by:
addCustomFieldValue in interface IssueInputParameters
Parameters:
customFieldId - the unique identifier of the custom field.
values - the custom field values, must be in the format the field expects.
Returns:
this object.

addCustomFieldValue

public IssueInputParameters addCustomFieldValue(java.lang.String fullCustomFieldKey,
                                                java.lang.String... values)
Description copied from interface: IssueInputParameters
Adds a value for a custom field with the specified full key. This will put a value in the web-style parameters with a key as provided.

Specified by:
addCustomFieldValue in interface IssueInputParameters
Parameters:
fullCustomFieldKey - used in the "web-style" parameters as the key, the custom field should expect this value as the key in its populate from parameters method.
values - the custom field values, must be in the format the field expects.
Returns:
this object.

retainExistingValuesWhenParameterNotProvided

public boolean retainExistingValuesWhenParameterNotProvided()
Specified by:
retainExistingValuesWhenParameterNotProvided in interface IssueInputParameters
Returns:
true if the issues value should be retained when a parameter has not been provided, false if the missing parameter should be treated as an update.

setRetainExistingValuesWhenParameterNotProvided

public void setRetainExistingValuesWhenParameterNotProvided(boolean retain)
Specified by:
setRetainExistingValuesWhenParameterNotProvided in interface IssueInputParameters
Parameters:
retain - true if non-provided parameters should have the values retained, false otherwise.
See Also:
IssueInputParameters.retainExistingValuesWhenParameterNotProvided()

getCustomFieldValue

public java.lang.String[] getCustomFieldValue(java.lang.Long customFieldId)
Specified by:
getCustomFieldValue in interface IssueInputParameters
Parameters:
customFieldId - uniquely identifies the custom field value you are looking for.
Returns:
the values for the provided custom field if they exist, null otherwise.

getCustomFieldValue

public java.lang.String[] getCustomFieldValue(java.lang.String fullCustomFieldKey)
Specified by:
getCustomFieldValue in interface IssueInputParameters
Parameters:
fullCustomFieldKey - identifies the custom field values you are looking for.
Returns:
the values for the provided custom field if they exist, null otherwise.

getCommentValue

public java.lang.String getCommentValue()
Specified by:
getCommentValue in interface IssueInputParameters
Returns:
the comment string value if it has been set, null otherwise.

setComment

public IssueInputParameters setComment(java.lang.String comment)
Description copied from interface: IssueInputParameters
Set a comment value with no visibility restrictions.

Specified by:
setComment in interface IssueInputParameters
Parameters:
comment - the comment value.
Returns:
this object.

setComment

public IssueInputParameters setComment(java.lang.String comment,
                                       java.lang.Long projectRoleId)
Description copied from interface: IssueInputParameters
Set a comment value with a project role restriction.

Specified by:
setComment in interface IssueInputParameters
Parameters:
comment - the comment value.
projectRoleId - the id of the project role the comment must be restricted by.
Returns:
this object.

setComment

public IssueInputParameters setComment(java.lang.String comment,
                                       java.lang.String groupId)
Description copied from interface: IssueInputParameters
Set a comment value with a group restriction.

Specified by:
setComment in interface IssueInputParameters
Parameters:
comment - the comment value.
groupId - the group name that the comment must be restricted by.
Returns:
this object.

getActionParameters

public java.util.Map<java.lang.String,java.lang.String[]> getActionParameters()
Description copied from interface: IssueInputParameters
This provides the "web-style" parameters that JIRA fields expect to perform their functions.

Specified by:
getActionParameters in interface IssueInputParameters
Returns:
this is a raw map of "web" style input parameters. These parameters are used to allow the fields to attain the user inputted values. This map is of the style: <field_name> <String [] {value}>.

setFieldValuesHolder

public void setFieldValuesHolder(java.util.Map<java.lang.String,java.lang.Object> fieldValuesHolder)
Description copied from interface: IssueInputParameters
If set the validation will use the seed values from this field values holder.

Specified by:
setFieldValuesHolder in interface IssueInputParameters
Parameters:
fieldValuesHolder - provides the seed values for the field values holder.

getFieldValuesHolder

public java.util.Map<java.lang.String,java.lang.Object> getFieldValuesHolder()
Specified by:
getFieldValuesHolder in interface IssueInputParameters
Returns:
the provided field values holder or an empty map, never null.

getProvidedFields

public java.util.Collection<java.lang.String> getProvidedFields()
Specified by:
getProvidedFields in interface IssueInputParameters
Returns:
the field id's that should be validated, null if not specified.

setProvidedFields

public void setProvidedFields(java.util.Collection<java.lang.String> providedFields)
Description copied from interface: IssueInputParameters
Use this to indicate which fields validation should be performed on, if left alone then the systems configured fields for either create/update will be used.

Specified by:
setProvidedFields in interface IssueInputParameters
Parameters:
providedFields - a collection of Field.getId()'s which identify the fields.

isFieldSet

public boolean isFieldSet(java.lang.String fieldId)
Specified by:
isFieldSet in interface IssueInputParameters
Parameters:
fieldId - identifies the field in question, this will be the Field.getId().
Returns:
true if a non-null, non-empty value has been set for the field, false if not.

isFieldPresent

public boolean isFieldPresent(java.lang.String fieldId)
Specified by:
isFieldPresent in interface IssueInputParameters
Parameters:
fieldId - identifies the field in question, this will be the Field.getId().
Returns:
true if the field has been set, even with an empty value, false if not.


Copyright © 2002-2010 Atlassian. All Rights Reserved.