Package org.openqa.selenium.internal
Class Require
- java.lang.Object
-
- org.openqa.selenium.internal.Require
-
public final class Require extends java.lang.ObjectA utility class to check arguments (preconditions) and state.Examples of use:
public void setActionWithTimeout(Action action delegate, int timeout) { this.action = Require.nonNull("Action", action); this.timeout = Require.positive("Timeout", timeout); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRequire.ArgumentChecker<T>static classRequire.FileCheckerstatic classRequire.FileStateCheckerstatic classRequire.IntCheckerstatic classRequire.PathStateCheckerstatic classRequire.StateChecker<T>
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Require.FileCheckerargument(java.lang.String argName, java.io.File file)static Require.IntCheckerargument(java.lang.String argName, java.lang.Integer number)static <T> Require.ArgumentChecker<T>argument(java.lang.String argName, T arg)static intnonNegative(java.lang.String argName, java.lang.Integer number)static java.time.DurationnonNegative(java.lang.String argName, java.time.Duration arg)static java.time.DurationnonNegative(java.time.Duration arg)static <T> TnonNull(java.lang.String argName, T arg)static <T> TnonNull(java.lang.String argName, T arg, java.lang.String message, java.lang.Object... args)static intpositive(java.lang.String argName, java.lang.Integer number)static voidprecondition(boolean condition, java.lang.String message, java.lang.Object... args)static Require.FileStateCheckerstate(java.lang.String name, java.io.File file)static Require.PathStateCheckerstate(java.lang.String name, java.nio.file.Path path)static <T> Require.StateChecker<T>state(java.lang.String name, T state)static voidstateCondition(boolean state, java.lang.String message, java.lang.Object... args)
-
-
-
Method Detail
-
precondition
public static void precondition(boolean condition, java.lang.String message, java.lang.Object... args)
-
nonNull
public static <T> T nonNull(java.lang.String argName, T arg)
-
nonNull
public static <T> T nonNull(java.lang.String argName, T arg, java.lang.String message, java.lang.Object... args)
-
argument
public static <T> Require.ArgumentChecker<T> argument(java.lang.String argName, T arg)
-
nonNegative
public static java.time.Duration nonNegative(java.lang.String argName, java.time.Duration arg)
-
nonNegative
public static java.time.Duration nonNegative(java.time.Duration arg)
-
nonNegative
public static int nonNegative(java.lang.String argName, java.lang.Integer number)
-
positive
public static int positive(java.lang.String argName, java.lang.Integer number)
-
argument
public static Require.IntChecker argument(java.lang.String argName, java.lang.Integer number)
-
argument
public static Require.FileChecker argument(java.lang.String argName, java.io.File file)
-
stateCondition
public static void stateCondition(boolean state, java.lang.String message, java.lang.Object... args)
-
state
public static <T> Require.StateChecker<T> state(java.lang.String name, T state)
-
state
public static Require.FileStateChecker state(java.lang.String name, java.io.File file)
-
state
public static Require.PathStateChecker state(java.lang.String name, java.nio.file.Path path)
-
-