TelegramBots
TelegramBots copied to clipboard
Protected access to default implementations
I faced with a problem that I need to slightly override default implementation of UpdatesSupplier
, but it caused significant changes.
I know that I can change UpdateSupplier
via DefaultBotSession#setUpdatesSupplier
, it's fine. But I can't access to some necessary fields (without reflection) that are used in default implementation ReaderThread#getUpdatesFromServer
and might be necessary in custom implementation (such as token
, requestConfig
, lastReceivedUpdate
, ...). So I have to read values from them and set values to them (lastReceivedUpdate
) via reflection. I think that it's not convenient.
Suggestion:
- Add getters to private fields or make them
protected
at least in non-final classes that can be overridden (f.e.DefaultBotSession
)
Version: 5.2
Plus on making the important methods non final and protected