I'm using mvp4g to develop an application and I have a quite complex view which displays a widget and a lot of filtering options that can be applied to this widget. As a requirement, all filters are included in the history token.
I currently use a history converter that converts a Guava's ListMultimap<String, String>
to a token, and vice versa. And this multimap is passed as an event's parameter.
Unfortunately it results in an inconvenient:
@Event(handlers = ExampleParametrizedPresenter.class, name = "example", historyConverter = ExampleParametrizedHistoryConverter.class)
public void showExample(@Nullable ListMultimap<String, String> parameters);
Apart from checking if parameters
equals to null in the presenter, every time I need to fire this event with some default parameters I have to construct a multimap and then check (again in the presenter) if all required parameters are present.
What I would like to have is a possibility to fire this event with different arguments. Something like, e.g. a possibility to call (assuming I need to pass some dates):
myEventBus.showExample(myMultimap);
myEventBus.showExample(fromDate, toDate);
myEventBus.showExample(ExampleType.MONTH, 8);
Is there any way to achieve this?