Package liquibase.exception
Class ValidationErrors
- java.lang.Object
-
- liquibase.exception.ValidationErrors
-
public class ValidationErrors extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected String
change
protected List<String>
errorMessages
protected List<String>
warningMessages
-
Constructor Summary
Constructors Constructor Description ValidationErrors()
ValidationErrors(String change)
ValidationErrors(Change change)
ValidationErrors(Precondition precondition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidationErrors
addAll(ValidationErrors validationErrors)
void
addAll(ValidationErrors validationErrors, ChangeSet changeSet)
ValidationErrors
addError(String message)
ValidationErrors
addError(String message, ChangeSet changeSet)
ValidationErrors
addWarning(String message)
void
checkDisallowedField(String disallowedFieldName, Object value, Database database, Class<? extends Database>... disallowedDatabases)
Checks if a field is forbidden in combination with a given Database (most often because that database does not implement the features required by the field/value combination).ValidationErrors
checkRequiredField(String requiredFieldName, Object value)
Convenience method forcheckRequiredField(String, Object, String, boolean)
with allowEmptyValue=falseValidationErrors
checkRequiredField(String requiredFieldName, Object value, boolean allowEmptyValue)
Convenience method forcheckRequiredField(String, Object, String, boolean)
with a null postfixValidationErrors
checkRequiredField(String requiredFieldName, Object value, String postfix)
Convenience method forcheckRequiredField(String, Object, String, boolean)
with allowEmptyValue=falseValidationErrors
checkRequiredField(String requiredFieldName, Object value, String postfix, boolean allowEmptyValue)
Checks that the given value is set.boolean
equals(Object obj)
String
getChangeName()
List<String>
getErrorMessages()
List<String>
getRequiredErrorMessages()
List<String>
getUnsupportedErrorMessages()
List<String>
getWarningMessages()
boolean
hasErrors()
int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
ValidationErrors
public ValidationErrors()
-
ValidationErrors
public ValidationErrors(String change)
-
ValidationErrors
public ValidationErrors(Change change)
-
ValidationErrors
public ValidationErrors(Precondition precondition)
-
-
Method Detail
-
hasErrors
public boolean hasErrors()
-
getChangeName
public String getChangeName()
-
checkRequiredField
public ValidationErrors checkRequiredField(String requiredFieldName, Object value)
Convenience method forcheckRequiredField(String, Object, String, boolean)
with allowEmptyValue=false
-
checkRequiredField
public ValidationErrors checkRequiredField(String requiredFieldName, Object value, boolean allowEmptyValue)
Convenience method forcheckRequiredField(String, Object, String, boolean)
with a null postfix
-
checkRequiredField
public ValidationErrors checkRequiredField(String requiredFieldName, Object value, String postfix)
Convenience method forcheckRequiredField(String, Object, String, boolean)
with allowEmptyValue=false
-
checkRequiredField
public ValidationErrors checkRequiredField(String requiredFieldName, Object value, String postfix, boolean allowEmptyValue)
Checks that the given value is set.- Parameters:
allowEmptyValue
- If true, empty string and empty arrays are allowed. If false, they are not.
-
checkDisallowedField
@SafeVarargs public final void checkDisallowedField(String disallowedFieldName, Object value, Database database, Class<? extends Database>... disallowedDatabases)
Checks if a field is forbidden in combination with a given Database (most often because that database does not implement the features required by the field/value combination). If a "forbidden" use is detected, a validation error is added to the current list of ValidationErrors.
Note:- if value==null, the field is ALLOWED for all DBs
- if the disallowedDatabases list does not at least contain 1 entry, the field is NOT allowed
- Parameters:
disallowedFieldName
- field whose value is checkedvalue
- value that might be disalloweddatabase
- database the object/value combination is checked againstdisallowedDatabases
- a list of "forbidden" databases that do not allow this field/value combination
-
addError
public ValidationErrors addError(String message)
-
addError
public ValidationErrors addError(String message, ChangeSet changeSet)
-
addWarning
public ValidationErrors addWarning(String message)
-
addAll
public ValidationErrors addAll(ValidationErrors validationErrors)
-
addAll
public void addAll(ValidationErrors validationErrors, ChangeSet changeSet)
-
-