Beispiel #1
0
 public boolean addMember(User user) {
   // if member added is the creator, ignore
   if (user.getId() == getUser().getId()) return false;
   // if member already exists, ignore
   boolean exist = false;
   for (User item : getUserList()) {
     if (item.getId() == user.getId()) {
       exist = true;
     }
   }
   if (exist) return false;
   // validation complete, add this user
   getUserList().add(user);
   user.getJoinedProjectList().add(this);
   return true;
 }
Beispiel #2
0
 public void removeMember(User user) {
   getUserList().remove(user);
   user.getJoinedProjectList().remove(this);
 }