Class ConflictResolver.ConflictContext
java.lang.Object
org.eclipse.aether.util.graph.transformer.ConflictResolver.ConflictContext
- Enclosing class:
- ConflictResolver
A context used to hold information that is relevant for resolving version and scope conflicts.
- See Also:
- Restriction:
- This class is not intended to be instantiated by clients in production code, the constructor may change without notice and only exists to enable unit testing.
-
Constructor Summary
ConstructorDescriptionConflictContext
(DependencyNode root, Object conflictId, Map<DependencyNode, Object> conflictIds, Collection<ConflictResolver.ConflictItem> items) Creates a new conflict context. -
Method Summary
Modifier and TypeMethodDescriptiongetItems()
Gets the collection of conflict items in this context.Gets the effective optional flag of the winning dependency.getRoot()
Gets the root node of the dependency graph being transformed.getScope()
Gets the effective scope of the winning dependency.Gets the conflict item which has been selected as the winner among the conflicting dependencies.boolean
isIncluded
(DependencyNode node) Determines whether the specified dependency node belongs to this conflict context.void
setOptional
(Boolean optional) Sets the effective optional flag of the winning dependency.void
Sets the effective scope of the winning dependency.void
Sets the conflict item which has been selected as the winner among the conflicting dependencies.toString()
-
Constructor Details
-
ConflictContext
public ConflictContext(DependencyNode root, Object conflictId, Map<DependencyNode, Object> conflictIds, Collection<ConflictResolver.ConflictItem> items) Creates a new conflict context.- Parameters:
root
- The root node of the dependency graph, must not benull
.conflictId
- The conflict id for the set of conflicting dependencies in this context, must not benull
.conflictIds
- The mapping from dependency node to conflict id, must not benull
.items
- The conflict items in this context, must not benull
.- Restriction:
- This class is not intended to be instantiated by clients in production code, the constructor may change without notice and only exists to enable unit testing.
-
-
Method Details
-
getRoot
Gets the root node of the dependency graph being transformed.- Returns:
- The root node of the dependeny graph, never
null
.
-
isIncluded
Determines whether the specified dependency node belongs to this conflict context.- Parameters:
node
- The dependency node to check, must not benull
.- Returns:
true
if the given node belongs to this conflict context,false
otherwise.
-
getItems
Gets the collection of conflict items in this context.- Returns:
- The (read-only) collection of conflict items in this context, never
null
.
-
getWinner
Gets the conflict item which has been selected as the winner among the conflicting dependencies.- Returns:
- The winning conflict item or
null
if not set yet.
-
setWinner
Sets the conflict item which has been selected as the winner among the conflicting dependencies.- Parameters:
winner
- The winning conflict item, may benull
.
-
getScope
Gets the effective scope of the winning dependency.- Returns:
- The effective scope of the winning dependency or
null
if none.
-
setScope
Sets the effective scope of the winning dependency.- Parameters:
scope
- The effective scope, may benull
.
-
getOptional
Gets the effective optional flag of the winning dependency.- Returns:
- The effective optional flag or
null
if none.
-
setOptional
Sets the effective optional flag of the winning dependency.- Parameters:
optional
- The effective optional flag, may benull
.
-
toString
-