Interface MethodMatcher

  • All Superinterfaces:
    java.util.function.Predicate<io.netty.handler.codec.http.HttpMethod>
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface MethodMatcher
    extends java.util.function.Predicate<io.netty.handler.codec.http.HttpMethod>
    An interface defines matching methods for HTTP method.
    Since:
    1.1
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      static MethodMatcher any()
      Returns the singleton matcher ANY_METHOD.
      static MethodMatcher eq​(io.netty.handler.codec.http.HttpMethod method)
      Returns a matcher that checks if the specified method and coming method is equal.
      static MethodMatcher in​(io.netty.handler.codec.http.HttpMethod... methods)
      Returns a matcher that checks if the coming method is equal to any one of the specified methods.
      default boolean matches​(HttpRequestContext ctx)
      Check if the method of the specified HttpRequestContext matches this matcher or not.
      boolean matches​(io.netty.handler.codec.http.HttpMethod method)
      Check if the specified method matches this matcher or not.
      default boolean test​(io.netty.handler.codec.http.HttpMethod method)
      Evaluates this predicate on the specified method.
      • Methods inherited from interface java.util.function.Predicate

        and, negate, or
    • Field Detail

      • ANY_METHOD

        static final MethodMatcher ANY_METHOD
        Matches any method.

        Always returns true.

    • Method Detail

      • eq

        static MethodMatcher eq​(io.netty.handler.codec.http.HttpMethod method)
        Returns a matcher that checks if the specified method and coming method is equal.
        Parameters:
        method - an HttpMethod
        Returns:
        a matcher that checks if the specified method and coming method is equal
      • in

        static MethodMatcher in​(io.netty.handler.codec.http.HttpMethod... methods)
        Returns a matcher that checks if the coming method is equal to any one of the specified methods.
        Parameters:
        methods - an array of HttpMethod
        Returns:
        a matcher that checks if the coming method is equal to any one of the specified methods
      • matches

        boolean matches​(io.netty.handler.codec.http.HttpMethod method)
        Check if the specified method matches this matcher or not.
        Parameters:
        method - an HttpMethod
        Returns:
        true if the specified method matches this matcher, false otherwise
      • matches

        default boolean matches​(HttpRequestContext ctx)
        Check if the method of the specified HttpRequestContext matches this matcher or not.
        Parameters:
        ctx - the context of the HTTP request
        Returns:
        true if the method of the specified HttpRequestContext matches this matcher, false otherwise
      • test

        default boolean test​(io.netty.handler.codec.http.HttpMethod method)
        Evaluates this predicate on the specified method.

        This method is equivalent to matches(HttpMethod).

        Specified by:
        test in interface java.util.function.Predicate<io.netty.handler.codec.http.HttpMethod>
        Parameters:
        method - an HttpMethod
        Returns:
        true if the specified method matches this matcher, false otherwise