Interface PropertyAssert<SELF extends PropertyAssert<SELF,ACTUAL>,ACTUAL>
- Type Parameters:
SELF
- self type parameterACTUAL
- actual type parameter
- All Superinterfaces:
Assert<SELF,
,ACTUAL> Descriptable<SELF>
,ExtensionPoints<SELF,
,ACTUAL> ValidationAssert<SELF,
ACTUAL, Validator>
- All Known Subinterfaces:
BeanAssert<SELF,
ACTUAL>
- All Known Implementing Classes:
AbstractBeanAssert
,AbstractPropertyAssert
public interface PropertyAssert<SELF extends PropertyAssert<SELF,ACTUAL>,ACTUAL>
extends ValidationAssert<SELF,ACTUAL,Validator>
An interface for verifying values against properties of bean types.
- Author:
- Jin Kwon <onacit_at_gmail.com>
-
Method Summary
Modifier and TypeMethodDescriptiondefault <T> SELF
isValidFor
(Class<T> beanType, String propertyName) Verifies that theactual
value is valid for the property of specified name of specified bean type.<T> SELF
isValidFor
(Class<T> beanType, String propertyName, Consumer<? super ConstraintViolation<T>> consumer) Verifies that theactual
value is valid for the property of specified name of specified bean type while accepting constraint violations, if any populated, to specified consumer.Methods inherited from interface org.assertj.core.api.Assert
asInstanceOf, asList, asString, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, hasSameClassAs, hasSameHashCodeAs, hasToString, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, usingComparator, usingComparator, usingDefaultComparator, withRepresentation, withThreadDumpOnError
Methods inherited from interface org.assertj.core.api.Descriptable
as, as, as, describedAs, describedAs
Methods inherited from interface org.assertj.core.api.ExtensionPoints
doesNotHave, has, is, isNot, satisfies
Methods inherited from interface com.github.jinahya.assertj.validation.ValidationAssert
targetingGroups, usingValidator
-
Method Details
-
isValidFor
<T> SELF isValidFor(Class<T> beanType, String propertyName, Consumer<? super ConstraintViolation<T>> consumer) Verifies that theactual
value is valid for the property of specified name of specified bean type while accepting constraint violations, if any populated, to specified consumer.- Type Parameters:
T
- type of the object to validate- Parameters:
beanType
- the bean type; notnull
.propertyName
- the name of the property to validate; notnull
.consumer
- the consumer accepts constraint violations; notnull
.- Returns:
- this assertion object.
- Throws:
AssertionError
- when theactual
isnull
or is not valid forbeanType#propertyName
.- See Also:
-
isValidFor
Verifies that theactual
value is valid for the property of specified name of specified bean type.- Type Parameters:
T
- type of the object to validate- Parameters:
beanType
- the bean type; notnull
.propertyName
- the name of the property to validate; notnull
.- Returns:
- this assertion object.
- Throws:
AssertionError
- when theactual
isnull
or is not valid forbeanType#propertyName
.- API Note:
- Note that the
@Valid
is not honored by theValidator.validateValue(Class, String, Object, Class[])
method on which this method relies. - Implementation Note:
- This method invokes
isValidFor(Class, String, Consumer)
method withbeanType
,propertyName
, and a consumer does nothing.
-