code: public PhysicalElement physicalElementFromJSON(Model mo, Network net, JSONObject o) throws JSONConverterException {
          String type = requiredString(o, "type");
          switch (type) {
              case NODE_LABEL:
                  return requiredNode(mo, o, "id");
              case SWITCH_LABEL:
                  return getSwitch(net, requiredInt(o, "id"));
              default:
                  throw new JSONConverterException("type '" + type + "' is not a physical element");
          }
      }
docs: Convert a JSON physical element object to a Java PhysicalElement object.
  
  @param o the JSON object to convert the physical element to convert
  @return  the PhysicalElement