Converting Java object to json string

I have a java entity class which looks like this:

private String email = "";
private String name = "abhi";
private String phone = "33";
private String address = "India";

I want to convert it into String like this :

"address" : ["India"]}

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

%d bloggers like this: