Class RefSpecsSCMSourceTrait

java.lang.Object
hudson.model.AbstractDescribableImpl<T>
jenkins.scm.api.trait.SCMTrait<jenkins.scm.api.trait.SCMSourceTrait>
jenkins.scm.api.trait.SCMSourceTrait
jenkins.plugins.git.traits.RefSpecsSCMSourceTrait
All Implemented Interfaces:
ExtensionPoint, Describable<jenkins.scm.api.trait.SCMSourceTrait>

public class RefSpecsSCMSourceTrait extends jenkins.scm.api.trait.SCMSourceTrait
Exposes the ref specs of a AbstractGitSCMSource as a SCMSourceTrait. The ref specs are stored as templates which are intended to be realised by applying String.replaceAll(String, String) with the AbstractGitSCMSource.REF_SPEC_REMOTE_NAME_PLACEHOLDER pattern to inject the remote name (which should default to AbstractGitSCMSource.DEFAULT_REMOTE_NAME
Since:
3.4.0
  • Constructor Details

    • RefSpecsSCMSourceTrait

      @DataBoundConstructor public RefSpecsSCMSourceTrait(@CheckForNull List<RefSpecsSCMSourceTrait.RefSpecTemplate> templates)
      Stapler constructor.
      Parameters:
      templates - the templates.
    • RefSpecsSCMSourceTrait

      public RefSpecsSCMSourceTrait(String... templates)
      Utility constructor.
      Parameters:
      templates - the template strings.
  • Method Details

    • getTemplates

      @NonNull public List<RefSpecsSCMSourceTrait.RefSpecTemplate> getTemplates()
      Gets the templates.
      Returns:
      the templates.
    • asStrings

      public List<String> asStrings()
      Unwraps the templates.
      Returns:
      the templates.
    • decorateContext

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

      protected void decorateBuilder(jenkins.scm.api.trait.SCMBuilder<?,?> builder)
      Overrides:
      decorateBuilder in class jenkins.scm.api.trait.SCMSourceTrait