Using the Vaadin Flow framework I find that I have two models that I need to use to describe a routing destination. If I’m initiating UI navigation server-side then I end up calling the UI.navigate() and describing the destination with a class and perhaps a parameter - type-safe and easy.
If I’m intercepting with a BeforeEnterObserver I’m able to navigate based on destination class, but not if I have a parameter - in which case I need to either construct a NavigationState object or I have to translate my destination class into a String route.
Am I missing some utility class that makes these consistent? How are others dealing with these two scenarios? Is there a known reason that BeforeEnterEvent.forwardTo() doesn’t have a method that has the same parameters as UI.navigate(Class target, T parameter)?
Thanks