org.broadleafcommerce.openadmin.server.service.persistence.validation
Class PropertyValidationResult

java.lang.Object
  extended by org.broadleafcommerce.openadmin.server.service.persistence.validation.PropertyValidationResult

public class PropertyValidationResult
extends Object

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

Author:
Phillip Verheyden (phillipuniverse)
See Also:
PropertyValidator}

Field Summary
protected  String errorMessage
           
protected  boolean valid
           
 
Constructor Summary
PropertyValidationResult(boolean valid)
           
PropertyValidationResult(boolean valid, String errorMessage)
           
 
Method Summary
 String getErrorMessage()
           
 boolean isValid()
           
 void setErrorMessage(String errorMessage)
          Sets the error message (or key in a message bundle) for the validation failure.
 void setValid(boolean valid)
          Set the validation result for this property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

valid

protected boolean valid

errorMessage

protected String errorMessage
Constructor Detail

PropertyValidationResult

public PropertyValidationResult(boolean valid,
                                String errorMessage)

PropertyValidationResult

public PropertyValidationResult(boolean valid)
Method Detail

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 -

getErrorMessage

public String getErrorMessage()
Returns:
the error message (or key in a message bundle) for the validation failure

setErrorMessage

public void setErrorMessage(String errorMessage)
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 -


Copyright © 2013. All Rights Reserved.