title: How Can I convert a Map of (Key1=Value1,Key2=Value2) into a Map of (Value1=Valu2) in Apex?
body: <p>I have <code>Map&lt;String, Object&gt; results = {Id=10001,Value=7777},</code> </p>
  
  <p>I want a <code>map</code> with <code>{10001=7777}</code> type.</p>
  
  <p>This is what I attempted :- </p>
  
  <pre><code>Map&lt;String,String&gt; TraversedResultMap = new Map&lt;String,String&gt;();             
  for (String s : results.KeySet()) {           
      TraversedResultMap.put(String.valueOf((String)results.get(s)),String.valueOf((String)results.get(s)));
  }
  system.debug('###TRAVERSED RESULT'+TraversedResultMap); 
  </code></pre>
  
  <p>But I'm getting o/p as : <code>{10001=10001,7777=7777}</code></p>