public JSONArray switchesToJSON ( Collection < Switch > c ) { JSONArray a = new JSONArray ( ) ; for ( Switch s : c ) { a . add ( switchToJSON ( s ) ) ; } return a ; }
Convert a collection of switches to an array of JSON switches objects .