public List < Assignment > findAllAssignments ( ) { List < Assignment > list = new ArrayList <> ( ) ; List < String > assignmentStrings ; try { assignmentStrings = readLines ( assignmentsFile ) ; } catch ( IOException e ) { throw new FileBasedRuntimeException ( e ) ; } for ( String assignmentString : assignmentStrings ) { if ( StringUtils . isNotBlank ( assignmentString ) ) { String [ ] substrings = StringUtils . splitByWholeSeparator ( assignmentString , Configuration . get ( ) . getAssociationSeparator ( ) ) ; if ( substrings . length < 2 || StringUtils . isBlank ( substrings [ 1 ] ) ) { continue ; } Assignment assignment = new Assignment ( substrings [ 0 ] , substrings [ 1 ] ) ; if ( substrings . length > 2 ) { assignment . setRoles ( Arrays . asList ( StringUtils . splitByWholeSeparator ( substrings [ 2 ] , Configuration . get ( ) . getValueSeparator ( ) ) ) ) ; } list . add ( assignment ) ; } } return list ; }
Finds all the available assignments .