Class ValidationResult

  • All Implemented Interfaces:
    java.io.Serializable

    public class ValidationResult
    extends java.lang.Object
    implements java.io.Serializable
    Container for validation results
    See Also:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addMessage​(ValidationMessage.Type type, java.lang.String field, java.lang.String messageKey)
      Adds a validation message to this validation result
      void addMessage​(ValidationMessage.Type type, java.lang.String field, java.lang.String messageKey, java.lang.String[] messageParameters)
      Adds a validation message to this validation result
      Bill getCleanedBill()
      Gets the cleaned bill data
      java.util.List<ValidationMessage> getValidationMessages()
      Gets the list of validation messages
      boolean hasErrors()
      Gets if this validation result contains any error messages
      boolean hasMessages()
      Gets if this validation result contains any messages
      boolean hasWarnings()
      Gets if this validation result contains any warning messages
      boolean isValid()
      Gets if the bill data is valid and the validation therefore has succeeded
      void setCleanedBill​(Bill cleanedBill)
      Sets the cleaned bill data
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ValidationResult

        public ValidationResult()
    • Method Detail

      • getValidationMessages

        public java.util.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,
                               java.lang.String field,
                               java.lang.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-netural message key
      • addMessage

        public void addMessage​(ValidationMessage.Type type,
                               java.lang.String field,
                               java.lang.String messageKey,
                               java.lang.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-netural 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 cleand bill data
      • setCleanedBill

        public void setCleanedBill​(Bill cleanedBill)
        Sets the cleaned bill data
        Parameters:
        cleanedBill - the cleand bill data