Class ValidationResult

java.lang.Object
org.ametys.runtime.parameter.ValidationResult

public class ValidationResult extends Object
Result structure to populate on validation. The result can contain information, warnings and errors
See Also:
  • Constructor Details

  • Method Details

    • hasInfos

      public boolean 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

      public void addInfo(I18nizableText infoLabel)
      Add an information.
      Parameters:
      infoLabel - the information label.
    • addInfos

      public void addInfos(List<I18nizableText> infoLabels)
      Add several information.
      Parameters:
      infoLabels - the information labels.
    • hasWarnings

      public boolean 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

      public void addWarning(I18nizableText warningLabel)
      Add a warning.
      Parameters:
      warningLabel - the warning label.
    • addWarnings

      public void addWarnings(List<I18nizableText> warningLabels)
      Add warnings.
      Parameters:
      warningLabels - the warning labels.
    • hasErrors

      public boolean 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

      public void addError(I18nizableText errorLabel)
      Add an error.
      Parameters:
      errorLabel - the error label.
    • addErrors

      public void addErrors(List<I18nizableText> errorLabels)
      Add errors.
      Parameters:
      errorLabels - the error labels.
    • addResult

      public void addResult(ValidationResult result)
      Add items of the given result to the current one
      Parameters:
      result - the result to add
    • isEmpty

      public boolean isEmpty()
      Check if the current result is empty
      Returns:
      true if the result is empty, false otherwise
    • empty

      public static ValidationResult empty()
      Retrieves an empty instance of ValidationResult
      Returns:
      an empty ValidationResult