Skip to content
Advertisement

Difficulty adding Google Guava map elements to array in java

Hello i need to add several elements from the Google Multimap class to Arrays in order to be able to pass them to the JAXB marshall method for marshalling.

JavaScript

In the map i have Product objects.The key is one of the 3 values:panasonic,sony or apple while the values is a product with several fields.I need to add to each array the products that contain only the specific key so that i can write to 3 sepparate xml files the products from each supplier. So the problem is that i do not know how to do this.It got really confusing really fast.Any help would be greatly appreciated !

Advertisement

Answer

you can use below approach to solve problem, Version-2:

JavaScript

Version-2:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement