Class BranchDiscoveryTrait
java.lang.Object
hudson.model.AbstractDescribableImpl<T>
jenkins.scm.api.trait.SCMTrait<jenkins.scm.api.trait.SCMSourceTrait>
jenkins.scm.api.trait.SCMSourceTrait
com.cloudbees.jenkins.plugins.bitbucket.trait.BranchDiscoveryTrait
- All Implemented Interfaces:
ExtensionPoint,Describable<jenkins.scm.api.trait.SCMSourceTrait>
public class BranchDiscoveryTrait
extends jenkins.scm.api.trait.SCMSourceTrait
A
Discovery trait for bitbucket that will discover branches on the repository.- Since:
- 2.2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTrusts branches from the origin repository.static classOur descriptor.static classFilter that excludes branches that are also filed as a pull request.static classFilter that excludes branches that are not also filed as a pull request.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
ConstructorsConstructorDescriptionBranchDiscoveryTrait(boolean buildBranch, boolean buildBranchWithPr) Constructor for legacy code.BranchDiscoveryTrait(int strategyId) Constructor for stapler. -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecorateContext(jenkins.scm.api.trait.SCMSourceContext<?, ?> context) intReturns the strategy id.booleanincludeCategory(jenkins.scm.api.SCMHeadCategory category) booleanReturnstrueif building branches that are not filed as a PR.booleanReturnstrueif building branches that are filed as a PR.Methods inherited from class jenkins.scm.api.trait.SCMSourceTrait
_for, _for, all, applyToBuilder, applyToContext, applyToObserver, decorateBuilder, decorateObserver, getDescriptor, isCategoryEnabledMethods inherited from class jenkins.scm.api.trait.SCMTrait
asSetList, asSetList, find
-
Constructor Details
-
BranchDiscoveryTrait
@DataBoundConstructor public BranchDiscoveryTrait(int strategyId) Constructor for stapler.- Parameters:
strategyId- the strategy id.
-
BranchDiscoveryTrait
public BranchDiscoveryTrait(boolean buildBranch, boolean buildBranchWithPr) Constructor for legacy code.- Parameters:
buildBranch- build branches that are not filed as a PR.buildBranchWithPr- build branches that are also PRs.
-
-
Method Details
-
getStrategyId
public int getStrategyId()Returns the strategy id.- Returns:
- the strategy id.
-
isBuildBranch
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isBuildBranch()Returnstrueif building branches that are not filed as a PR.- Returns:
trueif building branches that are not filed as a PR.
-
isBuildBranchesWithPR
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public boolean isBuildBranchesWithPR()Returnstrueif building branches that are filed as a PR.- Returns:
trueif building branches that are filed as a PR.
-
decorateContext
protected void decorateContext(jenkins.scm.api.trait.SCMSourceContext<?, ?> context) - Overrides:
decorateContextin classjenkins.scm.api.trait.SCMSourceTrait
-
includeCategory
public boolean includeCategory(@NonNull jenkins.scm.api.SCMHeadCategory category) - Overrides:
includeCategoryin classjenkins.scm.api.trait.SCMSourceTrait
-