implemented the Comparable interface

Former-commit-id: 9e69353436d60bf42c851c8d7a9e8e3de5407571
This commit is contained in:
Jeremy Long
2013-04-18 05:42:25 -04:00
parent 6143202428
commit 1fcefb3bb7

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());
}
}