org.mockserver.matchers.MapMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mockserver-core Show documentation
Show all versions of mockserver-core Show documentation
Functionality used by all MockServer modules for matching and expectations
package org.mockserver.matchers;
import org.mockserver.collections.CaseInsensitiveRegexMultiMap;
import org.mockserver.model.EqualsHashCodeToString;
import org.mockserver.model.KeyToMultiValue;
import java.util.List;
/**
* @author jamesdbloom
*/
public class MapMatcher extends EqualsHashCodeToString implements Matcher> {
private final CaseInsensitiveRegexMultiMap multiMap;
public MapMatcher(CaseInsensitiveRegexMultiMap multiMap) {
this.multiMap = multiMap;
}
public boolean matches(List values) {
boolean result = false;
if (KeyToMultiValue.toMultiMap(values).containsAll(multiMap)) {
result = true;
} else {
logger.trace("Map [{}] is not a subset of [{}]", this.multiMap, KeyToMultiValue.toMultiMap(values));
}
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy