There is no standard method / way to do this, you have to write your own function.
This is not very difficult to do, but first think about it differently.
If you need to invert your key / values, then you can be wrong, but you do not save the logic of the container.
If you need more information, explain why you want to do this.
Geoffroy
source share