Package jetbrains.buildServer.vcs.impl
Class VcsRootImpl
- java.lang.Object
-
- jetbrains.buildServer.vcs.impl.VcsRootImpl
-
- Direct Known Subclasses:
DeletedVcsRoot
,InaccessibleVcsRoot
,SVcsRootImpl
,VcsServiceRoot
public class VcsRootImpl extends Object implements VcsRoot
Version control connection settings.
-
-
Field Summary
Fields Modifier and Type Field Description static String
BRANCH_SPEC_PROP
Deprecated.protected static String
CHECKOUT_ROOT
Deprecated.static String
UNKNOWN_ROOT_NAME
static String
VCS_NAME_PROP
Deprecated.static String
VCS_ROOT_NAME_PROP
Deprecated.-
Fields inherited from interface jetbrains.buildServer.vcs.VcsRoot
SECURE_PROPERTY_PREFIX
-
-
Constructor Summary
Constructors Constructor Description VcsRootImpl(long id, String vcsName)
Creates new settings object on id and associated version control name.VcsRootImpl(long id, String vcsName, Map<String,String> properties)
Create VcsRootImpl object, the most generic constructorVcsRootImpl(long id, Map<String,String> properties)
Creates new settings on id and properties set.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addProperty(String propertyName, String propertyValue)
Adds new property.String
describe(boolean verbose)
boolean
equals(Object o)
String
getExternalId()
long
getId()
returns root internal idString
getName()
returns descriptive name of the vcs rootMap<String,String>
getProperties()
Returns mapping from a property name to its valueString
getProperty(String propertyName)
Provides specified property valueString
getProperty(String propertyName, String defaultValue)
Provides specified property value or default value if property is not definedString
getVcsName()
Returns name of the corresponding version control.int
hashCode()
static boolean
isEquivalentRoots(VcsRoot root1, VcsRoot root2)
void
setExternalId(String externalId)
void
setName(String name)
Changes VCS root name.void
setProperties(Map<String,String> map)
Adds number of properties.void
setVcsName(String vcsName)
Sets new version control name (name of version control plugin)String
toString()
-
-
-
Field Detail
-
UNKNOWN_ROOT_NAME
public static final String UNKNOWN_ROOT_NAME
- See Also:
- Constant Field Values
-
VCS_NAME_PROP
@NonNls @Deprecated public static final String VCS_NAME_PROP
Deprecated.- See Also:
- Constant Field Values
-
VCS_ROOT_NAME_PROP
@NonNls @Deprecated public static final String VCS_ROOT_NAME_PROP
Deprecated.- See Also:
- Constant Field Values
-
BRANCH_SPEC_PROP
@NonNls @Deprecated public static final String BRANCH_SPEC_PROP
Deprecated.- See Also:
- Constant Field Values
-
CHECKOUT_ROOT
@NonNls @Deprecated protected static final String CHECKOUT_ROOT
Deprecated.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VcsRootImpl
public VcsRootImpl(long id, @NotNull String vcsName, @NotNull Map<String,String> properties)
Create VcsRootImpl object, the most generic constructor
-
VcsRootImpl
public VcsRootImpl(long id, String vcsName)
Creates new settings object on id and associated version control name. The resulting VCSRoot will have unset name.- Parameters:
id
- vcs root id.vcsName
- version control name.
-
-
Method Detail
-
getName
@NotNull public String getName()
Description copied from interface:VcsRoot
returns descriptive name of the vcs root
-
getId
public long getId()
Description copied from interface:VcsRoot
returns root internal id
-
addProperty
public void addProperty(String propertyName, String propertyValue)
Adds new property.- Parameters:
propertyName
- property name.propertyValue
- property value.
-
setProperties
public void setProperties(@NotNull Map<String,String> map)
Adds number of properties.- Parameters:
map
- properties map.
-
getVcsName
@NotNull public String getVcsName()
Description copied from interface:VcsRoot
Returns name of the corresponding version control.- Specified by:
getVcsName
in interfaceVcsRoot
- Returns:
- name of the corresponding version control
-
getProperty
public String getProperty(@NotNull String propertyName)
Description copied from interface:VcsRoot
Provides specified property value- Specified by:
getProperty
in interfaceVcsRoot
- Parameters:
propertyName
- name of the property whose value is requested- Returns:
- value of a specified property
-
getProperty
public String getProperty(@NotNull String propertyName, String defaultValue)
Description copied from interface:VcsRoot
Provides specified property value or default value if property is not defined- Specified by:
getProperty
in interfaceVcsRoot
- Parameters:
propertyName
- name of the property whose value is requesteddefaultValue
- default value which is returned if property value was not specified explicitly- Returns:
- - value of a specified property or 'defaultValue' if it is not defined
-
getProperties
@NotNull public Map<String,String> getProperties()
Description copied from interface:VcsRoot
Returns mapping from a property name to its value- Specified by:
getProperties
in interfaceVcsRoot
- Returns:
- map of all defined properties
-
describe
@NotNull public String describe(boolean verbose)
-
setName
public void setName(@NotNull String name)
Changes VCS root name.- Parameters:
name
- new VCS root name.
-
setVcsName
public void setVcsName(@NotNull String vcsName)
Sets new version control name (name of version control plugin)- Parameters:
vcsName
- new version control name
-
setExternalId
public void setExternalId(@NotNull String externalId)
- Parameters:
externalId
- External ID for this VCS Root- Since:
- 2021.2
-
getExternalId
@NotNull public String getExternalId()
- Specified by:
getExternalId
in interfaceVcsRoot
- Returns:
- externalID for this VCS Root, if it was set.
- Since:
- 2021.2
-
isEquivalentRoots
@Deprecated public static boolean isEquivalentRoots(VcsRoot root1, VcsRoot root2)
Deprecated.Checks whether the specified VCS roots are equivalent. VCS roots are considered equivalent if they both represent same VcsSupport and contain same properties.- Parameters:
root1
- VCS rootroot2
- VCS root- Returns:
- true if roots are equivalent
-
-