public static String mapToString ( Map < String , ? > map ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "{\n" ) ; for ( String key : map . keySet ( ) ) { if ( map . get ( key ) != null ) { sb . append ( key + ": " + map . get ( key ) + "\n " ) ; } else { continue ; } } sb . append ( "}" ) ; return sb . toString ( ) ; }
Print map to string