com.testingsyndicate.jms.responder.matcher.AnyMatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jms-responder-core Show documentation
Show all versions of jms-responder-core Show documentation
A stub for JMS Request/Reply
package com.testingsyndicate.jms.responder.matcher;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.testingsyndicate.jms.responder.model.Request;
import java.util.Arrays;
import java.util.Collection;
public final class AnyMatcher implements Matcher {
private final Collection matchers;
@JsonCreator
public AnyMatcher(@JsonProperty("matchers") Matcher... matchers) {
this.matchers = Arrays.asList(matchers);
}
@Override
public boolean matches(Request request) {
return matchers
.stream()
.anyMatch(m -> m.matches(request));
}
}