Class SCMSourceDecorator<B extends SCMSourceBuilder<B,S>,S extends SCMSource>

java.lang.Object
jenkins.scm.api.trait.SCMSourceDecorator<B,S>
Type Parameters:
B - the type of SCMSourceBuilder.
S - the type of SCMSource.

public abstract class SCMSourceDecorator<B extends SCMSourceBuilder<B,S>,S extends SCMSource> extends Object
A contextual decorator of SCMSourceBuilder instances that can be used by a SCMNavigatorTrait for example to apply SCMSourceTraits to a subset of projects.
  • Constructor Details

    • SCMSourceDecorator

      protected SCMSourceDecorator()
      Infers the type of the corresponding SCMSourceBuilder from the type parameters of the implementation class. If the inference fails use SCMSourceDecorator(Class).
    • SCMSourceDecorator

      protected SCMSourceDecorator(Class<B> builderClass)
      Bypasses SCMSourceBuilder type inference and specifies the type explicitly.
      Parameters:
      builderClass - the specialization of SCMSourceBuilder that this decorator applies to.
  • Method Details

    • applyTo

      public final void applyTo(SCMSourceBuilder<?,?> builder, String projectName)
      Applies this decorator to the specified SCMSourceBuilder for the supplied project name. If this SCMSourceDecorator is not specialized for the type of SCMSourceBuilder then this will be a no-op.
      Parameters:
      builder - the SCMSourceBuilder.
      projectName - the project name.
    • decorate

      protected abstract void decorate(B builder, String projectName)
      SPI: decorate the supplied builder for creation of the named project.
      Parameters:
      builder - the builder to decorate.
      projectName - the project name.