
com.codeborne.selenide.ObjectCondition Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of selenide-core Show documentation
Show all versions of selenide-core Show documentation
Selenide = concise API for Selenium WebDriver
package com.codeborne.selenide;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;
import static com.codeborne.selenide.CheckResult.accepted;
import static com.codeborne.selenide.CheckResult.rejected;
@ParametersAreNonnullByDefault
public interface ObjectCondition {
@Nonnull
@CheckReturnValue
String description();
@Nonnull
@CheckReturnValue
String negativeDescription();
@CheckReturnValue
CheckResult check(T object);
@Nullable
@CheckReturnValue
String expectedValue();
@Nonnull
@CheckReturnValue
String describe(T object);
default String message(T object) {
return describe(object) + " " + description();
}
default CheckResult result(T object, boolean met, @Nullable Object actualValue) {
return met ? accepted(actualValue) : rejected(message(object), actualValue);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy