Class ConstraintViolationImpl<T>
java.lang.Object
org.hibernate.validator.internal.engine.ConstraintViolationImpl<T>
- All Implemented Interfaces:
ConstraintViolation<T>
,Serializable
,HibernateConstraintViolation<T>
public class ConstraintViolationImpl<T>
extends Object
implements HibernateConstraintViolation<T>, Serializable
- Author:
- Emmanuel Bernard, Hardy Ferentschik
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
IMPORTANT - some behaviour of Validator depends on the correct implementation of this equals method! (HF)static <T> ConstraintViolation<T>
forBeanValidation
(String messageTemplate, Map<String, Object> messageParameters, Map<String, Object> expressionVariables, String interpolatedMessage, Class<T> rootBeanClass, T rootBean, Object leafBeanInstance, Object value, Path propertyPath, ConstraintDescriptor<?> constraintDescriptor, Object dynamicPayload) static <T> ConstraintViolation<T>
forParameterValidation
(String messageTemplate, Map<String, Object> messageParameters, Map<String, Object> expressionVariables, String interpolatedMessage, Class<T> rootBeanClass, T rootBean, Object leafBeanInstance, Object value, Path propertyPath, ConstraintDescriptor<?> constraintDescriptor, Object[] executableParameters, Object dynamicPayload) static <T> ConstraintViolation<T>
forReturnValueValidation
(String messageTemplate, Map<String, Object> messageParameters, Map<String, Object> expressionVariables, String interpolatedMessage, Class<T> rootBeanClass, T rootBean, Object leafBeanInstance, Object value, Path propertyPath, ConstraintDescriptor<?> constraintDescriptor, Object executableReturnValue, Object dynamicPayload) final ConstraintDescriptor<?>
<C> C
getDynamicPayload
(Class<C> type) Object[]
final Object
final Object
final String
final String
final Path
final T
int
hashCode()
toString()
<C> C
-
Method Details
-
forBeanValidation
public static <T> ConstraintViolation<T> forBeanValidation(String messageTemplate, Map<String, Object> messageParameters, Map<String, Object> expressionVariables, String interpolatedMessage, Class<T> rootBeanClass, T rootBean, Object leafBeanInstance, Object value, Path propertyPath, ConstraintDescriptor<?> constraintDescriptor, Object dynamicPayload) -
forParameterValidation
public static <T> ConstraintViolation<T> forParameterValidation(String messageTemplate, Map<String, Object> messageParameters, Map<String, Object> expressionVariables, String interpolatedMessage, Class<T> rootBeanClass, T rootBean, Object leafBeanInstance, Object value, Path propertyPath, ConstraintDescriptor<?> constraintDescriptor, Object[] executableParameters, Object dynamicPayload) -
forReturnValueValidation
public static <T> ConstraintViolation<T> forReturnValueValidation(String messageTemplate, Map<String, Object> messageParameters, Map<String, Object> expressionVariables, String interpolatedMessage, Class<T> rootBeanClass, T rootBean, Object leafBeanInstance, Object value, Path propertyPath, ConstraintDescriptor<?> constraintDescriptor, Object executableReturnValue, Object dynamicPayload) -
getMessage
- Specified by:
getMessage
in interfaceConstraintViolation<T>
-
getMessageTemplate
- Specified by:
getMessageTemplate
in interfaceConstraintViolation<T>
-
getMessageParameters
- Returns:
- the message parameters added using
HibernateConstraintValidatorContext.addMessageParameter(String, Object)
-
getExpressionVariables
- Returns:
- the expression variables added using
HibernateConstraintValidatorContext.addExpressionVariable(String, Object)
-
getRootBean
- Specified by:
getRootBean
in interfaceConstraintViolation<T>
-
getRootBeanClass
- Specified by:
getRootBeanClass
in interfaceConstraintViolation<T>
-
getLeafBean
- Specified by:
getLeafBean
in interfaceConstraintViolation<T>
-
getInvalidValue
- Specified by:
getInvalidValue
in interfaceConstraintViolation<T>
-
getPropertyPath
- Specified by:
getPropertyPath
in interfaceConstraintViolation<T>
-
getConstraintDescriptor
- Specified by:
getConstraintDescriptor
in interfaceConstraintViolation<T>
-
unwrap
- Specified by:
unwrap
in interfaceConstraintViolation<T>
-
getExecutableParameters
- Specified by:
getExecutableParameters
in interfaceConstraintViolation<T>
-
getExecutableReturnValue
- Specified by:
getExecutableReturnValue
in interfaceConstraintViolation<T>
-
getDynamicPayload
- Specified by:
getDynamicPayload
in interfaceHibernateConstraintViolation<T>
- Parameters:
type
- The type of payload to retrieve- Returns:
- an instance of the specified type set by the user via
HibernateConstraintValidatorContext.withDynamicPayload(Object)
ornull
if no constraint payload if the given type has been set.
-
equals
IMPORTANT - some behaviour of Validator depends on the correct implementation of this equals method! (HF)messageParameters
,expressionVariables
anddynamicPayload
are not taken into account for equality. These variables solely enrich the actual Constraint Violation with additional information e.g how we actually got to this CV. -
hashCode
public int hashCode() -
toString
-