I would recommend using JACKSON object mapper. If you dont want to recreate the above model structure writing pojos.
A nice tutorial can be found here enter link description here
You basically use it like this:
ObjectMapper objectMapper = new ObjectMapper();
String jsonRepresentation = objectMapper.writeValueAsString( anyObject );
Like stated above anyObject could also be a Map key/values and the values can also be maps again.
Your specific use case would be like this:
ObjectMapper m = new ObjectMapper();
Map<String, Object> input = new HashMap<String, Object>();
input.put( "name", "xyz" );
input.put( "id", "428" );
input.put( "mailId", new String[] { "[email protected]" } );
Map<String, Object> opwarden = new HashMap<String, Object>();
opwarden.put( "number", "132344345" );
opwarden.put( "title", "title" );
Map<String, Object> bundle1 = new HashMap<String, Object>();
bundle1.put( "opwarden", opwarden );
input.put( "bundle1" , bundle1 );
String json = m.writeValueAsString( input );