public String csvIdentifiers ( Set < Identifier > ids ) { if ( ids == null || ids . isEmpty ( ) ) { return "\"\"" ; } boolean addComma = false ; final StringBuilder sb = new StringBuilder ( ) ; for ( Identifier id : ids ) { if ( addComma ) { sb . append ( ", " ) ; } else { addComma = true ; } sb . append ( id . getValue ( ) ) ; } if ( sb . length ( ) == 0 ) { return "\"\"" ; } return StringEscapeUtils . escapeCsv ( sb . toString ( ) ) ; }
Takes a set of Identifiers filters them to none CPE and formats them for display in a CSV .