Class ValidationResult

java.lang.Object
com.aquima.interactions.rule.validation.ValidationResult
All Implemented Interfaces:
IValidationResult

public class ValidationResult extends Object implements IValidationResult
This class holds the result of a validation action.
Since:
5.0
Author:
O. Kerpershoek
  • Constructor Details

    • ValidationResult

      protected ValidationResult(ValueReference attribute)
  • Method Details

    • addMessage

      protected void addMessage(ValidationMessage message)
    • getAttribute

      public ValueReference getAttribute()
      Description copied from interface: IValidationResult
      This method returns the attribute that the validation was performed on.
      Specified by:
      getAttribute in interface IValidationResult
      Returns:
      A reference to the value that was validated.
    • isValid

      public boolean isValid()
      Description copied from interface: IValidationResult
      This method returns the (global) result of the validation action. When this method returns true, all validations that have been defined for the attribute did succeed. When the method returns false, one or more validations failed, and the getMessages method can be used to query for the details about the failed validations.
      Specified by:
      isValid in interface IValidationResult
      Returns:
      boolean indicating if all the validations succeeded.
    • getMessages

      public IValidationMessage[] getMessages()
      Description copied from interface: IValidationResult
      This method returns an array of validation messages. When all the validation did succeed (the isValid method returns true) this method will return an empty array.
      Specified by:
      getMessages in interface IValidationResult
      Returns:
      array containing all the validation messages of the failed validations.