public final int compareTo(Role role) { return getPrincipalName().compareTo(role.getPrincipalName()); } }
/** * Very inefficient default implementation. It is highly recommended * sub-classes override this. * * @param name * @return role * @see {@link Connector#getIdentityByName(String)} * @throws PrincipalNotFoundException * @throws {@link ConnectorException} */ public Role getRoleByName(String name) throws PrincipalNotFoundException, ConnectorException { for (Iterator<Role> roleIterator = allRoles(); roleIterator.hasNext();) { Role role = roleIterator.next(); if (role.getPrincipalName().equals(name)) { return role; } } throw new PrincipalNotFoundException(name + " not found."); }