check
Checks a boolean condition and throws WowException if false.
This method validates that the given condition is true. If the condition evaluates to false, it throws a WowException with the specified error code and message.
Example usage:
Preconditions.check(userId.isNotBlank(), ErrorCodes.ILLEGAL_ARGUMENT) {
"User ID cannot be blank"
}Content copied to clipboard
Parameters
value
the condition to check
errorCode
the error code to use if the condition fails
lazyMessage
a lazy function that provides the error message
Throws
if the condition is false