public CfUser getUserWithRole(String role) { for (CfUser user : cfUsers) { if (user.getrole().equalsIgnoreCase(role)) { return user; } } return null; }
public boolean containsUser(CfUser potentialUser) { for (CfUser user : cfUsers) { if (user.equals(potentialUser)) { return true; } } return false; }
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; }
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; }
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()); } } }