Skip to the content.

5. Chain methods

5.1 critical path in chain validation

critical()

5.2 critical rise exception path in chain validation

critical(final Class<? extends ValidationException> clazz)

5.3 handlerInvalidField customize generated error to invalid field

handlerInvalidField(final HandlerInvalidField<P> handlerInvalidField)

Examples

5.4 must valid condition

must(final Predicate<P> predicate)

5.5 when condition to validate

when(final Predicate<P> when)

5.6 whenever to validator

whenever(final Predicate<P> predicate)

5.7 withAttempedValue when must condition not be true, using object property

withAttempedValue(final Function<T, Object> attemptedValue)

5.8 withAttempedValue when must condition not be true

withAttempedValue(final Object attemptedValue)

5.9 withCode when must condition not be true, using object property

withCode(final Function<T, String> code)

5.10 withCode when must condition not be true

withCode(final String code)

5.11 withFieldName when must condition not be true, using object property

withFieldName(final Function<T, String> fieldName)

5.12 withFieldName when must condition not be true

withFieldName(final String fieldName)

5.13 withMessage when must condition not be true, using object property

withMessage(final Function<T, String> message)

5.14 withMessage when must condition not be true

withMessage(final String message)

5.15 withValidator to validate object

withValidator(final Validator<P> validator)