Class ConstraintViolationUtils
java.lang.Object
io.micronaut.views.fields.messages.ConstraintViolationUtils
Utility class to work with
ConstraintViolation
.- Since:
- 4.1.0
- Author:
- Sergio del Amo
-
Method Summary
Modifier and TypeMethodDescriptionconstraintCode
(@NonNull jakarta.validation.ConstraintViolation<?> violation) Returns a code representing a constraint violation.lastNode
(@NonNull jakarta.validation.ConstraintViolation<?> violation) Returns the last node of a constraint violation.
-
Method Details
-
lastNode
@NonNull public static @NonNull Optional<String> lastNode(@NonNull @NonNull jakarta.validation.ConstraintViolation<?> violation) Returns the last node of a constraint violation.- Parameters:
violation
- Constraint Violation- Returns:
- Last Node of constraint violation if any
-
constraintCode
@NonNull public static @NonNull Optional<String> constraintCode(@NonNull @NonNull jakarta.validation.ConstraintViolation<?> violation) Returns a code representing a constraint violation.- Parameters:
violation
- Constraint violation.- Returns:
- code representing a constraint violation.
-