Package jakarta.validation
Class ConstraintViolationException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- jakarta.validation.ValidationException
-
- jakarta.validation.ConstraintViolationException
-
- All Implemented Interfaces:
Serializable
public class ConstraintViolationException extends ValidationException
Reports the result of constraint violations.- Author:
- Emmanuel Bernard, Gunnar Morling, Guillaume Smet
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ConstraintViolationException(String message, Set<? extends ConstraintViolation<?>> constraintViolations)
Creates a constraint violation report.ConstraintViolationException(Set<? extends ConstraintViolation<?>> constraintViolations)
Creates a constraint violation report.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<ConstraintViolation<?>>
getConstraintViolations()
Returns the set of constraint violations reported during a validation.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
ConstraintViolationException
public ConstraintViolationException(String message, Set<? extends ConstraintViolation<?>> constraintViolations)
Creates a constraint violation report.- Parameters:
message
- error messageconstraintViolations
- aSet
ofConstraintViolation
s or null
-
ConstraintViolationException
public ConstraintViolationException(Set<? extends ConstraintViolation<?>> constraintViolations)
Creates a constraint violation report.- Parameters:
constraintViolations
- aSet
ofConstraintViolation
s or null
-
-
Method Detail
-
getConstraintViolations
public Set<ConstraintViolation<?>> getConstraintViolations()
Returns the set of constraint violations reported during a validation.- Returns:
- the
Set
ofConstraintViolation
s or null
-
-