com.microsoft.tfs.core.clients.versioncontrol
Class TeamProject

java.lang.Object
  extended by com.microsoft.tfs.core.clients.versioncontrol.TeamProject

public class TeamProject
extends java.lang.Object

Used by check-in policies, describes the version control item at the root of a team project.

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

Constructor Summary
TeamProject(Item item, VersionControlClient client)
          Creates a TeamProject for an item.
 
Method Summary
 boolean equals(java.lang.Object obj)
          
static TeamProject[] fromItems(Item[] items, VersionControlClient client)
          Creates new TeamProject objects for the given items.
 PolicyDefinition[] getCheckinPolicies()
          Gets the policies defined for this team project.
 int getItemID()
           
 java.lang.String getName()
           
 java.lang.String getServerItem()
           
 VersionControlClient getVersionControlClient()
           
 int hashCode()
          
static Failure validateChange(java.lang.String serverItem, ItemType type)
          Validates if given server items is a root or team project path.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TeamProject

public TeamProject(Item item,
                   VersionControlClient client)
Creates a TeamProject for an item.

Parameters:
item - the item that describes the team project (must not be null)
Method Detail

fromItems

public static TeamProject[] fromItems(Item[] items,
                                      VersionControlClient client)
Creates new TeamProject objects for the given items.

Parameters:
items - the items to wrap with TeamProjects (must not be null)
Returns:
an array of team projects, one for each given item.

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

getServerItem

public java.lang.String getServerItem()
Returns:
the server path where this team project is located.

getName

public java.lang.String getName()
Returns:
the name of this team project.

getVersionControlClient

public VersionControlClient getVersionControlClient()
Returns:
the VersionControlClient that can access this team project (may be null)

getItemID

public int getItemID()
Returns:
the ID number for this team project's item.

getCheckinPolicies

public PolicyDefinition[] getCheckinPolicies()
Gets the policies defined for this team project.

Returns:
the policies that are defined on this team project.

validateChange

public static Failure validateChange(java.lang.String serverItem,
                                     ItemType type)
Validates if given server items is a root or team project path. If so, creates apropriate failure. Does not validate if item represents existing team project or child of existing team project.

Parameters:
serverItem - the server item where the change is being made (must not be null or empty)
type - the type of the server item where the change is being made (must not be null)
Returns:
null if the operation is valid, a Failure if the serverItem is root or team project folder or some other error condition


© 2015 Microsoft. All rights reserved.