mirror of https://github.com/apache/maven.git
o Overriding hashCode() and equals().
git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163306 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3143fbd731
commit
2520812edf
|
@ -122,11 +122,6 @@ public class DefaultArtifact
|
|||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return getId();
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return getGroupId() + ":" +
|
||||
|
@ -141,4 +136,28 @@ public class DefaultArtifact
|
|||
getArtifactId() + ":" +
|
||||
getType();
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Object overrides
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return getId();
|
||||
}
|
||||
|
||||
public int hashCode()
|
||||
{
|
||||
return getId().hashCode();
|
||||
}
|
||||
|
||||
public boolean equals( Object o )
|
||||
{
|
||||
Artifact other = (Artifact) o;
|
||||
|
||||
return this.groupId.equals( other.getGroupId() ) &&
|
||||
this.artifactId.equals( other.getArtifactId() ) &&
|
||||
this.version.equals( other.getVersion() ) &&
|
||||
this.type.equals( other.getType() );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue