code: @Override
      public void onReceive(Object message) {
          if (message instanceof BindDownload) {
              BindDownload requestDownload = (BindDownload) message;
              bindDownload(requestDownload.getFileReference(),
                      requestDownload.isAutostart(),
                      requestDownload.getCallback());
          } else if (message instanceof CancelDownload) {
              CancelDownload cancelDownload = (CancelDownload) message;
              cancelDownload(cancelDownload.getFileId());
          } else if (message instanceof UnbindDownload) {
              UnbindDownload unbindDownload = (UnbindDownload) message;
              unbindDownload(unbindDownload.getFileId(), unbindDownload.isAutocancel(), unbindDownload.getCallback());
          } else if (message instanceof StartDownload) {
              StartDownload startDownload = (StartDownload) message;
              startDownload(startDownload.getFileReference());
          } else if (message instanceof OnDownloadProgress) {
              OnDownloadProgress downloadProgress = (OnDownloadProgress) message;
              onDownloadProgress(downloadProgress.getFileId(), downloadProgress.getProgress());
          } else if (message instanceof OnDownloaded) {
              OnDownloaded onDownloaded = (OnDownloaded) message;
              onDownloaded(onDownloaded.getFileId(), onDownloaded.getReference());
          } else if (message instanceof OnDownloadedError) {
              OnDownloadedError error = (OnDownloadedError) message;
              onDownloadError(error.getFileId());
          } else if (message instanceof RequestState) {
              RequestState requestState = (RequestState) message;
              requestState(requestState.getFileId(), requestState.getCallback());
          } else if (message instanceof SubscribeToDownloads) {
              subscribe(((SubscribeToDownloads) message).getCallback());
          } else if (message instanceof UnsubscribeToDownloads) {
              unsubscribe(((UnsubscribeToDownloads) message).getCallback());
          } else {
              super.onReceive(message);
          }
      }
docs: region Messages