Package net.codecrete.qrbill.generator
Class ValidationResult
- java.lang.Object
-
- net.codecrete.qrbill.generator.ValidationResult
-
- All Implemented Interfaces:
java.io.Serializable
public class ValidationResult extends java.lang.Object implements java.io.SerializableContainer for validation results- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValidationResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMessage(ValidationMessage.Type type, java.lang.String field, java.lang.String messageKey)Adds a validation message to this validation resultvoidaddMessage(ValidationMessage.Type type, java.lang.String field, java.lang.String messageKey, java.lang.String[] messageParameters)Adds a validation message to this validation resultBillgetCleanedBill()Gets the cleaned bill datajava.util.List<ValidationMessage>getValidationMessages()Gets the list of validation messagesbooleanhasErrors()Gets if this validation result contains any error messagesbooleanhasMessages()Gets if this validation result contains any messagesbooleanhasWarnings()Gets 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
-
-
-
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:
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
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 typefield- the name of the affected fieldmessageKey- 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 typefield- the name of the affected fieldmessageKey- the language-netural message keymessageParameters- 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
-
-