com.microsoft.tfs.core.clients.workitem
Interface WorkItem


public interface WorkItem

Represents a work item on Team Foundation Server. Implementations must implement equals() and hashCode().

Since:
TEE-SDK-10.1
Thread-safety:
thread-compatible

Method Summary
 void addWorkItemStateListener(WorkItemStateListener listener)
          Adds a listener for the state changed event.
 WorkItem copy()
           
 WorkItem copy(WorkItemType targetType)
           
 AttachmentCollection getAttachments()
           
 WorkItemClient getClient()
           
 FieldCollection getFields()
           
 int getID()
           
 LinkCollection getLinks()
           
 java.lang.String getNextState(java.lang.String action)
          Gets the next state of this work item based on the action of a user.
 Project getProject()
           
 RevisionCollection getRevisions()
           
 int getTemporaryID()
           
 java.lang.String getTitle()
           
 WorkItemType getType()
           
 java.lang.String getURI()
           
 boolean isDirty()
           
 boolean isOpen()
           
 boolean isValid()
          Validates the fields of this work item.
 void open()
          Opens this work item for modification.
 void removeWorkItemStateListener(WorkItemStateListener listener)
          Removes a listener for the state changed event.
 void reset()
          Reverts all changes that were made since the last save.
 void save()
          Saves any pending changes on this work item.
 void setTitle(java.lang.String title)
          Sets the title of this work item.
 void syncToLatest()
          Synchronizes the work item to the latest revision.
 

Method Detail

open

void open()
Opens this work item for modification.


save

void save()
          throws UnableToSaveException
Saves any pending changes on this work item.

Throws:
UnableToSaveException - if there was an error saving the work item

reset

void reset()
Reverts all changes that were made since the last save.


syncToLatest

void syncToLatest()
Synchronizes the work item to the latest revision.


getNextState

java.lang.String getNextState(java.lang.String action)
Gets the next state of this work item based on the action of a user.

Parameters:
action - the action string (must not be null)
Returns:
the next state

getType

WorkItemType getType()
Returns:
a WorkItemType object that represents the type of this work item.

getProject

Project getProject()
Returns:
a Project object that contains this work item.

getFields

FieldCollection getFields()
Returns:
the FieldCollection object that contains the Fields of this work item.

getRevisions

RevisionCollection getRevisions()
Returns:
a RevisionCollection object that represents a collection of valid revision numbers for this work item.

getAttachments

AttachmentCollection getAttachments()
Returns:
the AttachmentCollection object that represents the attachments that belong to this work item.

getLinks

LinkCollection getLinks()
Returns:
the collection of the links in this work item.

getID

int getID()
Returns:
the ID of this work item.

getTemporaryID

int getTemporaryID()
Returns:
the temporary ID of this work item.

getURI

java.lang.String getURI()
Returns:
Gets the uniform resource identifier (URI) of this work item.

getTitle

java.lang.String getTitle()
Returns:
Gets the title of this work item.

setTitle

void setTitle(java.lang.String title)
Sets the title of this work item.

Parameters:
title - the the title of this work item

addWorkItemStateListener

void addWorkItemStateListener(WorkItemStateListener listener)
Adds a listener for the state changed event.

Parameters:
listener - the listener to add (must not be null)

removeWorkItemStateListener

void removeWorkItemStateListener(WorkItemStateListener listener)
Removes a listener for the state changed event.

Parameters:
listener - the listener to remove (must not be null)

isOpen

boolean isOpen()
Returns:
true this work item is currently open for edit, false otherwise

isDirty

boolean isDirty()
Returns:
true this work item has been changed since its last save, false otherwise

isValid

boolean isValid()
Validates the fields of this work item.

Returns:
true if the work item is valid, false if it is not valid

getClient

WorkItemClient getClient()
Returns:
the WorkItemClient for this work item

copy

WorkItem copy()
Returns:
a copy of this WorkItem instance.

copy

WorkItem copy(WorkItemType targetType)
Returns:
a copy of this WorkItem instance that is of the specified WorkItemType.


© 2015 Microsoft. All rights reserved.