Currently UftpValidator only supports 1 rejection reason (through getReason) which cannot be made context specific to the validated message.
Case 1
E.g. a user defined validator that checks the ExpirationDateTime must be before Period-12H.
Currently the reason would always be: "ExpirationDateTime must at least 12H before Period"
Desired reason: "ExpirationDateTime must be before YYYY-MM-DDTHH:mm:ss"
Case 2
E.g. a user defined validator that combines 2 checks and wants to give a specific reason for each of the cases. Currently this would require two separate validator classes that each must have the correct order.
Proposal:
Let isValid return a ValidationResult including the reason instead of a boolean. Remove getReason.
Currently UftpValidator only supports 1 rejection reason (through
getReason) which cannot be made context specific to the validated message.Case 1
E.g. a user defined validator that checks the ExpirationDateTime must be before Period-12H.
Currently the reason would always be: "ExpirationDateTime must at least 12H before Period"
Desired reason: "ExpirationDateTime must be before YYYY-MM-DDTHH:mm:ss"
Case 2
E.g. a user defined validator that combines 2 checks and wants to give a specific reason for each of the cases. Currently this would require two separate validator classes that each must have the correct order.
Proposal:
Let
isValidreturn aValidationResultincluding the reason instead of a boolean. RemovegetReason.