io.magentys.cinnamon.webdriver.conditions.NotCondition Maven / Gradle / Ivy
package io.magentys.cinnamon.webdriver.conditions;
import io.magentys.cinnamon.webdriver.conditions.Condition;
public class NotCondition extends Condition {
private final Condition condition;
public NotCondition(final Condition condition) {
this.condition = condition;
}
@Override
public boolean apply(final T t) {
try {
return !condition.apply(t);
} catch (Exception e) {
return false;
}
}
@Override
public String toString() {
return "not(" + condition.toString() + ")";
}
}