Class ImmutablePathMatcher.ImmutablePathMatcherBuilder<T>

java.lang.Object
io.quarkus.vertx.http.runtime.security.ImmutablePathMatcher.ImmutablePathMatcherBuilder<T>
Enclosing class:
ImmutablePathMatcher<T>

public static class ImmutablePathMatcher.ImmutablePathMatcherBuilder<T> extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    addPath(String path, T handler)
    Two sorts of paths are accepted: - exact path matches (without wildcard); these are matched first and Quarkus does no magic, request path must exactly match - paths with one or more wildcard: - ending wildcard matches zero or more path segment - inner wildcard matches exactly one path segment few notes: - it's key to understand only segments are matched, for example '/one*' will not match request path '/ones' - path patterns '/one*' and '/one/*' are one and the same thing as we only match path segments and '/one*' in fact means 'either /one or /one/any-number-of-path-segments' - paths are matched on longer-prefix-wins basis - what we call 'prefix' is in fact path to the first wildcard - if there is a path after first wildcard like in the '/one/*\/three' pattern ('/three' is remainder) path pattern is considered longer than the '/one/*' pattern and wins for request path '/one/two/three' - more specific pattern wins and wildcard is always less specific than any other path segment character, therefore path '/one/two/three*' will win over '/one/*\/three*' for request path '/one/two/three/four'
     
    handlerAccumulator(BiConsumer<T,T> handlerAccumulator)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • handlerAccumulator

      public ImmutablePathMatcher.ImmutablePathMatcherBuilder<T> handlerAccumulator(BiConsumer<T,T> handlerAccumulator)
      Parameters:
      handlerAccumulator - policies defined with same path are accumulated, this way, you can define more than one policy of one path (e.g. one for POST method, one for GET method)
      Returns:
      ImmutablePathMatcherBuilder
    • build

      public ImmutablePathMatcher<T> build()
    • addPath

      public ImmutablePathMatcher.ImmutablePathMatcherBuilder<T> addPath(String path, T handler)
      Two sorts of paths are accepted: - exact path matches (without wildcard); these are matched first and Quarkus does no magic, request path must exactly match - paths with one or more wildcard: - ending wildcard matches zero or more path segment - inner wildcard matches exactly one path segment few notes: - it's key to understand only segments are matched, for example '/one*' will not match request path '/ones' - path patterns '/one*' and '/one/*' are one and the same thing as we only match path segments and '/one*' in fact means 'either /one or /one/any-number-of-path-segments' - paths are matched on longer-prefix-wins basis - what we call 'prefix' is in fact path to the first wildcard - if there is a path after first wildcard like in the '/one/*\/three' pattern ('/three' is remainder) path pattern is considered longer than the '/one/*' pattern and wins for request path '/one/two/three' - more specific pattern wins and wildcard is always less specific than any other path segment character, therefore path '/one/two/three*' will win over '/one/*\/three*' for request path '/one/two/three/four'
      Parameters:
      path - normalized path
      handler - prefix path handler
      Returns:
      self