C
- the type of SCMNavigatorContext
R
- the type of SCMNavigatorRequest
produced by this context.public abstract class SCMNavigatorContext<C extends SCMNavigatorContext<C,R>,R extends SCMNavigatorRequest> extends Object
SCMNavigator
is processing requests. In general this is used as a
builder for SCMNavigatorRequest
instances through
newRequest(SCMNavigator, SCMSourceObserver)
but there are some cases (such as
SCMSourceEvent
processing) where only the context is required and as such this
type will be instantiated to obtain the context but no SCMNavigatorRequest
will be created.
Conventions:
final
or abstract
unless there is a documented reason for
allowing overridesC
and be called "withXxx"return Collections.unmodifiableList(theList);
rather than the concurrency safe
return Collections.unmodifiableList(new ArrayList<>(theList));
Constructor and Description |
---|
SCMNavigatorContext()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
List<SCMSourceDecorator<?,?>> |
decorators()
Returns the (possibly empty) list of
SCMSourceDecorator instances to apply to discovered projects. |
List<SCMSourceFilter> |
filters()
Returns the (possibly empty) list of
SCMNavigatorRequest dependent filters. |
abstract R |
newRequest(SCMNavigator navigator,
SCMSourceObserver observer)
Creates a new
SCMNavigatorRequest . |
List<SCMSourcePrefilter> |
prefilters()
Returns the (possibly empty) list of
SCMNavigatorRequest independent pre-filters. |
List<SCMSourceTrait> |
traits()
Returns the (possibly empty) list of
SCMSourceTrait instances to apply to discovered projects. |
C |
withDecorator(SCMSourceDecorator<?,?> decorator)
Adds the supplied
SCMSourceDecorator . |
C |
withDecorators(Collection<? extends SCMSourceDecorator<?,?>> decorators)
Adds the supplied
SCMSourceDecorator instances. |
C |
withDecorators(SCMSourceDecorator<?,?>... decorators)
Adds the supplied
SCMSourceDecorator instances. |
C |
withFilter(SCMSourceFilter filter)
Adds the supplied
SCMSourceFilter . |
C |
withPrefilter(SCMSourcePrefilter prefilter)
Adds the supplied
SCMSourcePrefilter . |
C |
withTrait(SCMNavigatorTrait trait)
Applies the supplied
SCMNavigatorTrait . |
C |
withTrait(SCMSourceTrait trait)
Adds the supplied
SCMSourceTrait . |
C |
withTraits(Collection<? extends SCMTrait<?>> traits)
Adds / applies the supplied
SCMTrait . |
C |
withTraits(SCMTrait<? extends SCMTrait<?>>... traits)
Adds / applies the supplied
SCMTrait . |
@NonNull public final List<SCMSourceDecorator<?,?>> decorators()
SCMSourceDecorator
instances to apply to discovered projects.SCMSourceDecorator
instances to apply to discovered projects.@NonNull public final List<SCMSourceFilter> filters()
SCMNavigatorRequest
dependent filters.SCMNavigatorRequest
dependent filters.@NonNull public final List<SCMSourcePrefilter> prefilters()
SCMNavigatorRequest
independent pre-filters.SCMNavigatorRequest
independent pre-filters.@NonNull public final List<SCMSourceTrait> traits()
SCMSourceTrait
instances to apply to discovered projects.SCMSourceTrait
instances to apply to discovered projects.@NonNull public final C withFilter(@CheckForNull SCMSourceFilter filter)
SCMSourceFilter
.filter
- the additional SCMSourceFilter
.this
for method chaining.@NonNull public final C withPrefilter(@CheckForNull SCMSourcePrefilter prefilter)
SCMSourcePrefilter
.prefilter
- the additional SCMSourcePrefilter
.this
for method chaining.@NonNull public final C withTrait(@NonNull SCMNavigatorTrait trait)
SCMNavigatorTrait
.trait
- the additional SCMNavigatorTrait
.this
for method chaining.@NonNull public final C withTrait(@NonNull SCMSourceTrait trait)
SCMSourceTrait
.trait
- the additional SCMSourceTrait
.this
for method chaining.@NonNull public final C withTraits(@NonNull SCMTrait<? extends SCMTrait<?>>... traits)
SCMTrait
.traits
- the additional SCMTrait
instances.this
for method chaining.@NonNull public final C withTraits(@NonNull Collection<? extends SCMTrait<?>> traits)
SCMTrait
.traits
- the additional SCMTrait
instances.this
for method chaining.@NonNull public final C withDecorator(@NonNull SCMSourceDecorator<?,?> decorator)
SCMSourceDecorator
.decorator
- the additional SCMSourceDecorator
.this
for method chaining.@NonNull public final C withDecorators(@NonNull SCMSourceDecorator<?,?>... decorators)
SCMSourceDecorator
instances.decorators
- the additional SCMSourceDecorator
instances.this
for method chaining.@NonNull public final C withDecorators(@NonNull Collection<? extends SCMSourceDecorator<?,?>> decorators)
SCMSourceDecorator
instances.decorators
- the additional SCMSourceDecorator
instances.this
for method chaining.@NonNull public abstract R newRequest(@NonNull SCMNavigator navigator, @NonNull SCMSourceObserver observer)
SCMNavigatorRequest
.navigator
- the SCMNavigator
.observer
- the SCMSourceObserver
.R
Copyright © 2016–2022. All rights reserved.