|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.sonatype.aether.graph.Dependency
public final class Dependency
A dependency to some artifact. Note: Instances of this class are immutable and the exposed mutators return new objects rather than changing the current instance.
Constructor Summary | |
---|---|
Dependency(Artifact artifact,
String scope)
Creates a mandatory dependency on the specified artifact with the given scope. |
|
Dependency(Artifact artifact,
String scope,
boolean optional)
Creates a dependency on the specified artifact with the given scope. |
|
Dependency(Artifact artifact,
String scope,
boolean optional,
Collection<Exclusion> exclusions)
Creates a dependency on the specified artifact with the given scope and exclusions. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
|
Artifact |
getArtifact()
Gets the artifact being depended on. |
Collection<Exclusion> |
getExclusions()
Gets the exclusions for this dependency. |
String |
getScope()
Gets the scope of the dependency. |
int |
hashCode()
|
boolean |
isOptional()
Indicates whether this dependency is optional or not. |
Dependency |
setArtifact(Artifact artifact)
Sets the artifact being depended on. |
Dependency |
setExclusions(Collection<Exclusion> exclusions)
Sets the exclusions for the dependency. |
Dependency |
setOptional(boolean optional)
Sets the optional flag for the dependency. |
Dependency |
setScope(String scope)
Sets the scope of the dependency, e.g. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Dependency(Artifact artifact, String scope)
artifact
- The artifact being depended on, must not be null
.scope
- The scope of the dependency, may be null
.public Dependency(Artifact artifact, String scope, boolean optional)
artifact
- The artifact being depended on, must not be null
.scope
- The scope of the dependency, may be null
.optional
- A flag whether the dependency is optional or mandatory.public Dependency(Artifact artifact, String scope, boolean optional, Collection<Exclusion> exclusions)
artifact
- The artifact being depended on, must not be null
.scope
- The scope of the dependency, may be null
.optional
- A flag whether the dependency is optional or mandatory.exclusions
- The exclusions that apply to transitive dependencies, may be null
if none.Method Detail |
---|
public Artifact getArtifact()
null
.public Dependency setArtifact(Artifact artifact)
artifact
- The artifact, must not be null
.
null
.public String getScope()
null
.public Dependency setScope(String scope)
scope
- The scope of the dependency, may be null
.
null
.public boolean isOptional()
true
if the dependency is optional, false
otherwise.public Dependency setOptional(boolean optional)
optional
- true
if the dependency is optional, false
if the dependency is mandatory.
null
.public Collection<Exclusion> getExclusions()
null
.public Dependency setExclusions(Collection<Exclusion> exclusions)
exclusions
- The exclusions, may be null
.
null
.public String toString()
toString
in class Object
public boolean equals(Object obj)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |