Class GlobalValidationResult
java.lang.Object
org.broadleafcommerce.openadmin.server.service.persistence.validation.GlobalValidationResult
- Direct Known Subclasses:
PropertyValidationResult
DTO representing a boolean whether or not it passed validation and String error message. An error message is not required
if the result is not an error.
This is most suitable for global errors like those from RowLevelSecurityService
- Author:
- Phillip Verheyden (phillipuniverse)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGlobalValidationResult(boolean valid) GlobalValidationResult(boolean valid, String errorMessage) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddErrorMessage(String errorMessageOrKey) Adds an error message to the list of error messagesConvenience method to return the first messagebooleanOpposite ofisValid()booleanisValid()voidsetErrorMessage(String errorMessage) Deprecated.voidsetErrorMessages(List<String> errorMessages) voidsetValid(boolean valid) Set the validation result for this property
-
Field Details
-
valid
protected boolean valid -
errorMessages
-
-
Constructor Details
-
GlobalValidationResult
-
GlobalValidationResult
public GlobalValidationResult(boolean valid)
-
-
Method Details
-
isValid
public boolean isValid()- Returns:
- Whether or not this property passed validation
-
setValid
public void setValid(boolean valid) Set the validation result for this property- Parameters:
valid-
-
isNotValid
public boolean isNotValid()Opposite ofisValid()- Returns:
-
getErrorMessage
Convenience method to return the first message- Returns:
- the error message (or key in a message bundle) for the validation failure
-
setErrorMessage
Deprecated.- useaddErrorMessage(String)Sets the error message (or key in a message bundle) for the validation failure. If you have some sort of custom error message for the validation failure it should be set here- Parameters:
errorMessage-
-
addErrorMessage
Adds an error message to the list of error messages- Parameters:
errorMessageOrKey-
-
getErrorMessages
-
setErrorMessages
-
addErrorMessage(String)