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
Jul 13, 2023 5:45 AM UTC

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
Jul 13, 2023 5:45 AM UTC

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
Jul 13, 2023 6:02 AM UTC

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
Jul 29, 2023 1:50 PM UTC

@anamikap 

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

String jsonStr = gson.toJson(valueMapObj)
Translate
AG