private JSONArray toJsonStringArray ( Collection < ? extends Object > collection ) { if ( null != collection ) { JSONArray array = new JSONArray ( ) ; for ( Object o : collection ) { array . put ( "" + o ) ; } return array ; } else { return null ; } }
Convert a collection of objects to a JSON array with the string representations of that objects .