public final class JkScope
extends java.lang.Object
implements java.io.Serializable
Junit
library may only be necessary for
testing, so we can declare that
Junit is only necessary for scope TEST
.
Similar to Maven scope
or Ivy configuration
.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.util.List<JkScope> |
getAncestorScopes()
Returns scopes this scope inherits from.
|
java.util.List<JkScope> |
getCommonScopes(java.util.Collection<JkScope> scopes)
Returns this scope or its first ancestors found present in the specified scopes.
|
java.lang.String |
getDescription()
Human description for the purpose of this scope, can be
null . |
java.util.Set<JkScope> |
getExtendedScopes()
Scopes that are extended by this one.
|
static java.util.Set<JkScope> |
getInvolvedScopes(java.lang.Iterable<JkScope> scopes)
returns all specified scopes and all of their ancestors.
|
java.lang.String |
getName()
Returns the name of this scope.
|
int |
hashCode() |
boolean |
isExtending(JkScope jkScope)
Returns
true if this scope extends the specified one. |
boolean |
isInOrIsExtendingAnyOf(java.lang.Iterable<? extends JkScope> scopes)
Returns
true if this scope is one or is extending any of the specified scopes. |
boolean |
isInOrIsExtendingAnyOf(JkScope... scopes) |
boolean |
isTransitive()
Returns
true if the dependencies defined with this scope should be resolved recursively
(meaning returning the dependencies of the dependencies and so on) |
JkScopeMapping |
mapTo(java.lang.String... targetScopes)
Returns a
JkScopeMapping from this JkScope to the specified one. |
static JkScope |
of(java.lang.String name)
Creates a new
JkScope passing its name. |
static JkScope |
of(java.lang.String name,
java.lang.String description,
boolean transitive,
JkScope... extending) |
java.lang.String |
toString() |
public static JkScope of(java.lang.String name, java.lang.String description, boolean transitive, JkScope... extending)
public java.lang.String getName()
public java.lang.String getDescription()
null
.public java.util.Set<JkScope> getExtendedScopes()
public boolean isTransitive()
true
if the dependencies defined with this scope should be resolved recursively
(meaning returning the dependencies of the dependencies and so on)public java.util.List<JkScope> getAncestorScopes()
public java.util.List<JkScope> getCommonScopes(java.util.Collection<JkScope> scopes)
public boolean isExtending(JkScope jkScope)
true
if this scope extends the specified one.public JkScopeMapping mapTo(java.lang.String... targetScopes)
JkScopeMapping
from this JkScope
to the specified one.public boolean isInOrIsExtendingAnyOf(java.lang.Iterable<? extends JkScope> scopes)
true
if this scope is one or is extending any of the specified scopes.public boolean isInOrIsExtendingAnyOf(JkScope... scopes)
isInOrIsExtendingAnyOf(Iterable)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object