Fixed sorting error using Users

This commit is contained in:
Risto Lahtela 2020-09-14 10:53:24 +03:00
parent 44c52668c2
commit 2c9545a029

View File

@ -28,7 +28,7 @@ import java.util.UUID;
*
* @author Rsl1122
*/
public class User {
public class User implements Comparable<User> {
private final String username;
private final String linkedTo;
@ -109,4 +109,9 @@ public class User {
public int hashCode() {
return Objects.hash(username, linkedTo, linkedToUUID, passwordHash, permissionLevel, permissions);
}
@Override
public int compareTo(User o) {
return Integer.compare(o.permissionLevel, this.permissionLevel);
}
}