Class CompositeResolver.Builder

  • Enclosing class:
    CompositeResolver

    public static class CompositeResolver.Builder
    extends java.lang.Object
    • Method Detail

      • add

        public CompositeResolver.Builder add​(java.lang.String prefix,
                                             Resolver resolver)
        Add a new resolver to the CompositeResolver.
        Parameters:
        prefix - Start of the target (first part of the target string, eg "example" in "/example/target/", or "" in "/")
        resolver - Resolver to call for this target, URIPath.omitFirst() will be called for Resolver method calls.
        Returns:
        this builder.
      • add

        public CompositeResolver.Builder add​(java.lang.String prefix,
                                             java.util.function.Function<Request,​Response> resolver,
                                             java.util.function.Predicate<Request> accessCheck)
        Add a new resolver to the CompositeResolver by using functional interfaces
        Parameters:
        prefix - Start of the target (first part of the target string, eg "example" in "/example/target/", or "" in "/")
        resolver - Resolver to call for this target, URIPath.omitFirst() will be called for Resolver method calls.
        accessCheck - Function for checking if request should be allowed (true, default) or forbidden (false).
        Returns:
        this builder.