public static String getParentLocationString ( Location [ ] parents ) { StringBuilder sb = new StringBuilder ( ) ; if ( parents != null ) { for ( Location parent : parents ) { if ( sb . length ( ) > 0 ) { sb . append ( ", " ) ; } sb . append ( String . format ( "%s (%s)" , parent . getLocationName ( ) , parent . getDisplayType ( ) ) ) ; } } else { sb . append ( "N/A" ) ; } return sb . toString ( ) ; }
Helper function to format a string for parent locations .