public final class MavenDependencyImpl extends Object implements MavenDependencySPI
MavenDependency
Constructor and Description |
---|
MavenDependencyImpl(MavenCoordinate coordinate,
ScopeType scope,
boolean optional,
boolean undeclaredScope,
MavenDependencyExclusion... exclusions)
Creates a new instance with the specified properties.
|
MavenDependencyImpl(MavenCoordinate coordinate,
ScopeType scope,
boolean optional,
MavenDependencyExclusion... exclusions)
Creates a new instance with the specified properties.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Determines whether two
MavenCoordinate instances are equal by value; all fields are considered except
for version |
String |
getArtifactId()
Returns the "artifactId" portion of this artifact's coordinates
|
String |
getClassifier()
Returns the "classifier" portion of this artifact's coordinates.
|
Set<MavenDependencyExclusion> |
getExclusions()
Returns the exclusions defined for this
MavenDependency in an immutable, read-only view. |
String |
getGroupId()
Returns the "groupId" portion of this artifact's coordinates
|
PackagingType |
getPackaging()
Returns the "packaging" portion of this artifact's coordinates; always returns a value.
|
ScopeType |
getScope()
Returns the scope for this
MavenDependency . |
PackagingType |
getType()
Alias to
MavenCoordinate.getPackaging() . |
String |
getVersion()
Returns the declared "version" portion of this artifact's coordinates, for instance "1.2.0-alpha-2" or
"1.2.0-SNAPSHOT".
|
int |
hashCode() |
boolean |
isOptional()
Returns whether or not this
MavenDependency has been marked as optional; defaults to
false |
boolean |
isUndeclaredScope()
Denotes that the scope defined here should be treated as undeclared (as brought in via
|
String |
toCanonicalForm()
Returns the canonical form of this
Coordinate |
String |
toString() |
public MavenDependencyImpl(MavenCoordinate coordinate, ScopeType scope, boolean optional, MavenDependencyExclusion... exclusions)
ScopeType
is specified, default will be
ScopeType.COMPILE
. undeclaredScope
will be set to false
coordinate
- Delegate, requiredscope
- optional
- exclusions
- MavenDependencyExclusion
s, if null
will be ignoredpublic MavenDependencyImpl(MavenCoordinate coordinate, ScopeType scope, boolean optional, boolean undeclaredScope, MavenDependencyExclusion... exclusions)
ScopeType
is specified, default will be
ScopeType.COMPILE
.coordinate
- Delegate, requiredscope
- optional
- undeclaredScope
- exclusions
- MavenDependencyExclusion
s, if null
will be ignoredpublic String getGroupId()
MavenGABase.getGroupId()
public String toCanonicalForm()
Coordinate
Coordinate
Coordinate.toCanonicalForm()
public String getArtifactId()
MavenGABase.getArtifactId()
public PackagingType getPackaging()
MavenCoordinate
PackagingType.JAR
.getPackaging
in interface MavenCoordinate
MavenCoordinate.getPackaging()
public PackagingType getType()
MavenCoordinate
MavenCoordinate.getPackaging()
.getType
in interface MavenCoordinate
MavenCoordinate.getType()
public String getClassifier()
MavenCoordinate
getClassifier
in interface MavenCoordinate
MavenCoordinate.getClassifier()
public String getVersion()
MavenCoordinate
MavenArtifactInfo.getResolvedVersion()
.getVersion
in interface MavenCoordinate
MavenCoordinate.getVersion()
public Set<MavenDependencyExclusion> getExclusions()
MavenDependency
in an immutable, read-only view. If no
exclusions are defined, an empty Set
will be returned.getExclusions
in interface MavenDependency
MavenDependency.getExclusions()
public ScopeType getScope()
MavenDependency
. Never returns null; if no scope has been
explicitly-defined, the default ScopeType.COMPILE
will be returned.getScope
in interface MavenDependency
MavenDependency.getScope()
public boolean isOptional()
MavenDependency
has been marked as optional; defaults to
false
isOptional
in interface MavenDependency
MavenDependency.isOptional()
public boolean isUndeclaredScope()
with no scope associated)
isUndeclaredScope
in interface MavenDependencySPI
MavenDependencySPI.isUndeclaredScope()
public int hashCode()
hashCode
in interface MavenCoordinate
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
MavenCoordinate
instances are equal by value; all fields are considered except
for version
equals
in interface MavenCoordinate
equals
in class Object
Object.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
Copyright © 2013 JBoss by Red Hat. All rights reserved.