com.github.dreamhead.moco.matcher.OrRequestMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of moco-core Show documentation
Show all versions of moco-core Show documentation
Moco is an easy setup stub framework, mainly focusing on testing and integration.
package com.github.dreamhead.moco.matcher;
import com.github.dreamhead.moco.Request;
import com.github.dreamhead.moco.RequestMatcher;
public class OrRequestMatcher extends CompositeRequestMatcher {
public OrRequestMatcher(Iterable matchers) {
super(matchers);
}
@Override
public boolean match(final Request request) {
for (RequestMatcher matcher : matchers) {
if (matcher.match(request)) {
return true;
}
}
return false;
}
@Override
protected RequestMatcher newMatcher(Iterable matchers) {
return new OrRequestMatcher(matchers);
}
}