com.holonplatform.vaadin.flow.navigator

## Interface NavigationParameterTypeMapper<T>

- Type Parameters:
    `T` - Parameter value type
  All Known Implementing Classes:
    ExampleNavigation8.MyTypeParameterMapper

      public interface NavigationParameterTypeMapper<T>

  A delegate for the `NavigationParameterMapper` to handle a specific navigation parameter value type, provided by the `getParameterType()` method.

  Should provide the parameter value serialization logic, to obtain the value to include in the navigation URL, and the deserialization logic, to obtain a value from a `String` type navigation URL fragment.

  A new `NavigationParameterTypeMapper` registration can be performed using the default Java `ServiceLoader` extensions, providing a `com.holonplatform.vaadin.flow.navigator.NavigationParameterTypeMapper` file in the `META-INF/services` folder, containing the `NavigationParameterTypeMapper` concrete class names to register.

  When more than one `NavigationParameterTypeMapper` is available for the same parameter value type, no selection order is guaranteed, and the last registered mapper will be used.

  Since:
    5.2.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `T` | `deserialize(String value)` Deserialize given parameter `value`.
    `Class<T>` | `getParameterType()` Get the parameter value type to which this mapper is bound.
    `String` | `serialize(T value)` Serialize given parameter `value`.

- - ### Method Detail

    - #### getParameterType

          Class<T> getParameterType()

      Get the parameter value type to which this mapper is bound.
      Returns:
        the parameter value type to which this mapper is bound, must be not `null`

    - #### serialize

          String serialize(T value)
                    throws InvalidNavigationParameterException

      Serialize given parameter `value`.
      Parameters:
        `value` - The parameter value (never `null`)
      Returns:
        The serialized parameter value, must be not `null`
      Throws:
        `InvalidNavigationParameterException` - If an error occurred

    - #### deserialize

          T deserialize(String value)
                 throws InvalidNavigationParameterException

      Deserialize given parameter `value`.
      Parameters:
        `value` - The parameter value, not `null` nor blank
      Returns:
        The deserialized parameter value, must be not `null`
      Throws:
        `InvalidNavigationParameterException` - If an error occurred

Copyright © 2019 The Holon Platform. All rights reserved.