示例#1
0
文件: User.java 项目: jmarine/wgs
 @Override
 public boolean equals(Object o) {
   if ((o != null) && (o instanceof User)) {
     User u = (User) o;
     return uid.equals(u.getUid());
   } else {
     return false;
   }
 }
示例#2
0
文件: User.java 项目: jmarine/wgs
  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;
  }