Interface VerboseAssert


public interface VerboseAssert
This interface provides methods for Conditions 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 Type
    Method
    Description
    getExpectedMessage(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

      String getExpectedMessage(org.bukkit.event.Event event)
      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

      String 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.
      Parameters:
      event - The event used to evaluate this condition.
      Returns:
      The received value in this condition, formatted as a readable string.
    • getExpressionValue

      static String getExpressionValue(Expression<?> expression, org.bukkit.event.Event event)
      Helper method to simplify stringify-ing the values of expressions. Evaluates the expression using Expression.getAll(Event) and stringifies using Classes.toString(Object[], boolean).
      Parameters:
      expression - The expression to evaluate
      event - The event used for evaluation
      Returns:
      The string representation of the expression's value.