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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMessage(ValidationMessage.Type type, String field, String messageKey) Adds a validation message to this validation resultvoidaddMessage(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 messagesbooleanGets if this validation result contains any error messagesbooleanGets if this validation result contains any messagesbooleanGets if this validation result contains any warning messagesbooleanisValid()Gets if the bill data is valid and the validation therefore has succeededvoidsetCleanedBill(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:
trueif there are validation messages,falseotherwise
-
hasWarnings
public boolean hasWarnings()Gets if this validation result contains any warning messages- Returns:
trueif there are any warning messages,falseotherwise
-
hasErrors
public boolean hasErrors()Gets if this validation result contains any error messages- Returns:
trueif there are any error messages,falseotherwise
-
isValid
public boolean isValid()Gets if the bill data is valid and the validation therefore has succeeded- Returns:
trueif the bill data was valid,falseotherwise
-
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
-