com.holonplatform.vaadin.flow.navigator.internal

## Class DefaultNavigatorRegistry

- java.lang.Object
- - com.holonplatform.vaadin.flow.navigator.internal.DefaultNavigatorRegistry

- All Implemented Interfaces:
    NavigatorRegistry, Serializable

      public class DefaultNavigatorRegistry
      extends Object
      implements NavigatorRegistry

  Default `NavigatorRegistry` instance.
  Since:
    5.2.0
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultNavigatorRegistry()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Optional<Navigator>` | `getNavigator(com.vaadin.flow.component.UI ui)` Get the `Navigator` bound to given UI, if available.
    `int` | `getNavigatorCount()` Get the number of the registered navigators.
    `Navigator` | `getOrCreateNavigator(com.vaadin.flow.component.UI ui, Function<com.vaadin.flow.component.UI,Navigator> creator)` Get the `Navigator` bound to given UI, creating it if not present.
    `void` | `setNavigator(com.vaadin.flow.component.UI ui, Navigator navigator)` Bind the given `Navigator` instance to the given `ui`.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.vaadin.flow.navigator.internal.NavigatorRegistry

      `getSessionRegistry`

- - ### Constructor Detail

    - #### DefaultNavigatorRegistry

          public DefaultNavigatorRegistry()

  - ### Method Detail

    - #### getNavigatorCount

          public int getNavigatorCount()

      Get the number of the registered navigators.
      Returns:
        the number of the registered navigators

    - #### setNavigator

          public void setNavigator(com.vaadin.flow.component.UI ui,
                                   Navigator navigator)

      Description copied from interface: `NavigatorRegistry`
      Bind the given `Navigator` instance to the given `ui`.

      If another `Navigator` instance was bound to given UI, it will be replaced by the new navigator instance.

      Specified by:
        `setNavigator` in interface `NavigatorRegistry`
      Parameters:
        `ui` - The UI (not null)
        `navigator` - The navigator (not null)

    - #### getNavigator

          public Optional<Navigator> getNavigator(com.vaadin.flow.component.UI ui)

      Description copied from interface: `NavigatorRegistry`
      Get the `Navigator` bound to given UI, if available.
      Specified by:
        `getNavigator` in interface `NavigatorRegistry`
      Parameters:
        `ui` - The UI for which to obtain the navigator (not null)
      Returns:
        Optional `Navigator` bound to given UI

    - #### getOrCreateNavigator

          public Navigator getOrCreateNavigator(com.vaadin.flow.component.UI ui,
                                                Function<com.vaadin.flow.component.UI,Navigator> creator)

      Description copied from interface: `NavigatorRegistry`
      Get the `Navigator` bound to given UI, creating it if not present.
      Specified by:
        `getOrCreateNavigator` in interface `NavigatorRegistry`
      Parameters:
        `ui` - The UI for which to obtain the navigator (not null)
        `creator` - The function to use to create a new `Navigator` and bound it to the UI (not null)
      Returns:
        The `Navigator` bound to given UI

Copyright © 2020 The Holon Platform. All rights reserved.