In Java I have a java.util.Properties object and I want to obtain another one with the same pairs but keys converted to values and viceversa.
java.util.Properties
If there are c
A Properties object is a Hashtable object, so you should be able to do something like:
Properties
Hashtable
Hashtable reversedProps = new Hashtable(); for (String key : props.keySet()) { reversedProps.put(props.get(key), key); }
Result: 3 lines of code.
This code is untested, but it should give you the idea.