public void setGroupMembers(List<String> membershipInfo) {
        for (String line : membershipInfo) {
            String[] fields = line.split("\\|");
            if (fields.length < 2) {
                continue;
            }
            Set<String> users = StringUtils.commaDelimitedListToSet(fields[1]);
            String groupName = fields[0];
            groups.putIfAbsent(groupName, null);

            boolean groupAdmin = (3 <= fields.length && "write".equalsIgnoreCase(fields[2])) ? true : false;
            if (groupAdmin) {
                groupAdmins.put(groupName, users);
            } else {
                groupMembers.put(groupName, users);
            }
        }
        logger.debug("groups: " + groups);
        logger.debug("admins: " + groupAdmins + ", members: " + groupMembers);
    }
public void setGroupMembers ( List < String > membershipInfo ) { for ( String line : membershipInfo ) { String [ ] fields = line . split ( "\\|" ) ; if ( fields . length < 2 ) { continue ; } Set < String > users = StringUtils . commaDelimitedListToSet ( fields [ 1 ] ) ; String groupName = fields [ 0 ] ; groups . putIfAbsent ( groupName , null ) ; boolean groupAdmin = ( 3 <= fields . length && "write" . equalsIgnoreCase ( fields [ 2 ] ) ) ? true : false ; if ( groupAdmin ) { groupAdmins . put ( groupName , users ) ; } else { groupMembers . put ( groupName , users ) ; } } logger . debug ( "groups: " + groups ) ; logger . debug ( "admins: " + groupAdmins + ", members: " + groupMembers ) ; }
Specify the membership info as a list of strings, where each string takes
the format -
{@code <group-name>|<comma-separated usernames of members>[|write]}
the optional 'write' field in the end marks the users as admins of the
group

@param membershipInfo