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