Exemplo n.º 1
0
 @Override
 public boolean equals(Object o) {
   if ((o != null) && (o instanceof User)) {
     User u = (User) o;
     return uid.equals(u.getUid());
   } else {
     return false;
   }
 }
Exemplo n.º 2
0
  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;
  }