Package net.codecrete.qrbill.generator
Class ValidationResult
java.lang.Object
net.codecrete.qrbill.generator.ValidationResult
- All Implemented Interfaces:
Serializable
Container for validation results
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMessage
(ValidationMessage.Type type, String field, String messageKey) Adds a validation message to this validation resultvoid
addMessage
(ValidationMessage.Type type, String field, String messageKey, String[] messageParameters) Adds a validation message to this validation resultGets the cleaned bill dataGets a human-readable description of the validation problems.Gets the list of validation messagesboolean
Gets if this validation result contains any error messagesboolean
Gets if this validation result contains any messagesboolean
Gets if this validation result contains any warning messagesboolean
isValid()
Gets if the bill data is valid and the validation therefore has succeededvoid
setCleanedBill
(Bill cleanedBill) Sets the cleaned bill data
-
Constructor Details
-
ValidationResult
public ValidationResult()Creates a new validation result instance
-
-
Method Details
-
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
Adds a validation message to this validation result- Parameters:
type
- the message typefield
- the name of the affected fieldmessageKey
- 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 typefield
- the name of the affected fieldmessageKey
- the language-neutral message keymessageParameters
- additional message parameters (text) to be inserted into the localized message
-
getCleanedBill
Gets the cleaned bill data- Returns:
- the cleaned bill data
-
setCleanedBill
Sets the cleaned bill data- Parameters:
cleanedBill
- the cleaned bill data
-
getDescription
Gets a human-readable description of the validation problems.- Returns:
- description
-