com.microsoft.tfs.core.clients.workitem.queryhierarchy
Interface QueryFolder

All Superinterfaces:
QueryItem
All Known Subinterfaces:
QueryHierarchy

public interface QueryFolder
extends QueryItem

Represents a folder in Team Foundation Server that can be queried.

Since:
TEE-SDK-10.1

Method Summary
 void add(QueryItem item)
          Adds the given QueryItem as a child of this folder.
 boolean contains(QueryItem item)
          Determines whether this folder contains the given QueryItem.
 boolean containsID(com.microsoft.tfs.util.GUID id)
          Determines whether this folder contains a child QueryItem with the given id.
 boolean containsName(java.lang.String name)
          Determines whether this folder contains a child QueryItem with the given name (ignoring case.) Note that this is not recursive.
 QueryItem getItemByID(com.microsoft.tfs.util.GUID id)
          Returns the child QueryItem with the given id.
 QueryItem getItemByName(java.lang.String name)
          Returns the child QueryItem with the given name.
 QueryItem[] getItems()
          Gets the child QueryItems contained by this folder.
 QueryDefinition newDefinition(java.lang.String definitionName, java.lang.String queryText)
          Creates a new QueryDefinition beneath this folder.
 QueryFolder newFolder(java.lang.String folderName)
          Creates a new QueryFolder beneath this folder.
 
Methods inherited from interface com.microsoft.tfs.core.clients.workitem.queryhierarchy.QueryItem
delete, getID, getName, getOriginalName, getOriginalOwnerDescriptor, getOriginalParent, getOwnerDescriptor, getParent, getProject, getType, isDeleted, isDirty, isNew, isPersonal, setName, setOwnerDescriptor
 

Method Detail

getItems

QueryItem[] getItems()
Gets the child QueryItems contained by this folder.

Returns:
An array of QueryItems (never null)

contains

boolean contains(QueryItem item)
Determines whether this folder contains the given QueryItem. Note that this is not recursive.

Parameters:
item - The potential child QueryItem (not null).
Returns:
true if this folder contains the given QueryItem, false otherwise.

containsID

boolean containsID(com.microsoft.tfs.util.GUID id)
Determines whether this folder contains a child QueryItem with the given id. Note that this is not recursive.

Parameters:
id - The id of the potential child QueryItem (not null).
Returns:
true if this folder contains a QueryItem with the given id, false otherwise.

containsName

boolean containsName(java.lang.String name)
Determines whether this folder contains a child QueryItem with the given name (ignoring case.) Note that this is not recursive.

Parameters:
name - The name of the potential child QueryItem (not null).
Returns:
true if this folder contains a QueryItem with the given name, false otherwise.

getItemByID

QueryItem getItemByID(com.microsoft.tfs.util.GUID id)
Returns the child QueryItem with the given id.

Parameters:
id - The id of the child QueryItem (not null).
Returns:
The child QueryItem with the given id.
Throws:
java.lang.IllegalArgumentException - if no child QueryItem exists with the given id.

getItemByName

QueryItem getItemByName(java.lang.String name)
Returns the child QueryItem with the given name.

Parameters:
name - The name of the child QueryItem (not null).
Returns:
The child QueryItem with the given name.
Throws:
java.lang.IllegalArgumentException - if no child QueryItem exists with the given name.

add

void add(QueryItem item)
Adds the given QueryItem as a child of this folder.

Parameters:
item - The child QueryItem to add to this folder (not null).
Throws:
java.lang.IllegalArgumentException - if the given QueryItem cannot be added to this folder because this folder is the root of the query hierarchy, the folder is being deleted from the server, the given QueryItem is a folder and the server is a pre-TFS 2010 version that does not support query hierarchies, the given QueryItem is associated with a different Team Project than this folder, or the given QueryItem already exists in the query hierarchy as a parent of this folder.
WorkItemException - if a child with the same name already exists

newFolder

QueryFolder newFolder(java.lang.String folderName)
Creates a new QueryFolder beneath this folder.

Parameters:
folderName - The name of the folder to create (not null)
Returns:
The created QueryFolder.

newDefinition

QueryDefinition newDefinition(java.lang.String definitionName,
                              java.lang.String queryText)
Creates a new QueryDefinition beneath this folder.

Parameters:
definitionName - The name of the query to create (not null)
queryText - The WIQL to create the query with (not null or empty)
Returns:
The created QueryDefinition.


© 2015 Microsoft. All rights reserved.