com.microsoft.tfs.core.clients.versioncontrol.soapextensions
Class ItemIdentifier

java.lang.Object
  extended by com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper
      extended by com.microsoft.tfs.core.clients.versioncontrol.soapextensions.ItemIdentifier

public class ItemIdentifier
extends com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper

Identifies a server item at a given version, with an optional associated change (which is not strictly part of the identity).

equals(Object) and hashCode() do not consider this item's change type (accessible from getChangeType()). This behavior makes this class useful for comparing against other ItemIdentifiers queried from the server at different times: the change type may change, but the same item is being identified.

Since:
TEE-SDK-10.1
Thread-safety:
immutable

Field Summary
 
Fields inherited from class com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper
webServiceObject
 
Constructor Summary
ItemIdentifier(ms.tfs.versioncontrol.clientservices._03._ItemIdentifier webServiceObject)
          Creates a ItemIdentifier from a web service object.
ItemIdentifier(Change change)
          Creates a ItemIdentifier from a Change.
ItemIdentifier(java.lang.String serverPath)
          Creates a ItemIdentifier for the given server path.
ItemIdentifier(java.lang.String serverPath, int deletionID)
          Creates a ItemIdentifier for the given server path and deletion ID.
ItemIdentifier(java.lang.String serverPath, VersionSpec version, int deletionID)
          Creates a ItemIdentifier for the given server path at the given version with the given deletion ID.
 
Method Summary
 boolean equals(java.lang.Object o)
          
 ChangeType getChangeType()
           
 int getDeletionID()
           
 java.lang.String getItem()
           
 VersionSpec getVersion()
           
 ms.tfs.versioncontrol.clientservices._03._ItemIdentifier getWebServiceObject()
          Gets the web service object this class wraps.
 int hashCode()
          
 
Methods inherited from class com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper
toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ItemIdentifier

public ItemIdentifier(ms.tfs.versioncontrol.clientservices._03._ItemIdentifier webServiceObject)
Creates a ItemIdentifier from a web service object.

Parameters:
webServiceObject - the web service object (must not be null)

ItemIdentifier

public ItemIdentifier(Change change)
Creates a ItemIdentifier from a Change. All fields will be initialized from the given change (including version and change type).

Parameters:
change - the change to create an identifier for (must not be null)

ItemIdentifier

public ItemIdentifier(java.lang.String serverPath)
Creates a ItemIdentifier for the given server path. The version and change type will be null.

Parameters:
serverPath - the server path (must not be null or empty)

ItemIdentifier

public ItemIdentifier(java.lang.String serverPath,
                      int deletionID)
Creates a ItemIdentifier for the given server path and deletion ID. The version and change type will be null.

Parameters:
serverPath - the server path (must not be null or empty)
deletionID - the deletion ID (0 for none)

ItemIdentifier

public ItemIdentifier(java.lang.String serverPath,
                      VersionSpec version,
                      int deletionID)
Creates a ItemIdentifier for the given server path at the given version with the given deletion ID. The change type will be null.

Parameters:
serverPath - the server path (must not be null or empty)
version - the version of the item (may be null)
deletionID - the deletion ID (0 for none)
Method Detail

getWebServiceObject

public ms.tfs.versioncontrol.clientservices._03._ItemIdentifier getWebServiceObject()
Gets the web service object this class wraps. The returned object should not be modified.

Returns:
the web service object this class wraps.

getItem

public java.lang.String getItem()
Returns:
the server path of this item, never null or empty

getVersion

public VersionSpec getVersion()
Returns:
the version of the item, may be null

getDeletionID

public int getDeletionID()
Returns:
the deletion ID for this item

getChangeType

public ChangeType getChangeType()
Returns:
the change type for this item, may be null

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper

hashCode

public int hashCode()

Overrides:
hashCode in class com.microsoft.tfs.core.internal.wrappers.WebServiceObjectWrapper


© 2015 Microsoft. All rights reserved.