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

com.testingsyndicate.jms.responder.matcher.AllMatcher 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.RequestInfo;

import java.util.Arrays;
import java.util.Collection;

public final class AllMatcher implements Matcher {

    private final Collection matchers;

    @JsonCreator
    public AllMatcher(@JsonProperty("matchers") Matcher... matchers) {
        this.matchers = Arrays.asList(matchers);
    }

    @Override
    public boolean matches(RequestInfo requestInfo) {
        return matchers
                .stream()
                .allMatch(m -> m.matches(requestInfo));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy