예제 #1
0
 public CfUser getUserWithRole(String role) {
   for (CfUser user : cfUsers) {
     if (user.getrole().equalsIgnoreCase(role)) {
       return user;
     }
   }
   return null;
 }
예제 #2
0
 public boolean containsUser(CfUser potentialUser) {
   for (CfUser user : cfUsers) {
     if (user.equals(potentialUser)) {
       return true;
     }
   }
   return false;
 }
예제 #3
0
 public List<CfUser> getUsersWithRole(String role) {
   List<CfUser> users = new Vector<CfUser>();
   for (CfUser user : cfUsers) {
     if (user.getrole().equals(role)) {
       users.add(user);
     }
   }
   return users;
 }
예제 #4
0
 public String getListofUsersAsStringWithRole(String role) {
   String list = "";
   for (CfUser user : cfUsers) {
     if (user.getrole().equalsIgnoreCase(role)) {
       list = list + user.getid() + ", ";
     }
   }
   if (list.endsWith(", ")) {
     list = list.substring(0, list.length() - 2);
   }
   return list;
 }
예제 #5
0
 public void replaceUserIds(Map<String, String> old2newId) {
   List<CfUser> users = getCfUsers();
   for (CfUser user : users) {
     String newName = old2newId.get(user.getid());
     if (newName != null) {
       cfContent.replaceStringInDescription(user.getid(), newName);
       user.setid(newName);
     } else {
       System.err.println("No new name for " + user.getid());
     }
   }
 }