com.softicar.platform.common.core.java.classes.name.matcher.JavaClassNameMatcherCollection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.core.java.classes.name.matcher;
import com.softicar.platform.common.core.java.classes.name.JavaClassName;
import java.util.ArrayList;
import java.util.Collection;
public class JavaClassNameMatcherCollection implements IJavaClassNameMatcher {
private final Collection matchers;
public JavaClassNameMatcherCollection() {
this.matchers = new ArrayList<>();
}
public JavaClassNameMatcherCollection add(IJavaClassNameMatcher matcher) {
matchers.add(matcher);
return this;
}
public JavaClassNameMatcherCollection addAll(Collection otherMatchers) {
matchers.addAll(otherMatchers);
return this;
}
@Override
public boolean test(JavaClassName className) {
return matchers.stream().anyMatch(matcher -> matcher.test(className));
}
@Override
public String toString() {
return matchers.toString();
}
}