Class PathSegment

java.lang.Object
io.avaje.http.api.PathSegment

public final class PathSegment extends Object
A path segment that can simple like value like chair or contain matrix parameter values using semi-colon delimitation like chair;vendor=ikea;size=small.

Matrix parameters are optional 'qualifiers' of the path segment.

  • Constructor Details

    • PathSegment

      public PathSegment(String value)
      Create with a given value that may contain matric parameters.
  • Method Details

    • of

      public static PathSegment of(String value)
      Create with a given value that may contain matrix parameters.
    • val

      public String val()
      Return the main segment value.

      For "chair" this returns "chair"

      For "chair;vendor=ikea;size=small" this returns "chair"

    • matrix

      public String matrix(String key)
      Return a metric value for the given key.

      For example, given "chair;vendor=ikea;size=small"

      matrix("vendor") returns "ikea".

      Parameters:
      key - The matrix key
      Returns:
      The matrix value if supplied or null