Class ConstraintViolationUtils

java.lang.Object
io.micronaut.views.fields.messages.ConstraintViolationUtils

@Internal public final class ConstraintViolationUtils extends Object
Utility class to work with ConstraintViolation.
Since:
4.1.0
Author:
Sergio del Amo
  • 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.