public class ValidationErrors extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
change |
protected List<String> |
errorMessages |
protected List<String> |
warningMessages |
Constructor and Description |
---|
ValidationErrors() |
ValidationErrors(Change change) |
ValidationErrors(Precondition precondition) |
ValidationErrors(String change) |
Modifier and Type | Method and 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 for
checkRequiredField(String, Object, String, boolean) with allowEmptyValue=false |
ValidationErrors |
checkRequiredField(String requiredFieldName,
Object value,
boolean allowEmptyValue)
Convenience method for
checkRequiredField(String, Object, String, boolean) with a null postfix |
ValidationErrors |
checkRequiredField(String requiredFieldName,
Object value,
String postfix)
Convenience method for
checkRequiredField(String, Object, String, boolean) with allowEmptyValue=false |
ValidationErrors |
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() |
protected String change
public ValidationErrors()
public ValidationErrors(String change)
public ValidationErrors(Change change)
public ValidationErrors(Precondition precondition)
public boolean hasErrors()
public String getChangeName()
public ValidationErrors checkRequiredField(String requiredFieldName, Object value)
checkRequiredField(String, Object, String, boolean)
with allowEmptyValue=falsepublic ValidationErrors checkRequiredField(String requiredFieldName, Object value, boolean allowEmptyValue)
checkRequiredField(String, Object, String, boolean)
with a null postfixpublic ValidationErrors checkRequiredField(String requiredFieldName, Object value, String postfix)
checkRequiredField(String, Object, String, boolean)
with allowEmptyValue=falsepublic ValidationErrors checkRequiredField(String requiredFieldName, Object value, String postfix, boolean allowEmptyValue)
allowEmptyValue
- If true, empty string and empty arrays are allowed. If false, they are not.@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: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 combinationpublic ValidationErrors addError(String message)
public ValidationErrors addError(String message, ChangeSet changeSet)
public ValidationErrors addWarning(String message)
public ValidationErrors addAll(ValidationErrors validationErrors)
public void addAll(ValidationErrors validationErrors, ChangeSet changeSet)
Copyright © 2023 Liquibase.org. All rights reserved.