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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddError(I18nizableText errorLabel) Add an error.voidaddErrors(List<I18nizableText> errorLabels) Add errors.voidaddInfo(I18nizableText infoLabel) Add an information.voidaddInfos(List<I18nizableText> infoLabels) Add several information.voidaddResult(ValidationResult result) Add items of the given result to the current onevoidaddWarning(I18nizableText warningLabel) Add a warning.voidaddWarnings(List<I18nizableText> warningLabels) Add warnings.static ValidationResultempty()Retrieves an empty instance ofValidationResultRetrieves the errors.getInfos()Retrieves the information.Retrieves the warnings.booleanTests if there were any errors.booleanhasInfos()Tests if there were any information.booleanTests if there were any warnings.booleanisEmpty()Check if the current result is empty
-
Constructor Details
-
ValidationResult
public ValidationResult()
-
-
Method Details
-
hasInfos
Tests if there were any information.- Returns:
trueif there is at least one information,falseif 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:
trueif there is at least one warning,falseif 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:
trueif there is at least one error,falseif 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:
trueif the result is empty,falseotherwise
-
empty
Retrieves an empty instance ofValidationResult- Returns:
- an empty
ValidationResult
-