Interface ConfigurableVersionSelector.SelectionStrategy
- All Known Implementing Classes:
ConfigurableVersionSelector.Highest
,ConfigurableVersionSelector.MajorVersionConvergence
,ConfigurableVersionSelector.Nearest
,ConfigurableVersionSelector.VersionConvergence
- Enclosing class:
ConfigurableVersionSelector
public static interface ConfigurableVersionSelector.SelectionStrategy
The strategy how "winner" is being selected.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
isBetter
(ConflictResolver.ConflictItem candidate, ConflictResolver.ConflictItem winner) Invoked for every "candidate" when winner is already set (very first candidate is set as winner).default ConflictResolver.ConflictItem
winnerSelected
(ConflictResolver.ConflictItem winner, Collection<ConflictResolver.ConflictItem> candidates, ConflictResolver.ConflictContext context) Method invoked at version selection end, just before version selector returns.
-
Method Details
-
isBetter
Invoked for every "candidate" when winner is already set (very first candidate is set as winner).This method should determine is candidate "better" or not and should replace current winner. This method is invoked whenever
candidate
is "considered" (fits any constraint in effect, if any). -
winnerSelected
default ConflictResolver.ConflictItem winnerSelected(ConflictResolver.ConflictItem winner, Collection<ConflictResolver.ConflictItem> candidates, ConflictResolver.ConflictContext context) throws UnsolvableVersionConflictException Method invoked at version selection end, just before version selector returns. Note:winner
may benull
, while the rest of parameters cannot. The parametercandidates
contains all the "considered candidates", dependencies that fulfil all constraints, if present. Thecontext
on the other hand contains all items participating in conflict.This method by default just returns the passed in
winner
, but can do much more.
-