Package org.ametys.runtime.parameter
Class ValidationResult
java.lang.Object
org.ametys.runtime.parameter.ValidationResult
Result structure to populate on validation. The result can contain information, warnings and errors
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addError
(I18nizableText errorLabel) Add an error.void
addErrors
(List<I18nizableText> errorLabels) Add errors.void
addInfo
(I18nizableText infoLabel) Add an information.void
addInfos
(List<I18nizableText> infoLabels) Add several information.void
addResult
(ValidationResult result) Add items of the given result to the current onevoid
addWarning
(I18nizableText warningLabel) Add a warning.void
addWarnings
(List<I18nizableText> warningLabels) Add warnings.static ValidationResult
empty()
Retrieves an empty instance ofValidationResult
Retrieves the errors.getInfos()
Retrieves the information.Retrieves the warnings.boolean
Tests if there were any errors.boolean
hasInfos()
Tests if there were any information.boolean
Tests if there were any warnings.boolean
isEmpty()
Check if the current result is empty
-
Constructor Details
-
ValidationResult
public ValidationResult()
-
-
Method Details
-
hasInfos
Tests if there were any information.- Returns:
true
if there is at least one information,false
if there is no information.
-
getInfos
Retrieves the information.- Returns:
- the information.
-
addInfo
Add an information.- Parameters:
infoLabel
- the information label.
-
addInfos
Add several information.- Parameters:
infoLabels
- the information labels.
-
hasWarnings
Tests if there were any warnings.- Returns:
true
if there is at least one warning,false
if there is no warning.
-
getWarnings
Retrieves the warnings.- Returns:
- the warnings.
-
addWarning
Add a warning.- Parameters:
warningLabel
- the warning label.
-
addWarnings
Add warnings.- Parameters:
warningLabels
- the warning labels.
-
hasErrors
Tests if there were any errors.- Returns:
true
if there is at least one error,false
if there is no error.
-
getErrors
Retrieves the errors.- Returns:
- the errors.
-
addError
Add an error.- Parameters:
errorLabel
- the error label.
-
addErrors
Add errors.- Parameters:
errorLabels
- the error labels.
-
addResult
Add items of the given result to the current one- Parameters:
result
- the result to add
-
isEmpty
Check if the current result is empty- Returns:
true
if the result is empty,false
otherwise
-
empty
Retrieves an empty instance ofValidationResult
- Returns:
- an empty
ValidationResult
-