public void setAll ( Map < String , String > preferences ) { // check it before sending it to the server in order to be able to raise a precise exception for ( Map . Entry < String , String > preference : preferences . entrySet ( ) ) { checkPreferenceKeyLength ( preference . getKey ( ) ) ; checkPreferenceValueLength ( preference . getValue ( ) ) ; } final Map < String , String > prefs = preferences ; osm . makeAuthenticatedRequest ( USERPREFS , "PUT" , new XmlWriter ( ) { @ Override protected void write ( ) throws IOException { begin ( "osm" ) ; begin ( "preferences" ) ; for ( Map . Entry < String , String > preference : prefs . entrySet ( ) ) { begin ( "preference" ) ; attribute ( "k" , preference . getKey ( ) ) ; attribute ( "v" , preference . getValue ( ) ) ; end ( ) ; } end ( ) ; end ( ) ; } } ) ; }
Sets all the given preference keys to the given preference values .