code: public Switch switchFromJSON(JSONObject o) throws JSONConverterException {
          return new Switch(requiredInt(o, "id"), readCapacity(o));
      }
docs: Convert a JSON switch object to a Switch.
  
  @param o the json object
  @return the Switch