Converting Java object to json string

I have a java entity class which looks like this:

private String email = "ab@gmail.com";
private String name = "abhi";
private String phone = "33";
private String address = "India";

I want to convert it into String like this :

{"email":["ab@gmail.com"],
"name":["abhi"],
"phone":["33"],
"address" : ["India"]}

Can someone please tell how can I do this. I am using java spring boot and intelliJ.

%d bloggers like this: