Class MediaTypeServerWebExchangeMatcher

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      reactor.core.publisher.Mono<ServerWebExchangeMatcher.MatchResult> matches​(org.springframework.web.server.ServerWebExchange exchange)
      Determines if a request matches or not
      void setIgnoredMediaTypes​(java.util.Set<org.springframework.http.MediaType> ignoredMediaTypes)
      Set the MediaType to ignore from the ContentNegotiationStrategy.
      void setUseEquals​(boolean useEquals)
      If set to true, matches on exact MediaType, else uses MediaType.isCompatibleWith(MediaType).
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • MediaTypeServerWebExchangeMatcher

        public MediaTypeServerWebExchangeMatcher​(org.springframework.http.MediaType... matchingMediaTypes)
        Creates a new instance
        Parameters:
        matchingMediaTypes - the types to match on
      • MediaTypeServerWebExchangeMatcher

        public MediaTypeServerWebExchangeMatcher​(java.util.Collection<org.springframework.http.MediaType> matchingMediaTypes)
        Creates a new instance
        Parameters:
        matchingMediaTypes - the types to match on
    • Method Detail

      • setUseEquals

        public void setUseEquals​(boolean useEquals)
        If set to true, matches on exact MediaType, else uses MediaType.isCompatibleWith(MediaType).
        Parameters:
        useEquals - specify if equals comparison should be used.
      • setIgnoredMediaTypes

        public void setIgnoredMediaTypes​(java.util.Set<org.springframework.http.MediaType> ignoredMediaTypes)
        Set the MediaType to ignore from the ContentNegotiationStrategy. This is useful if for example, you want to match on MediaType.APPLICATION_JSON but want to ignore MediaType.ALL.
        Parameters:
        ignoredMediaTypes - the MediaType's to ignore from the ContentNegotiationStrategy
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object