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

io.magentys.cinnamon.webdriver.conditions.NotCondition Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
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() + ")";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy