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
<dependencyManagement with no scope associated) |
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
- A coordinate
Delegate, requiredscope
- A scopeoptional
- Whether or not this MavenDependency
has been marked as 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
- A coordinate
Delegate, requiredscope
- A scopeoptional
- Whether or not this MavenDependency
has been marked as optional.undeclaredScope
- Whether there is no scopeexclusions
- MavenDependencyExclusion
s, if null
will be ignoredpublic String getGroupId()
org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenGABaseImpl#getGroupId()
public String toCanonicalForm()
Coordinate
Coordinate
Coordinate.toCanonicalForm()
public String getArtifactId()
org.jboss.shrinkwrap.resolver.api.maven.coordinate.MavenGABaseImpl#getArtifactId()
public PackagingType getPackaging()
PackagingType.JAR
.getPackaging
in interface MavenCoordinate
MavenCoordinate.getPackaging()
public PackagingType getType()
MavenCoordinate.getPackaging()
.getType
in interface MavenCoordinate
MavenCoordinate.getType()
public String getClassifier()
getClassifier
in interface MavenCoordinate
MavenCoordinate.getClassifier()
public String getVersion()
MavenArtifactInfo.getResolvedVersion()
.getVersion
in interface MavenCoordinate
null
.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
in an immutable, read-only view.
An empty Set
if no exclusions are defined.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
. The default ScopeType.COMPILE
if no scope has been
explicitly-defined. Never returns null.MavenDependency.getScope()
public boolean isOptional()
MavenDependency
has been marked as optional; defaults to
false
isOptional
in interface MavenDependency
MavenDependency
has been marked as optional. Defaults to false
MavenDependency.isOptional()
public boolean isUndeclaredScope()
<dependencyManagement
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 © 2022 JBoss by Red Hat. All rights reserved.