@ExportedBean public class Branch extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Branch.Dead
Represents a dead branch.
|
static class |
Branch.TransientJobActionsFactoryImpl
Ensures that the
getActions() are always present in the Actionable.getAllActions() . |
Constructor and Description |
---|
Branch(String sourceId,
jenkins.scm.api.SCMHead head,
hudson.scm.SCM scm,
List<? extends BranchProperty> properties)
Constructs a branch instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
<T extends hudson.model.Action> |
getAction(Class<T> clazz)
Gets the specific action, or null if no such property is found.
|
List<hudson.model.Action> |
getActions()
Gets all the actions.
|
String |
getEncodedName()
Gets a branch name suitable for use in paths.
|
jenkins.scm.api.SCMHead |
getHead()
Returns the
of the branch |
String |
getName()
Returns the name of the branch.
|
List<BranchProperty> |
getProperties()
Gets all the properties.
|
<T extends BranchProperty> |
getProperty(Class<T> clazz)
Gets the specific property, or
null if no such property is found. |
hudson.scm.SCM |
getScm()
Returns the
SCM for the branch. |
String |
getSourceId()
Returns the
SCMSource.getId() that this branch originates from. |
int |
hashCode() |
boolean |
hasProperty(Class<? extends BranchProperty> clazz)
Tests if a property of a specific type is present.
|
boolean |
isBuildable()
Returns
true iff the branch is can be built. |
public Branch(String sourceId, jenkins.scm.api.SCMHead head, hudson.scm.SCM scm, List<? extends BranchProperty> properties)
sourceId
- the SCMSource.getId()
head
- the name of the branch.scm
- the SCM
for the branch.properties
- the properties to initiate the branch with.public String getSourceId()
SCMSource.getId()
that this branch originates from.SCMSource.getId()
that this branch originates from.public String getName()
public String getEncodedName()
getName()
with URL-unsafe characters escaped@Exported public jenkins.scm.api.SCMHead getHead()
of the branch
of the branch
@Exported public hudson.scm.SCM getScm()
SCM
for the branch.SCM
for the branch.public boolean hasProperty(Class<? extends BranchProperty> clazz)
clazz
- the specific property typetrue
if and only if there is a property of the specified type.@CheckForNull public <T extends BranchProperty> T getProperty(Class<T> clazz)
null
if no such property is found.T
- the type of property.clazz
- the type of property.null
if no such property is found.@NonNull public List<BranchProperty> getProperties()
@NonNull public List<hudson.model.Action> getActions()
@CheckForNull public <T extends hudson.model.Action> T getAction(Class<T> clazz)
T
- the type of actionclazz
- the type of action.null
if no such action is present.public boolean isBuildable()
true
iff the branch is can be built.true
iff the branch is can be built.Copyright © 2016–2017. All rights reserved.