Package org.voltdb.utils
Class CompoundErrors
java.lang.Object
org.voltdb.utils.CompoundErrors
Helper that can be used to collect multiple errors that are encountered, e.g. while validating the parameters of any
 
Initializable class. This enables implementing a validation logic that will not stop at the first error, and
 return a message compounding multiple error messages.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddErrorMessage(String error) Add a new error message to the set of errors being returned from this validationCreates an error message comprised of all of the error messages added to this instance by callingaddErrorMessage(String).getErrorMessage(String separator) A specialized version ofgetErrorMessage(), using a specific separator.boolean
- 
Constructor Details- 
CompoundErrorspublic CompoundErrors()
 
- 
- 
Method Details- 
addErrorMessageAdd a new error message to the set of errors being returned from this validation- Parameters:
- error- message to add. If- nullthe message will be ignored
 
- 
hasErrorspublic boolean hasErrors()- Returns:
- trueif errors have been added to this instance
 
- 
getErrorMessageCreates an error message comprised of all of the error messages added to this instance by callingaddErrorMessage(String). If no error messages were added thennullis returned.This method uses a newline ('\n') character to separate the different error messages. - Returns:
- An error message or nullifhasErrors()returnsfalse
 
- 
getErrorMessageA specialized version ofgetErrorMessage(), using a specific separator.- Parameters:
- separator- String separating individual error messages in the final string.
- Returns:
- An error message or nullifhasErrors()returnsfalse
 
 
-