Modifier and Type | Method and Description |
---|---|
void |
assertValid(Object validatedObject)
validates the field and getter constrains of the given object
and throws an ConstraintsViolatedException if any constraint
violations are detected
|
void |
assertValidFieldValue(Object validatedObject,
Field validatedField,
Object fieldValueToValidate)
Validates the give value against the defined field constraints and throws
an ConstraintsViolatedException if any constraint violations are detected.
|
List<ConstraintViolation> |
validate(Object validatedObject)
validates the field and getter constrains of the given object
|
List<ConstraintViolation> |
validate(Object validatedObject,
String... profiles)
validates the field and getter constrains of the given object
|
List<ConstraintViolation> |
validateFieldValue(Object validatedObject,
Field validatedField,
Object fieldValueToValidate)
Validates the give value against the defined field constraints.
|
void assertValid(Object validatedObject) throws IllegalArgumentException, ValidationFailedException, ConstraintsViolatedException
validatedObject
- the object to validate, cannot be nullIllegalArgumentException
- if validatedObject == null
ValidationFailedException
ConstraintsViolatedException
void assertValidFieldValue(Object validatedObject, Field validatedField, Object fieldValueToValidate) throws IllegalArgumentException, ValidationFailedException, ConstraintsViolatedException
validatedObject
- the object to validate, cannot be nullvalidatedField
- the field to validate, cannot be nullIllegalArgumentException
- if validatedObject == null
or field == null
ValidationFailedException
ConstraintsViolatedException
List<ConstraintViolation> validate(Object validatedObject) throws IllegalArgumentException, ValidationFailedException
validatedObject
- the object to validate, cannot be nullIllegalArgumentException
- if validatedObject == null
ValidationFailedException
List<ConstraintViolation> validate(Object validatedObject, String... profiles) throws IllegalArgumentException, ValidationFailedException
validatedObject
- the object to validate, cannot be nullprofiles
- constraint profiles to validate against, by default the globally enabled profiles are used that.IllegalArgumentException
- if validatedObject == null
ValidationFailedException
List<ConstraintViolation> validateFieldValue(Object validatedObject, Field validatedField, Object fieldValueToValidate) throws IllegalArgumentException, ValidationFailedException
IllegalArgumentException
- if validatedObject == null
or validatedField == null
ValidationFailedException
Copyright © 2005–2021 Vegard IT GmbH, Germany. All rights reserved.