Package jenkins.branch
Class Branch
java.lang.Object
jenkins.branch.Branch
- Direct Known Subclasses:
Branch.Dead
A source code branch.
Not to be subclassed outside this plugin.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Represents a dead branch.static class
Ensures that thegetActions()
are always present in theActionable.getAllActions()
. -
Constructor Summary
ConstructorDescriptionBranch
(String sourceId, jenkins.scm.api.SCMHead head, SCM scm, List<? extends BranchProperty> properties) Constructs a branch instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
<T extends Action>
TGets the specific action, or null if no such property is found.Gets all the actions.Gets a branch name suitable for use in paths.jenkins.scm.api.SCMHead
getHead()
Returns theof the branch
getName()
Returns the name of the branch.Gets all the properties.<T extends BranchProperty>
TgetProperty
(Class<T> clazz) Gets the specific property, ornull
if no such property is found.getScm()
Returns theSCM
for the branch.Returns theSCMSource.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
Returnstrue
iff the branch is can be built.
-
Constructor Details
-
Branch
public Branch(String sourceId, jenkins.scm.api.SCMHead head, SCM scm, List<? extends BranchProperty> properties) Constructs a branch instance.- Parameters:
sourceId
- theSCMSource.getId()
head
- the name of the branch.scm
- theSCM
for the branch.properties
- the properties to initiate the branch with.
-
-
Method Details
-
getSourceId
Returns theSCMSource.getId()
that this branch originates from.- Returns:
- the
SCMSource.getId()
that this branch originates from.
-
getName
Returns the name of the branch.- Returns:
- the name of the branch.
-
getEncodedName
Gets a branch name suitable for use in paths.- Returns:
getName()
with URL-unsafe characters escaped- Since:
- 0.2-beta-7
-
getHead
@Exported public jenkins.scm.api.SCMHead getHead()Returns theof the branch
- Returns:
- the
of the branch
-
getScm
Returns theSCM
for the branch.- Returns:
- the
SCM
for the branch.
-
hasProperty
Tests if a property of a specific type is present.- Parameters:
clazz
- the specific property type- Returns:
true
if and only if there is a property of the specified type.
-
getProperty
Gets the specific property, ornull
if no such property is found.- Type Parameters:
T
- the type of property.- Parameters:
clazz
- the type of property.- Returns:
- the the specific property, or
null
if no such property is found.
-
getProperties
Gets all the properties.- Returns:
- the properties.
-
getActions
Gets all the actions.- Returns:
- all the actions
-
getAction
Gets the specific action, or null if no such property is found.- Type Parameters:
T
- the type of action- Parameters:
clazz
- the type of action.- Returns:
- the first action of the requested type or
null
if no such action is present.
-
isBuildable
public boolean isBuildable()Returnstrue
iff the branch is can be built.- Returns:
true
iff the branch is can be built.
-
equals
-
hashCode
public int hashCode()
-