Interface IValidationResult


public interface IValidationResult
Result of a validation. The method of registering results is left to each implementation.

Usage: Implement a subinterface of this

  • Method Details

    • getErrors

      Collection<String> getErrors()
      Method to retrieve all registered errors as a collection of Strings
      Returns:
      list of all error messages
    • getNonFatalErrors

      Collection<String> getNonFatalErrors()
      Method to retrieve all registered non-fatal errors as a collection of Strings
      Returns:
      list of non-fatal error messages
    • getFatalErrors

      Collection<String> getFatalErrors()
      Method to retrieve all registered fatal errors as a collection of Strings
      Returns:
      list of fatal error messages
    • getWarnings

      Collection<String> getWarnings()
      Method to retrieve all registered warnings as a collection of Strings
      Returns:
      list of warning messages
    • addError

      void addError(String message)
      Adds a non-fatal error to the result
      Parameters:
      message - description
    • addFatalError

      void addFatalError(String message)
      Adds a fatal error to the result
      Parameters:
      message - description
    • addWarning

      void addWarning(String warning)
      Adds a warning to the result
      Parameters:
      warning - description
    • addAdditionalData

      default void addAdditionalData(String prefix, String key, String value)
      Adds additional data to the result.

      Does not affect the outcome of the validation.

      Extra helper methods for manipulating additional data is available on the AdditionalData object returned from getAdditionalData()

      Parameters:
      prefix - prefix of the data
      key - key of the data
      value - value of the data
    • hasErrors

      default boolean hasErrors()
      Returns:
      whether there are any errors, fatal or non-fatal
    • hasNonFatalErrors

      boolean hasNonFatalErrors()
      Returns:
      whether there are any non-fatal errors
    • hasFatalErrors

      boolean hasFatalErrors()
      Returns:
      whether there are any fatal errors
    • hasWarnings

      boolean hasWarnings()
      Returns:
      whether there are any warnings
    • getAdditionalData

      AdditionalData getAdditionalData()
      Returns:
      any additional data that has been added to the result