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 ofSCMSourceBuilder
instances that can be used by aSCMNavigatorTrait
for example to applySCMSourceTrait
s to a subset of projects.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SCMSourceDecorator()
Infers the type of the correspondingSCMSourceBuilder
from the type parameters of the implementation class.protected
SCMSourceDecorator(Class<B> builderClass)
BypassesSCMSourceBuilder
type inference and specifies the type explicitly.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
applyTo(SCMSourceBuilder<?,?> builder, String projectName)
Applies this decorator to the specifiedSCMSourceBuilder
for the supplied project name.protected abstract void
decorate(B builder, String projectName)
SPI: decorate the supplied builder for creation of the named project.
-
-
-
Constructor Detail
-
SCMSourceDecorator
protected SCMSourceDecorator()
Infers the type of the correspondingSCMSourceBuilder
from the type parameters of the implementation class. If the inference fails useSCMSourceDecorator(Class)
.
-
SCMSourceDecorator
protected SCMSourceDecorator(Class<B> builderClass)
BypassesSCMSourceBuilder
type inference and specifies the type explicitly.- Parameters:
builderClass
- the specialization ofSCMSourceBuilder
that this decorator applies to.
-
-
Method Detail
-
applyTo
public final void applyTo(SCMSourceBuilder<?,?> builder, String projectName)
Applies this decorator to the specifiedSCMSourceBuilder
for the supplied project name. If thisSCMSourceDecorator
is not specialized for the type ofSCMSourceBuilder
then this will be a no-op.- Parameters:
builder
- theSCMSourceBuilder
.projectName
- the project name.
-
-