Class WebRequestMethodsRule

  • All Implemented Interfaces:
    WebRequestRule

    public class WebRequestMethodsRule
    extends AbstractWebRequestRule<java.lang.String>
    WebRequest Methods WebRequestRule

    A logical disjunction (' || ') request condition that matches a request against a set of RequestMethods.

    Since:
    1.0.0
    Author:
    Rossen Stoyanchev, Mercy
    See Also:
    org.springframework.web.servlet.mvc.condition.RequestMethodsRequestCondition, org.springframework.web.reactive.result.condition.RequestMethodsRequestCondition
    • Constructor Summary

      Constructors 
      Constructor Description
      WebRequestMethodsRule​(java.lang.String method, java.lang.String... others)  
      WebRequestMethodsRule​(org.springframework.web.bind.annotation.RequestMethod... requestMethods)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected java.util.Collection<java.lang.String> getContent()
      Return the discrete items a request condition is composed of.
      protected java.lang.String getToStringInfix()
      The notation to use when printing discrete items of content.
      boolean matches​(java.lang.String method)  
      boolean matches​(org.springframework.web.context.request.NativeWebRequest request)  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • WebRequestMethodsRule

        public WebRequestMethodsRule​(org.springframework.web.bind.annotation.RequestMethod... requestMethods)
      • WebRequestMethodsRule

        public WebRequestMethodsRule​(java.lang.String method,
                                     java.lang.String... others)
    • Method Detail

      • getContent

        protected java.util.Collection<java.lang.String> getContent()
        Description copied from class: AbstractWebRequestRule
        Return the discrete items a request condition is composed of.

        For example URL patterns, HTTP request methods, param expressions, etc.

        Specified by:
        getContent in class AbstractWebRequestRule<java.lang.String>
        Returns:
        a collection of objects (never null)
      • getToStringInfix

        protected java.lang.String getToStringInfix()
        Description copied from class: AbstractWebRequestRule
        The notation to use when printing discrete items of content.

        For example " || " for URL patterns or " && " for param expressions.

        Specified by:
        getToStringInfix in class AbstractWebRequestRule<java.lang.String>
      • matches

        public boolean matches​(org.springframework.web.context.request.NativeWebRequest request)
      • matches

        public boolean matches​(java.lang.String method)