com.twitter.finatra.validation
Utility for evaluating a condition in order to return a ValidationResult.
Utility for evaluating a condition in order to return a ValidationResult. Returns
ValidationResult.Valid when the condition is true
, otherwise if the condition
evaluates to false
or throws an exception a ValidationResult.Invalid will be returned.
In the case of an exception, the exception.getMessage
is used in place of the given message.
function to evaluate for validation.
function to evaluate for a message when the given condition is false
.
ErrorCode to use for when the given condition is false
.
a ValidationResult.Valid when the condition is true
otherwise a ValidationResult.Invalid.
This will not allow a non-fatal exception to escape. Instead a ValidationResult.Invalid
will be returned when a non-fatal exception is encountered when evaluating condition
. As
this equates failure to execute the condition function to a return of false
.
Utility for evaluating the negation of a condition in order to return a ValidationResult.
Utility for evaluating the negation of a condition in order to return a ValidationResult.
Returns ValidationResult.Valid when the condition is false
, otherwise if the condition
evaluates to true
or throws an exception a ValidationResult.Invalid will be returned.
In the case of an exception, the exception.getMessage
is used in place of the given message.
function to evaluate for validation.
function to evaluate for a message when the given condition is true
.
ErrorCode to use for when the given condition is true
.
a ValidationResult.Valid when the condition is false
or when the condition evaluation
throws a NonFatal exception otherwise a ValidationResult.Invalid.
This will not allow a non-fatal exception to escape. Instead a ValidationResult.Valid
will be returned when a non-fatal exception is encountered when evaluating condition
. As
this equates failure to execute the condition to a return of false
.