private static String getFormattedName ( User user ) { List < String > parts = new ArrayList <> ( ) ; if ( user . getTitle ( ) != null ) { parts . add ( user . getTitle ( ) ) ; } if ( user . getFirstName ( ) != null ) { parts . add ( user . getFirstName ( ) ) ; } if ( user . getMiddleNames ( ) != null ) { parts . add ( user . getMiddleNames ( ) ) ; } if ( user . getLastName ( ) != null ) { parts . add ( user . getLastName ( ) ) ; } if ( parts . isEmpty ( ) ) { return null ; } else { return StringUtils . collectionToDelimitedString ( parts , " " ) ; } }
Formats a MolgenisUser s name .