Class BranchDiscoveryTrait

  • All Implemented Interfaces:
    Describable<jenkins.scm.api.trait.SCMSourceTrait>

    public class BranchDiscoveryTrait
    extends jenkins.scm.api.trait.SCMSourceTrait
    A Discovery trait for GitHub that will discover branches on the repository.
    Since:
    2.2.0
    • Constructor Detail

      • 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 Detail

      • getStrategyId

        public int getStrategyId()
        Returns the strategy id.
        Returns:
        the strategy id.
      • isBuildBranch

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public boolean isBuildBranch()
        Returns true if building branches that are not filed as a PR.
        Returns:
        true if building branches that are not filed as a PR.
      • isBuildBranchesWithPR

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        public boolean isBuildBranchesWithPR()
        Returns true if building branches that are filed as a PR.
        Returns:
        true if building branches that are filed as a PR.
      • decorateContext

        protected void decorateContext​(jenkins.scm.api.trait.SCMSourceContext<?,​?> context)
        Overrides:
        decorateContext in class jenkins.scm.api.trait.SCMSourceTrait
      • includeCategory

        public boolean includeCategory​(@NonNull
                                       jenkins.scm.api.SCMHeadCategory category)
        Overrides:
        includeCategory in class jenkins.scm.api.trait.SCMSourceTrait