code: public static AddTorrentParams parseMagnetUri(String uri) {
          error_code ec = new error_code();
          add_torrent_params params = add_torrent_params.parse_magnet_uri(uri, ec);
          if (ec.value() != 0) {
              throw new IllegalArgumentException("Invalid magnet uri: " + ec.message());
          }
          return new AddTorrentParams(params);
      }
docs: Helper function to parse a magnet uri and fill the parameters.
  
  @param uri the magnet uri
  @return the params object filled with the data from the magnet