mirror of
https://github.com/apache/struts.git
synced 2026-08-16 03:56:57 +00:00
Adds Comparable to allow compile under JDK7
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@1417321 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -24,7 +24,8 @@ package org.apache.struts2.sitegraph.entities;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class Target {
|
||||
public class Target implements Comparable<Target> {
|
||||
|
||||
private String target;
|
||||
private int type;
|
||||
|
||||
@@ -59,4 +60,13 @@ public class Target {
|
||||
result = 29 * result + type;
|
||||
return result;
|
||||
}
|
||||
|
||||
public int compareTo(Target o) {
|
||||
if (o.target != null && target != null) {
|
||||
return o.target.compareTo(target);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user