code: public void switchesFromJSON(Network net, JSONArray a) throws JSONConverterException {
          for (Object o : a) {
              net.newSwitch(requiredInt((JSONObject) o, "id"), readCapacity((JSONObject) o));
          }
      }
docs: Convert a JSON array of switches to a Java List of switches.
  @param net the network to populate
  @param a the json array