public interface ValidatorResponse
A response returned by a
ConstraintValidator.check(io.helidon.validation.ValidatorContext, Object).-
Method Summary
Modifier and TypeMethodDescriptionAnnotation that triggered the check.static ValidatorResponsecreate()Create a new valid response.static ValidatorResponsecreate(Annotation annotation, String message, Object invalidValue) Create a new failed response.The value that triggered the failure.message()Error message describing the failure.booleanvalid()Whether the response was valid.
-
Method Details
-
create
Create a new valid response.- Returns:
- a new valid response
-
create
Create a new failed response.- Parameters:
annotation- annotation that triggered the checkmessage- message describing the failureinvalidValue- the value that triggered the failure- Returns:
- a new failed response
-
valid
boolean valid()Whether the response was valid.- Returns:
- if valid
-
annotation
Annotation annotation()Annotation that triggered the check.- Returns:
- annotation of the check
- Throws:
IllegalStateException- in case the response is valid
-
message
String message()Error message describing the failure.- Returns:
- error message
- Throws:
IllegalStateException- in case the response is valid
-
invalidValue
Object invalidValue()The value that triggered the failure.- Returns:
- the value
- Throws:
IllegalStateException- in case the response is valid
-