Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Suraj_Kamdi
Suraj_KamdiAccepted solution
Community Advisor
July 13, 2023

Use the following code snippet.

 

@ValuemapValue
private Collection<Pojo> multifieldResourceName = Collections.emptyList();

//logic goes here
ObjectMapper mapper = new ObjectMapper();
mapper.writeValueAsString(multifieldResourceName );
Suraj Kamdi

3 replies

Suraj_Kamdi
Community Advisor
Suraj_KamdiCommunity AdvisorAccepted solution
Community Advisor
July 13, 2023

Use the following code snippet.

 

@ValuemapValue
private Collection<Pojo> multifieldResourceName = Collections.emptyList();

//logic goes here
ObjectMapper mapper = new ObjectMapper();
mapper.writeValueAsString(multifieldResourceName );
Translate
Suraj Kamdi
Level 4
July 13, 2023

hi @anamikap ,

Hope you have already found the answer for the above question. There are multiple ways to fetch Json Object. Below is one of the options

 

Translate
Anudeep_Garnepudi
Community Advisor
Community Advisor
July 29, 2023

@anamikap 

Get each multifiled item ValueMap and use Gson to conver ValueMap to JSON.

String jsonStr = gson.toJson(valueMapObj)
Translate
AG