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
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a dead branch.static classEnsures that thegetActions()are always present in theActionable.getAllActions(). -
Constructor Summary
ConstructorsConstructorDescriptionBranch(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.SCMHeadgetHead()Returns theof the branchgetName()Returns the name of the branch.Gets all the properties.<T extends BranchProperty>
TgetProperty(Class<T> clazz) Gets the specific property, ornullif no such property is found.getScm()Returns theSCMfor the branch.Returns theSCMSource.getId()that this branch originates from.inthashCode()booleanhasProperty(Class<? extends BranchProperty> clazz) Tests if a property of a specific type is present.booleanReturnstrueiff 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- theSCMfor 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 theSCMfor the branch.- Returns:
- the
SCMfor the branch.
-
hasProperty
Tests if a property of a specific type is present.- Parameters:
clazz- the specific property type- Returns:
trueif and only if there is a property of the specified type.
-
getProperty
Gets the specific property, ornullif no such property is found.- Type Parameters:
T- the type of property.- Parameters:
clazz- the type of property.- Returns:
- the the specific property, or
nullif 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
nullif no such action is present.
-
isBuildable
public boolean isBuildable()Returnstrueiff the branch is can be built.- Returns:
trueiff the branch is can be built.
-
equals
-
hashCode
public int hashCode()
-