edu.isi.nlp.validators.And Maven / Gradle / Ivy
The newest version!
package edu.isi.nlp.validators;
import com.google.common.collect.Lists;
import java.util.List;
public class And implements Validator {
public And(Validator a, Validator b) {
validators.add(a);
validators.add(b);
}
public And(List> validators) {
this.validators.addAll(validators);
}
/**
* Calls each of its child validators on the input, short-circuiting and propagating if one throws
* an exception.
*/
@Override
public void validate(T arg) throws ValidationException {
for (final Validator validator : validators) {
validator.validate(arg);
}
}
private final List> validators = Lists.newArrayList();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy