Class ValidationResult

java.lang.Object
net.codecrete.qrbill.generator.ValidationResult
All Implemented Interfaces:
Serializable

public class ValidationResult extends Object implements Serializable
Container for validation results
See Also:
  • Constructor Details

    • ValidationResult

      public ValidationResult()
      Creates a new validation result instance
  • Method Details

    • getValidationMessages

      public List<ValidationMessage> getValidationMessages()
      Gets the list of validation messages
      Returns:
      the validation messages
    • hasMessages

      public boolean hasMessages()
      Gets if this validation result contains any messages
      Returns:
      true if there are validation messages, false otherwise
    • hasWarnings

      public boolean hasWarnings()
      Gets if this validation result contains any warning messages
      Returns:
      true if there are any warning messages, false otherwise
    • hasErrors

      public boolean hasErrors()
      Gets if this validation result contains any error messages
      Returns:
      true if there are any error messages, false otherwise
    • isValid

      public boolean isValid()
      Gets if the bill data is valid and the validation therefore has succeeded
      Returns:
      true if the bill data was valid, false otherwise
    • addMessage

      public void addMessage(ValidationMessage.Type type, String field, String messageKey)
      Adds a validation message to this validation result
      Parameters:
      type - the message type
      field - the name of the affected field
      messageKey - the language-neutral message key
    • addMessage

      public void addMessage(ValidationMessage.Type type, String field, String messageKey, String[] messageParameters)
      Adds a validation message to this validation result
      Parameters:
      type - the message type
      field - the name of the affected field
      messageKey - the language-neutral message key
      messageParameters - additional message parameters (text) to be inserted into the localized message
    • getCleanedBill

      public Bill getCleanedBill()
      Gets the cleaned bill data
      Returns:
      the cleaned bill data
    • setCleanedBill

      public void setCleanedBill(Bill cleanedBill)
      Sets the cleaned bill data
      Parameters:
      cleanedBill - the cleaned bill data
    • getDescription

      public String getDescription()
      Gets a human-readable description of the validation problems.
      Returns:
      description