jsonCountry.put("countryCode", country.getCountryCode());
jsonCountry.put("countryName", country.getCountryName());
Iterator<?> iterator1 = country.getStates().iterator();
Vector<JSONEscapeObject> states = new Vector<JSONEscapeObject>();
while (iterator1.hasNext()) {
State state = (State) iterator1.next();
JSONEscapeObject jsonState = new JSONEscapeObject();
jsonState.put("stateId", state.getStateId());
jsonState.put("stateCode", state.getStateCode());
jsonState.put("stateName", state.getStateName());
states.add(jsonState);
}
jsonCountry.put("states", states);
countries.add(jsonCountry);
}