net.serenitybdd.screenplay.conditions.Check Maven / Gradle / Ivy
package net.serenitybdd.screenplay.conditions;
import net.serenitybdd.screenplay.Question;
import org.hamcrest.Matcher;
public class Check {
public static ConditionalPerformable whether(Boolean condition) {
return new ConditionalPerformableOnBoolean(condition);
}
public static ConditionalPerformable whether(Question condition) {
return new ConditionalPerformableOnQuestion(condition);
}
public static ConditionalPerformable whether(Question extends T> question, Matcher matcher) {
Question condition = actor -> matcher.matches(question.answeredBy(actor));
return new ConditionalPerformableOnQuestion(condition);
}
}