Package org.mockserver.matchers
Interface Matcher<T>
- All Known Subinterfaces:
HttpRequestMatcher
- All Known Implementing Classes:
AbstractHttpRequestMatcher,BinaryMatcher,BinaryRequestPropertiesMatcher,BodyMatcher,BooleanMatcher,DnsRequestPropertiesMatcher,ExactStringMatcher,GraphQLMatcher,HashMapMatcher,HttpRequestPropertiesMatcher,HttpRequestsPropertiesMatcher,JsonPathMatcher,JsonRpcMatcher,JsonSchemaMatcher,JsonStringMatcher,MultiValueMapMatcher,NotMatcher,ParameterStringMatcher,RegexStringMatcher,SubStringMatcher,WasmBodyMatcher,XmlSchemaMatcher,XmlStringMatcher,XPathMatcher
public interface Matcher<T>
Base interface for all matchers in MockServer.
Null/Blank Matcher Behavior: When a matcher is null or blank (as determined by
isBlank()), it matches all values. This "match-all" behavior is intentional
and improves the user experience when creating expectations. Matchers act as filters: if a
filter is not specified (null/blank), everything passes through.
For example, if an expectation does not specify a path matcher, it will match requests with any path. This allows users to create expectations that match broadly without explicitly specifying wildcards or "match anything" patterns for every field.
- Author:
- jamesdbloom
-
Method Summary
Modifier and TypeMethodDescriptionbooleanisBlank()booleanmatches(MatchDifference context, T t)
-
Method Details
-
matches
-
isBlank
boolean isBlank()
-