com.microsoft.tfs.core.clients.versioncontrol.specs
Class LabelSpec

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

public final class LabelSpec
extends java.lang.Object

A label specification. Each label specification has a required label name, but the scope (a server path) is optional and is represented as null in this object if it was not specified. When a label spec with a null scope is sent to the server, the server will default the scope to the team project containing the labeled item.

Since:
TEE-SDK-10.1

Constructor Summary
LabelSpec(java.lang.String label, java.lang.String scope)
          Creates a label spec.
 
Method Summary
 java.lang.String getLabel()
           
 java.lang.String getScope()
           
static LabelSpec parse(java.lang.String specString, java.lang.String defaultScope, boolean permitWildcardsInLabel)
          Parses the values from the given spec string, using the given default scope if none can be parsed.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LabelSpec

public LabelSpec(java.lang.String label,
                 java.lang.String scope)
Creates a label spec.

Parameters:
label - the name of the label (must not be null or empty).
scope - the scope (repository folder path) where the label resides (may be null to indiciate the default scope).
Method Detail

parse

public static LabelSpec parse(java.lang.String specString,
                              java.lang.String defaultScope,
                              boolean permitWildcardsInLabel)
                       throws LabelSpecParseException
Parses the values from the given spec string, using the given default scope if none can be parsed.

Parameters:
specString - the spec string to parse into this object (must not be null or empty)
defaultScope - the scope to use if the spec string does not specify one (may be NullPointerException to indicate the default scope).
permitWildcardsInLabel - whether to allow wildcards in the label names
Returns:
a LabelSpec with the parsed values
Throws:
LabelSpecParseException - if an error occurred parsing the spec string

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getLabel

public java.lang.String getLabel()
Returns:
Returns the label.

getScope

public java.lang.String getScope()
Returns:
Returns the scope, which may be null to indicate the default scope.


© 2015 Microsoft. All rights reserved.