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 TypeMethodDescriptionbooleanIMPORTANT - 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> CgetDynamicPayload(Class<C> type) Object[]final Objectfinal Objectfinal Stringfinal Stringfinal Pathfinal TinthashCode()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:
getMessagein interfaceConstraintViolation<T>
-
getMessageTemplate
- Specified by:
getMessageTemplatein 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:
getRootBeanin interfaceConstraintViolation<T>
-
getRootBeanClass
- Specified by:
getRootBeanClassin interfaceConstraintViolation<T>
-
getLeafBean
- Specified by:
getLeafBeanin interfaceConstraintViolation<T>
-
getInvalidValue
- Specified by:
getInvalidValuein interfaceConstraintViolation<T>
-
getPropertyPath
- Specified by:
getPropertyPathin interfaceConstraintViolation<T>
-
getConstraintDescriptor
- Specified by:
getConstraintDescriptorin interfaceConstraintViolation<T>
-
unwrap
- Specified by:
unwrapin interfaceConstraintViolation<T>
-
getExecutableParameters
- Specified by:
getExecutableParametersin interfaceConstraintViolation<T>
-
getExecutableReturnValue
- Specified by:
getExecutableReturnValuein interfaceConstraintViolation<T>
-
getDynamicPayload
- Specified by:
getDynamicPayloadin 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)ornullif 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,expressionVariablesanddynamicPayloadare 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
-