Package org.eclipse.aether.graph
Class Dependency
java.lang.Object
org.eclipse.aether.graph.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 SummaryConstructorsConstructorDescriptionDependency(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 SummaryModifier and TypeMethodDescriptionbooleanGets the artifact being depended on.Gets the exclusions for this dependency.Gets the optional flag for the dependency.getScope()Gets the scope of the dependency.inthashCode()booleanIndicates whether this dependency is optional or not.setArtifact(Artifact artifact) Sets the artifact being depended on.setExclusions(Collection<Exclusion> exclusions) Sets the exclusions for the dependency.setOptional(Boolean optional) Sets the optional flag for the dependency.Sets the scope of the dependency, e.g.toString()
- 
Constructor Details- 
DependencyCreates a mandatory dependency on the specified artifact with the given scope.- Parameters:
- artifact- The artifact being depended on, must not be- null.
- scope- The scope of the dependency, may be- null.
 
- 
DependencyCreates a dependency on the specified artifact with the given scope.- Parameters:
- 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, may be- null.
 
- 
Dependencypublic Dependency(Artifact artifact, String scope, Boolean optional, Collection<Exclusion> exclusions) Creates a dependency on the specified artifact with the given scope and exclusions.- Parameters:
- 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, may be- null.
- exclusions- The exclusions that apply to transitive dependencies, may be- nullif none.
 
 
- 
- 
Method Details- 
getArtifactGets the artifact being depended on.- Returns:
- The artifact, never null.
 
- 
setArtifactSets the artifact being depended on.- Parameters:
- artifact- The artifact, must not be- null.
- Returns:
- The new dependency, never null.
 
- 
getScopeGets the scope of the dependency. The scope defines in which context this dependency is relevant.- Returns:
- The scope or an empty string if not set, never null.
 
- 
setScopeSets the scope of the dependency, e.g. "compile".- Parameters:
- scope- The scope of the dependency, may be- null.
- Returns:
- The new dependency, never null.
 
- 
isOptionalIndicates whether this dependency is optional or not. Optional dependencies can be ignored in some contexts.- Returns:
- trueif the dependency is (definitively) optional,- falseotherwise.
 
- 
getOptionalGets the optional flag for the dependency. Note: Most clients will usually callisOptional()to determine the optional flag, this method is for advanced use cases where three-valued logic is required.- Returns:
- The optional flag or nullif unspecified.
 
- 
setOptionalSets the optional flag for the dependency.- Parameters:
- optional-- trueif the dependency is optional,- falseif the dependency is mandatory, may be- nullif unspecified.
- Returns:
- The new dependency, never null.
 
- 
getExclusionsGets the exclusions for this dependency. Exclusions can be used to remove transitive dependencies during resolution.- Returns:
- The (read-only) exclusions, never null.
 
- 
setExclusionsSets the exclusions for the dependency.- Parameters:
- exclusions- The exclusions, may be- null.
- Returns:
- The new dependency, never null.
 
- 
toString
- 
equals
- 
hashCode
 
-