public class MediaTypeServerWebExchangeMatcher extends java.lang.Object implements ServerWebExchangeMatcher
ServerWebExchangeMatcher.MatchResult
Constructor and Description |
---|
MediaTypeServerWebExchangeMatcher(java.util.Collection<org.springframework.http.MediaType> matchingMediaTypes)
Creates a new instance
|
MediaTypeServerWebExchangeMatcher(org.springframework.http.MediaType... matchingMediaTypes)
Creates a new instance
|
Modifier and Type | Method and 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() |
public MediaTypeServerWebExchangeMatcher(org.springframework.http.MediaType... matchingMediaTypes)
matchingMediaTypes
- the types to match onpublic MediaTypeServerWebExchangeMatcher(java.util.Collection<org.springframework.http.MediaType> matchingMediaTypes)
matchingMediaTypes
- the types to match onpublic reactor.core.publisher.Mono<ServerWebExchangeMatcher.MatchResult> matches(org.springframework.web.server.ServerWebExchange exchange)
ServerWebExchangeMatcher
matches
in interface ServerWebExchangeMatcher
public void setUseEquals(boolean useEquals)
MediaType
, else uses
MediaType.isCompatibleWith(MediaType)
.useEquals
- specify if equals comparison should be used.public void setIgnoredMediaTypes(java.util.Set<org.springframework.http.MediaType> ignoredMediaTypes)
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
.ignoredMediaTypes
- the MediaType
's to ignore from the
ContentNegotiationStrategy
public java.lang.String toString()
toString
in class java.lang.Object