Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easy way to get a string representation of Map<String, String[]> in java?

I've coded a simple function that prints it for me but I was wondering if there was an easier way.

I'm basically looking for something that will print the keys (Strings) and the values (String arrays), as if I invoked Arrays.toString() on the values.

like image 546
Pablo Fernandez Avatar asked Oct 10 '22 00:10

Pablo Fernandez


1 Answers

this site have two interesting methods: http://www.vineetmanohar.com/2010/05/2-ways-to-convert-java-map-to-string/

The first one (some code) will give you an answer in the format key=value @ key2 = value2 & ...

The second one will give you a XML with the information

like image 181
woliveirajr Avatar answered Oct 18 '22 07:10

woliveirajr