Package jenkins.scm.api.trait
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 ofSCMSourceBuilder.S- the type ofSCMSource.
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 Summary
ConstructorsModifierConstructorDescriptionprotectedInfers the type of the correspondingSCMSourceBuilderfrom the type parameters of the implementation class.protectedSCMSourceDecorator(Class<B> builderClass) BypassesSCMSourceBuildertype inference and specifies the type explicitly. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidapplyTo(SCMSourceBuilder<?, ?> builder, String projectName) Applies this decorator to the specifiedSCMSourceBuilderfor the supplied project name.protected abstract voidSPI: decorate the supplied builder for creation of the named project.
-
Constructor Details
-
SCMSourceDecorator
protected SCMSourceDecorator()Infers the type of the correspondingSCMSourceBuilderfrom the type parameters of the implementation class. If the inference fails useSCMSourceDecorator(Class). -
SCMSourceDecorator
BypassesSCMSourceBuildertype inference and specifies the type explicitly.- Parameters:
builderClass- the specialization ofSCMSourceBuilderthat this decorator applies to.
-
-
Method Details
-
applyTo
Applies this decorator to the specifiedSCMSourceBuilderfor the supplied project name. If thisSCMSourceDecoratoris not specialized for the type ofSCMSourceBuilderthen this will be a no-op.- Parameters:
builder- theSCMSourceBuilder.projectName- the project name.
-
decorate
SPI: decorate the supplied builder for creation of the named project.- Parameters:
builder- the builder to decorate.projectName- the project name.
-