Class ValidationResult
java.lang.Object
se.conciliate.extensions.documents.ValidationResult
- Direct Known Subclasses:
ValidationResult.ErrorValidation
,ValidationResult.SuccessValidation
,ValidationResult.WarningValidation
A validation result is returned from a validation. Validations can be performed
by some InputDescriptors. It is used to indicate that entered data is erroneous
by either giving a warning (the data is allowed but may not be what the user
expects) or as an error (the data is not allowed).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
static final class
static final class
-
Method Summary
Modifier and TypeMethodDescriptionstatic ValidationResult
Creates an error validation result indicating that the entered data is not allowed.abstract String
static ValidationResult
success()
Creates a success validation result indicating no errors.static ValidationResult
Creates a warning validation result indicating that the entered data is unexpected.
-
Method Details
-
getValidationMessage
-
error
Creates an error validation result indicating that the entered data is not allowed. The message is used to inform users what went wrong and should typically state what can be done to correct the data.- Parameters:
msg
- A message string to present to the user.- Returns:
- A new validation result indicating that the data is not allowed. The data will not be persisted.
-
warning
Creates a warning validation result indicating that the entered data is unexpected. This is typically used to inform users that the data already exists or is out of range. For example a url that is already in use or a date that has not yet happened.- Parameters:
msg
- The message explaining to the user what the problem is.- Returns:
- A new validation result indicating that the data is unexpected although allowed. The data can be persisted if the user chooses to do so.
-
success
Creates a success validation result indicating no errors.- Returns:
- A new validation result indicating that the data is ok.
-