One way to transmit a map<string,map<string,integer>> along with application.properties is to convert the map into a JSON object and include it as a string value in the properties file.
For example, if the map is called "data", we can use the following code to convert it into a JSON string:
ObjectMapper objectMapper = new ObjectMapper();
String jsonData = objectMapper.writeValueAsString(data);
We can then include this JSON string as a value in the application.properties file using a key of our choice, like so:
my.map.data={JSON string here}
In the application code, we can then retrieve this JSON string, parse it back into the original map type, and use it in our application.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2022-05-27 11:00:00 +0000
Seen: 16 times
Last updated: Jul 22 '22
What is the process of including a map<String,Map<String,Integer>> in application.properties?
What is the procedure to remove all markers and layers from a Leaflet map in order to add new ones?
How can I get the choropleth map to display on Jupyter Notebook when using Plotly Express?
How can I show several locations on a Leaflet map using GraphHopper?
How do I obtain Latin-1 codes for particular characters?
How can one go over a key/value map object by repeatedly executing its elements?
How can one display grid labels on a Southpolar stereographic map in cartopy?