implemented the Comparable interface

Former-commit-id: 2be5ef6e2d0d9570186273fb6b8fc42e372ff251
This commit is contained in:
Jeremy Long
2013-04-18 05:42:25 -04:00
parent d5b2380bc2
commit 4d414ea082

View File

@@ -30,7 +30,7 @@ import org.owasp.dependencycheck.data.cpe.Entry;
*
* @author Jeremy Long (jeremy.long@gmail.com)
*/
public class VulnerableSoftware extends Entry implements Serializable {
public class VulnerableSoftware extends Entry implements Serializable, Comparable {
/**
* The serial version UID.
@@ -104,4 +104,13 @@ public class VulnerableSoftware extends Entry implements Serializable {
hash = 83 * hash + (this.getName() != null ? this.getName().hashCode() : 0);
return hash;
}
/**
* Implementation of the comparable interface.
* @param vs the VulnerableSoftware to compare
* @return an integer indicating the ordering of the two objects
*/
public int compareTo(VulnerableSoftware vs) {
return this.getName().compareTo(vs.getName());
}
}