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

pl.allegro.tech.hermes.management.infrastructure.query.matcher.AndMatcher Maven / Gradle / Ivy

There is a newer version: 2.8.0
Show newest version
package pl.allegro.tech.hermes.management.infrastructure.query.matcher;

import java.util.Collection;

public class AndMatcher implements Matcher {

  private Collection matchers;

  public AndMatcher(Collection matchers) {
    this.matchers = matchers;
  }

  @Override
  public boolean match(Object value) {
    return matchers.stream()
        .reduce(
            true,
            (match, matcher) -> match && matcher.match(value),
            (first, second) -> first && second);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy