org.springframework.web.reactive.function.server

Interface RequestPredicate

    • Method Detail

      • test

        boolean test(ServerRequest request)
        Evaluate this predicate on the given request.
        Parameters:
        request - the request to match against
        Returns:
        true if the request matches the predicate; false otherwise
      • and

        default RequestPredicate and(RequestPredicate other)
        Return a composed request predicate that tests against both this predicate AND the other predicate. When evaluating the composed predicate, if this predicate is false, then the other predicate is not evaluated.
        Parameters:
        other - a predicate that will be logically-ANDed with this predicate
        Returns:
        a predicate composed of this predicate AND the other predicate
      • negate

        default RequestPredicate negate()
        Return a predicate that represents the logical negation of this predicate.
        Returns:
        a predicate that represents the logical negation of this predicate
      • or

        default RequestPredicate or(RequestPredicate other)
        Return a composed request predicate that tests against both this predicate OR the other predicate. When evaluating the composed predicate, if this predicate is true, then the other predicate is not evaluated.
        Parameters:
        other - a predicate that will be logically-ORed with this predicate
        Returns:
        a predicate composed of this predicate OR the other predicate
      • nest

        default java.util.Optional<ServerRequest> nest(ServerRequest request)
        Transform the given request into a request used for a nested route. For instance, a path-based predicate can return a ServerRequest with a the path remaining after a match.

        The default implementation returns an Optional wrapping the given path if test(ServerRequest) evaluates to true; or Optional.empty() if it evaluates to false.

        Parameters:
        request - the request to be nested
        Returns:
        the nested request
        See Also:
        RouterFunctions.nest(RequestPredicate, RouterFunction)