com.holonplatform.vaadin.flow.navigator.internal

## Class NavigationParameterUtils

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

- All Implemented Interfaces:
    Serializable

      public final class NavigationParameterUtils
      extends Object
      implements Serializable

  Navigation parameters serialization utility class.
  Since:
    5.2.0
  See Also:
    Serialized Form

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `decodeParameter(String nameOrValue)` Decode given parameter name or value from a URL representation, using the `ENCODE_DECODE_CHARSET` charset.
    `static Map<String,List<String>>` | `decodeParameters(Map<String,List<String>> parameters)` Decode given parameter names and values map from a URL representation, using the `ENCODE_DECODE_CHARSET` charset.
    `static List<String>` | `decodeParameterValues(List<String> values)` Decode given parameter values from a URL representation, using the `ENCODE_DECODE_CHARSET` charset.
    `static String` | `encodeParameter(String nameOrValue)` Encode given parameter name or value to obtain a URL-safe representation, using the `ENCODE_DECODE_CHARSET` charset.
    `static Map<String,List<String>>` | `encodeParameters(Map<String,List<String>> parameters)` Encode given parameter names and values map to obtain a URL-safe representation, using the `ENCODE_DECODE_CHARSET` charset.
    `static List<String>` | `encodeParameterValues(List<String> values)` Encode given parameter values to obtain a URL-safe representation, using the `ENCODE_DECODE_CHARSET` charset.
    `static Map<String,List<String>>` | `getQueryParameters(String queryPart)` Get the given URI query part as a map of query parameter name and values.
    `static <T> List<String>` | `serializePathParameters(List<T> parameters)` Serialize given path parameters.
    `static Map<String,List<String>>` | `serializeQueryParameters(Map<String,Object> parameters)` Serialize given query parameters.

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

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

- - ### Method Detail

    - #### encodeParameter

          public static String encodeParameter(String nameOrValue)

      Encode given parameter name or value to obtain a URL-safe representation, using the `ENCODE_DECODE_CHARSET` charset.
      Parameters:
        `nameOrValue` - The parameter name or value to encode
      Returns:
        Encoded parameter name or value
      Throws:
        `InvalidNavigationParameterException` - If an encoding error occurs

    - #### encodeParameterValues

          public static List<String> encodeParameterValues(List<String> values)

      Encode given parameter values to obtain a URL-safe representation, using the `ENCODE_DECODE_CHARSET` charset.
      Parameters:
        `values` - The parameter values to encode
      Returns:
        Encoded parameter values
      Throws:
        `InvalidNavigationParameterException` - If an encoding error occurs

    - #### encodeParameters

          public static Map<String,List<String>> encodeParameters(Map<String,List<String>> parameters)

      Encode given parameter names and values map to obtain a URL-safe representation, using the `ENCODE_DECODE_CHARSET` charset.
      Parameters:
        `parameters` - The parameter names and values map to encode
      Returns:
        Encoded parameters
      Throws:
        `InvalidNavigationParameterException` - If an encoding error occurs

    - #### decodeParameter

          public static String decodeParameter(String nameOrValue)

      Decode given parameter name or value from a URL representation, using the `ENCODE_DECODE_CHARSET` charset.
      Parameters:
        `nameOrValue` - The parameter name or value to decode
      Returns:
        Decoded parameter name or value
      Throws:
        `InvalidNavigationParameterException` - If a decoding error occurs

    - #### decodeParameterValues

          public static List<String> decodeParameterValues(List<String> values)

      Decode given parameter values from a URL representation, using the `ENCODE_DECODE_CHARSET` charset.
      Parameters:
        `values` - The parameter values to decode
      Returns:
        Decoded parameter values
      Throws:
        `InvalidNavigationParameterException` - If a decoding error occurs

    - #### decodeParameters

          public static Map<String,List<String>> decodeParameters(Map<String,List<String>> parameters)

      Decode given parameter names and values map from a URL representation, using the `ENCODE_DECODE_CHARSET` charset.
      Parameters:
        `parameters` - The parameter names and values map to decode
      Returns:
        Decoded parameters
      Throws:
        `InvalidNavigationParameterException` - If a decoding error occurs

    - #### serializeQueryParameters

          public static Map<String,List<String>> serializeQueryParameters(Map<String,Object> parameters)

      Serialize given query parameters.
      Parameters:
        `parameters` - The query parameters
      Returns:
        The serialized query parameters

    - #### serializePathParameters

          public static <T> List<String> serializePathParameters(List<T> parameters)

      Serialize given path parameters.
      Type Parameters:
        `T` - Parameter value type
      Parameters:
        `parameters` - The path parameters values
      Returns:
        The serialized path parameters values

    - #### getQueryParameters

          public static Map<String,List<String>> getQueryParameters(String queryPart)

      Get the given URI query part as a map of query parameter name and values.
      Parameters:
        `queryPart` - The query part (excluding the `?` character)
      Returns:
        A map of query parameter name and values, empty if none

Copyright © 2019 The Holon Platform. All rights reserved.