Interface V1Route

All Known Implementing Classes:
V1Delete, V1Get, V1Post, V1Put

public interface V1Route
  • Method Details

    • getRawPath

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

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

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

      static String rawPath(String pathFormat, 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 String getPathWithParameters(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

      default String getPathWithParameters(Map<String,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 List<String> getPathParamsList()