Interface V1Route

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      java.lang.String getPathFormat()
      The actual format string with "%s" in place of parameters that will be substituted
      java.lang.String[] getPathParams()  
      default java.util.List<java.lang.String> getPathParamsList()  
      default java.lang.String getPathWithParameters​(java.lang.String[] params)
      Similar to getPathWithParameters(Map) but takes an ordered list of parameters for substitution.
      default java.lang.String getPathWithParameters​(java.util.Map<java.lang.String,​java.lang.String> params)
      Generate path with specified parameters substituted into the path.
      java.lang.String getRawPath()
      Path formatted with colons prefixing each path parameter for use in defining the path in SparkJava ex /user/:id
      static java.lang.String rawPath​(java.lang.String pathFormat, java.lang.String[] pathParams)
      Generates a path formatted with colons prefixing each path parameter for use in defining the path in SparkJava ex /user/:id
    • Method Detail

      • getRawPath

        java.lang.String getRawPath()
        Path formatted with colons prefixing each path parameter for use in defining the path in SparkJava ex /user/:id
        Returns:
      • getPathFormat

        java.lang.String getPathFormat()
        The actual format string with "%s" in place of parameters that will be substituted
        Returns:
      • getPathParams

        java.lang.String[] getPathParams()
        Returns:
        an array of key strings required for path resolution
        See Also:
        getPathWithParameters(Map)
      • rawPath

        static java.lang.String rawPath​(java.lang.String pathFormat,
                                        java.lang.String[] pathParams)
        Generates a path formatted with colons prefixing each path parameter for use in defining the path in SparkJava ex /user/:id
        Parameters:
        pathFormat - Format string for the path to this resource
        pathParams - list of parameter names to use in completing the path
        Returns:
      • getPathWithParameters

        default java.lang.String getPathWithParameters​(java.lang.String[] params)
        Similar to getPathWithParameters(Map) but takes an ordered list of parameters for substitution. It is recommended to use that method and specify parameters by name.
        Parameters:
        params -
        Returns:
        See Also:
        getPathWithParameters(Map)
      • getPathWithParameters

        default java.lang.String getPathWithParameters​(java.util.Map<java.lang.String,​java.lang.String> params)
        Generate path with specified parameters substituted into the path. This is the preferred way to generate the path to a resource. Example: A route may define the path /user/:id. To generate a path for id "123abc", pass into this method a Map that has key: "id" and value: "123abc". This will return the path /user/123abc The getPathParams() method returns an array of key strings required. getPathParamsList() returns keys as a list.
        Parameters:
        params -
        Returns:
      • getPathParamsList

        default java.util.List<java.lang.String> getPathParamsList()