@Override public boolean equals(Object o) { if ((o != null) && (o instanceof User)) { User u = (User) o; return uid.equals(u.getUid()); } else { return false; } }
public WampDict toWampObject(boolean includeFriends) { WampDict retval = new WampDict(); retval.put("user", uid); retval.put("name", getName()); retval.put("picture", getPicture()); if (includeFriends && getFriends() != null) { WampList friends = new WampList(); for (User friend : getFriends()) { if (friend.getLastLoginTime() != null) { friends.add(friend.toWampObject(false)); } } retval.put("friends", friends); } return retval; }