Class ConflictResolver.ConflictItem
- java.lang.Object
-
- org.eclipse.aether.util.graph.transformer.ConflictResolver.ConflictItem
-
- Enclosing class:
- ConflictResolver
public static final class ConflictResolver.ConflictItem extends java.lang.ObjectA conflicting dependency.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Artifactartifact(package private) intdepth(package private) DependencyNodenodestatic intOPTIONAL_FALSEBit flag indicating whether one or more paths consider the dependency non-optional.static intOPTIONAL_TRUEBit flag indicating whether one or more paths consider the dependency optional.(package private) intoptionalities(package private) java.util.List<DependencyNode>parent(package private) java.lang.Objectscopes
-
Constructor Summary
Constructors Constructor Description ConflictItem(DependencyNode parent, DependencyNode node, int depth, int optionalities, java.lang.String... scopes)Creates a new conflict item with the specified properties.ConflictItem(DependencyNode parent, DependencyNode node, java.lang.String scope, boolean optional)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddOptional(boolean optional)(package private) voidaddScope(java.lang.String scope)DependencygetDependency()Gets the dependency involved in the conflict, short forgetNode.getDependency().intgetDepth()Gets the zero-based depth at which the conflicting node occurs in the graph.DependencyNodegetNode()Gets the dependency node involved in the conflict.intgetOptionalities()Gets the derived optionalities of the dependency.java.util.Collection<java.lang.String>getScopes()Gets the derived scopes of the dependency.booleanisSibling(ConflictResolver.ConflictItem item)Determines whether the specified conflict item is a sibling of this item.java.lang.StringtoString()
-
-
-
Field Detail
-
parent
final java.util.List<DependencyNode> parent
-
artifact
final Artifact artifact
-
node
final DependencyNode node
-
depth
int depth
-
scopes
java.lang.Object scopes
-
optionalities
int optionalities
-
OPTIONAL_FALSE
public static final int OPTIONAL_FALSE
Bit flag indicating whether one or more paths consider the dependency non-optional.- See Also:
- Constant Field Values
-
OPTIONAL_TRUE
public static final int OPTIONAL_TRUE
Bit flag indicating whether one or more paths consider the dependency optional.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConflictItem
ConflictItem(DependencyNode parent, DependencyNode node, java.lang.String scope, boolean optional)
-
ConflictItem
public ConflictItem(DependencyNode parent, DependencyNode node, int depth, int optionalities, java.lang.String... scopes)
Creates a new conflict item with the specified properties.- Parameters:
parent- The parent node of the conflicting dependency, may benull.node- The conflicting dependency, must not benull.depth- The zero-based depth of the conflicting dependency.optionalities- The optionalities the dependency was encountered with, encoded as a bit field consisting ofOPTIONAL_TRUEandOPTIONAL_FALSE.scopes- The derived scopes of the conflicting dependency, must not benull.
-
-
Method Detail
-
isSibling
public boolean isSibling(ConflictResolver.ConflictItem item)
Determines whether the specified conflict item is a sibling of this item.- Parameters:
item- The other conflict item, must not benull.- Returns:
trueif the given item has the same parent as this item,falseotherwise.
-
getNode
public DependencyNode getNode()
Gets the dependency node involved in the conflict.- Returns:
- The involved dependency node, never
null.
-
getDependency
public Dependency getDependency()
Gets the dependency involved in the conflict, short forgetNode.getDependency().- Returns:
- The involved dependency, never
null.
-
getDepth
public int getDepth()
Gets the zero-based depth at which the conflicting node occurs in the graph. As such, the depth denotes the number of parent nodes. If actually multiple paths lead to the node, the return value denotes the smallest possible depth.- Returns:
- The zero-based depth of the node in the graph.
-
getScopes
public java.util.Collection<java.lang.String> getScopes()
Gets the derived scopes of the dependency. In general, the same dependency node could be reached via different paths and each path might result in a different derived scope.- Returns:
- The (read-only) set of derived scopes of the dependency, never
null. - See Also:
ConflictResolver.ScopeDeriver
-
addScope
void addScope(java.lang.String scope)
-
getOptionalities
public int getOptionalities()
Gets the derived optionalities of the dependency. In general, the same dependency node could be reached via different paths and each path might result in a different derived optionality.- Returns:
- A bit field consisting of
OPTIONAL_FALSEand/orOPTIONAL_TRUEindicating the derived optionalities the dependency was encountered with.
-
addOptional
void addOptional(boolean optional)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-