NIHVIVO-1385 Add toString() method to help in debugging. As long as we are here, clean up compiler warnings.
This commit is contained in:
parent
d41a64c60e
commit
029465e4de
1 changed files with 17 additions and 2 deletions
|
@ -107,6 +107,7 @@ public class User implements Comparable<User> {
|
|||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(User other) {
|
||||
Collator collator = Collator.getInstance();
|
||||
if( this.getUsername() == null && other.getUsername() == null )
|
||||
|
@ -119,4 +120,18 @@ public class User implements Comparable<User> {
|
|||
return collator.compare(this.getUsername(),other.getUsername());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "User[URI=" + URI + ", namespace=" + namespace + ", localName="
|
||||
+ localName + ", username=" + username + ", oldPassword="
|
||||
+ oldPassword + ", md5password=" + md5password + ", modTime="
|
||||
+ dateToString(modTime) + ", firstTime="
|
||||
+ dateToString(firstTime) + ", loginCount=" + loginCount
|
||||
+ ", roleURI=" + roleURI + ", lastName=" + lastName
|
||||
+ ", firstName=" + firstName + "]";
|
||||
}
|
||||
|
||||
private String dateToString(Date date) {
|
||||
return (date == null) ? "null" : String.valueOf(date.getTime());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue