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 boolean
Checks a condition.boolean
Called when test fails.default boolean
succeed()
Called when test succeeds.default Litmus
withMessageArgs
(@Nullable String message, @Nullable Object... args) Creates a Litmus that, if it fails, will use the given arguments.
-
Field Details
-
THROW
Implementation ofLitmus
that throws anAssertionError
on failure. -
IGNORE
Implementation ofLitmus
that 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...)
, convertinginfo
into a string message. -
withMessageArgs
Creates a Litmus that, if it fails, will use the given arguments.
-