Package ch.njol.skript.lang
Interface VerboseAssert
public interface VerboseAssert
This interface provides methods for
Expected values should be the value being compared against, the source of truth.
Received values should be the value being tested, the value that may or may not be correct.
Condition
s to provide expected and received values for EffAssert
or others to use to in debugging or testing scenarios. Expected values should be the value being compared against, the source of truth.
Received values should be the value being tested, the value that may or may not be correct.
-
Method Summary
Modifier and TypeMethodDescriptiongetExpectedMessage
(org.bukkit.event.Event event) This method is intended to be used directly after"Expected "
and the grammar of the returned string should match.static String
getExpressionValue
(Expression<?> expression, org.bukkit.event.Event event) Helper method to simplify stringify-ing the values of expressions.getReceivedMessage
(org.bukkit.event.Event event) This method is intended to be used directly after"Expected x, but got "
and the grammar of the returned string should match.
-
Method Details
-
getExpectedMessage
This method is intended to be used directly after"Expected "
and the grammar of the returned string should match.- Parameters:
event
- The event used to evaluate this condition.- Returns:
- The expected value in this condition, formatted as a readable string.
-
getReceivedMessage
This method is intended to be used directly after"Expected x, but got "
and the grammar of the returned string should match.- Parameters:
event
- The event used to evaluate this condition.- Returns:
- The received value in this condition, formatted as a readable string.
-
getExpressionValue
Helper method to simplify stringify-ing the values of expressions. Evaluates the expression usingExpression.getAll(Event)
and stringifies usingClasses.toString(Object[], boolean)
.- Parameters:
expression
- The expression to evaluateevent
- The event used for evaluation- Returns:
- The string representation of the expression's value.
-