Package org.apache.calcite.util
Interface Litmus
- All Known Implementing Classes:
HintStrategyTable.HintErrorLogger
public interface Litmus
Callback to be called when a test for validity succeeds or fails.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleanChecks a condition.booleanCalled when test fails.default booleansucceed()Called when test succeeds.default LitmuswithMessageArgs(@Nullable String message, @Nullable Object... args) Creates a Litmus that, if it fails, will use the given arguments.
-
Field Details
-
THROW
Implementation ofLitmusthat throws anAssertionErroron failure. -
IGNORE
Implementation ofLitmusthat returns a status code but does not throw.
-
-
Method Details
-
fail
Called when test fails. Returns false or throws.- Parameters:
message- Messageargs- Arguments
-
succeed
default boolean succeed()Called when test succeeds. Returns true. -
check
Checks a condition.If the condition is true, calls
succeed(); if the condition is false, callsfail(java.lang.String, java.lang.Object...), convertinginfointo a string message. -
withMessageArgs
Creates a Litmus that, if it fails, will use the given arguments.
-