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 SCMSourceTrait
s to a subset of projects.-
Constructor Summary
ModifierConstructorDescriptionprotected
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
Modifier and TypeMethodDescriptionfinal void
applyTo
(SCMSourceBuilder<?, ?> builder, String projectName) Applies this decorator to the specifiedSCMSourceBuilder
for the supplied project name.protected abstract void
SPI: decorate the supplied builder for creation of the named project.
-
Constructor Details
-
SCMSourceDecorator
protected SCMSourceDecorator()Infers the type of the correspondingSCMSourceBuilder
from the type parameters of the implementation class. If the inference fails useSCMSourceDecorator(Class)
. -
SCMSourceDecorator
BypassesSCMSourceBuilder
type inference and specifies the type explicitly.- Parameters:
builderClass
- the specialization ofSCMSourceBuilder
that this decorator applies to.
-
-
Method Details
-
applyTo
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.
-
decorate
SPI: decorate the supplied builder for creation of the named project.- Parameters:
builder
- the builder to decorate.projectName
- the project name.
-