All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.testingsyndicate.jms.responder.matcher.AnyMatcher Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
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));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy