Class QueryTelegramRequest<T>

    • Constructor Detail

      • QueryTelegramRequest

        protected QueryTelegramRequest​(java.lang.String endPoint,
                                       java.lang.Class<T> callbackType,
                                       java.util.function.Consumer<T> callback,
                                       java.util.function.Consumer<TelegramException> errorHandler)
    • Method Detail

      • handleResponse

        public void handleResponse​(okhttp3.Response response)
                            throws java.io.IOException
        Description copied from interface: TelegramRequest
        Handle the response from the server, call any relevant callbacks and do error validation
        Parameters:
        response - The response
        Throws:
        java.io.IOException - If any I/O error occurred
      • isValid

        protected abstract boolean isValid()
        Checks validity of this request. Internal method used before sending.
        Returns:
        If it's valid
      • setCallback

        public void setCallback​(java.util.function.Consumer<T> callback)