public final class ScopeDependencySelector extends java.lang.Object implements DependencySelector
Dependency.getScope()
Modifier and Type | Field and Description |
---|---|
private java.util.Collection<java.lang.String> |
excluded |
private java.util.Collection<java.lang.String> |
included |
private boolean |
transitive |
Modifier | Constructor and Description |
---|---|
private |
ScopeDependencySelector(boolean transitive,
java.util.Collection<java.lang.String> included,
java.util.Collection<java.lang.String> excluded) |
|
ScopeDependencySelector(java.util.Collection<java.lang.String> included,
java.util.Collection<java.lang.String> excluded)
Creates a new selector using the specified includes and excludes.
|
|
ScopeDependencySelector(java.lang.String... excluded)
Creates a new selector using the specified excludes.
|
Modifier and Type | Method and Description |
---|---|
private static java.util.Collection<java.lang.String> |
clone(java.util.Collection<java.lang.String> scopes) |
DependencySelector |
deriveChildSelector(DependencyCollectionContext context)
Derives a dependency selector for the specified collection context.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
selectDependency(Dependency dependency)
Decides whether the specified dependency should be included in the dependency graph.
|
java.lang.String |
toString() |
private final boolean transitive
private final java.util.Collection<java.lang.String> included
private final java.util.Collection<java.lang.String> excluded
public ScopeDependencySelector(java.util.Collection<java.lang.String> included, java.util.Collection<java.lang.String> excluded)
included
- The set of scopes to include, may be null
or empty to include any scope.excluded
- The set of scopes to exclude, may be null
or empty to exclude no scope.public ScopeDependencySelector(java.lang.String... excluded)
excluded
- The set of scopes to exclude, may be null
or empty to exclude no scope.private ScopeDependencySelector(boolean transitive, java.util.Collection<java.lang.String> included, java.util.Collection<java.lang.String> excluded)
private static java.util.Collection<java.lang.String> clone(java.util.Collection<java.lang.String> scopes)
public boolean selectDependency(Dependency dependency)
DependencySelector
selectDependency
in interface DependencySelector
dependency
- The dependency to check, must not be null
.false
if the dependency should be excluded from the children of the current node, true
otherwise.public DependencySelector deriveChildSelector(DependencyCollectionContext context)
DependencySelector
deriveChildSelector
in interface DependencySelector
context
- The dependency collection context, must not be null
.null
if dependencies should be unconditionally
included in the sub graph.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object