Package jenkins.scm.api.trait
Class SCMSourceBuilder<B extends SCMSourceBuilder<B,S>,S extends SCMSource>  
java.lang.Object
jenkins.scm.api.trait.SCMSourceBuilder<B,S> 
- Type Parameters:
- B- the type of- SCMSourceBuilderso that subclasses can chain correctly in their- withTrait(SCMSourceTrait)etc methods.
- S- the type of- SCMSourcereturned by- build(). In general this should be a type that has- SCMSourceTraitsupport.
public abstract class SCMSourceBuilder<B extends SCMSourceBuilder<B,S>,S extends SCMSource>  
extends Object
Builder for a 
SCMSource instance. Typically instantiated in
 SCMNavigator.visitSources(SCMSourceObserver) and then decorated by
 SCMNavigatorTrait.applyToBuilder(SCMSourceBuilder) before calling build() to generate the return
 value. Conventions:
 - The builder is not designed to be shared by multiple threads.
- All methods should be either finalorabstractunless there is a documented reason for allowing overrides
- All "setter" methods will return SCMSourceBuilderand be called "withXxx"
- All "getter" methods will be called "xxx()". Callers should not assume that the returned value is resistant
 from concurrent changes. Implementations should ensure that the returned value is immutable by the caller.
 In other words, it is intentional for implementations to reduce intermediate allocations by
 return Collections.unmodifiableList(theList);rather than the concurrency safereturn Collections.unmodifiableList(new ArrayList<>(theList));
SCMTrait instances to the builder, the SCMNavigatorTrait instances will modify the
 builder itself while the SCMSourceTrait instances will be retained to be added to the SCMSource
 during build()- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionabstract Sbuild()Instantiates theSCMSource.final StringReturns the project name.Returns the base class ofSCMSourcethat will be produced by theSCMSourceBuilder.final List<SCMSourceTrait>traits()Returns theSCMSourceTraitinstances to provide to theSCMSource(assuming theSCMSourceisSCMSourceTraitaware.withRequest(SCMNavigatorRequest request) Apply theSCMNavigatorRequestto thisSCMSourceBuilder.final BwithTrait(SCMNavigatorTrait trait) Apply theSCMNavigatorTraitto thisSCMSourceBuilder.final BwithTrait(SCMSourceTrait trait) withTraits(Collection<? extends SCMTrait<?>> traits) Apply theSCMTraitinstances to thisSCMSourceBuilder.final BwithTraits(SCMTrait<? extends SCMTrait<?>>... traits) Apply theSCMTraitinstances to thisSCMSourceBuilder.
- 
Constructor Details- 
SCMSourceBuilderConstructor.- Parameters:
- clazz- the base class of- SCMSourcethat will be produced by the- SCMSourceBuilder.
- projectName- the project name.
 
 
- 
- 
Method Details- 
sourceClassReturns the base class ofSCMSourcethat will be produced by theSCMSourceBuilder.- Returns:
- the base class of SCMSourcethat will be produced by theSCMSourceBuilder.
 
- 
projectNameReturns the project name.- Returns:
- the project name.
 
- 
traitsReturns theSCMSourceTraitinstances to provide to theSCMSource(assuming theSCMSourceisSCMSourceTraitaware.- Returns:
- the SCMSourceTraitinstances to provide to theSCMSource(assuming theSCMSourceisSCMSourceTraitaware.
 
- 
withTrait- Parameters:
- trait- the- SCMSourceTrait.
- Returns:
- thisfor method chaining.
 
- 
withTraitsApply theSCMTraitinstances to thisSCMSourceBuilder.- Parameters:
- traits- the- SCMTraitinstances.
- Returns:
- thisfor method chaining.
 
- 
withTraitsApply theSCMTraitinstances to thisSCMSourceBuilder.- Parameters:
- traits- the- SCMTraitinstances.
- Returns:
- thisfor method chaining.
 
- 
buildInstantiates theSCMSource. The implementation is responsible to ensure that thetraits()are provided to theSCMSource.- Returns:
- the SCMSourceBuilderinstance
 
 
-