Record Class ConstraintViolation<T>
java.lang.Object
java.lang.Record
io.fluxzero.sdk.tracking.handling.validation.ConstraintViolation<T>
- Type Parameters:
T- root bean type- Record Components:
message- interpolated violation messagemessageTemplate- original message templatepropertyPath- full path to the invalid property or executable valueformattedPath- compact path used by Fluxzero's formattedValidationExceptionmessagesinvalidValue- value that failed validationrootBean- root object that was validatedrootBeanClass- root object typeconstraint- fully qualified annotation type name of the violated constraint, when availableattributes- constraint annotation attributes, excluding provider-specific descriptor objects
public record ConstraintViolation<T>(String message, String messageTemplate, String propertyPath, String formattedPath, Object invalidValue, T rootBean, Class<T> rootBeanClass, String constraint, Map<String,Object> attributes)
extends Record
Structured validation failure exposed by the Fluxzero validation API.
The SDK keeps this type independent from Jakarta Validation so custom Validator implementations do not have
to expose provider-specific violation objects. The default validator still records the most useful metadata: message,
template, property path, invalid value, root bean, constraint type, and constraint attributes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.Returns the value of theconstraintrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theformattedPathrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theinvalidValuerecord component.message()Returns the value of themessagerecord component.Returns the value of themessageTemplaterecord component.Returns the value of thepropertyPathrecord component.rootBean()Returns the value of therootBeanrecord component.Returns the value of therootBeanClassrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConstraintViolation
-
-
Method Details
-
getMessage
- Returns:
- interpolated violation message
-
getMessageTemplate
- Returns:
- original message template
-
getPropertyPath
- Returns:
- full path to the invalid property or executable value
-
getFormattedPath
- Returns:
- compact path used by Fluxzero's formatted validation exception messages
-
getInvalidValue
- Returns:
- value that failed validation
-
getRootBean
- Returns:
- root object that was validated
-
getRootBeanClass
-
getConstraint
- Returns:
- fully qualified annotation type name of the violated constraint, when available
-
getAttributes
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
message
-
messageTemplate
Returns the value of themessageTemplaterecord component.- Returns:
- the value of the
messageTemplaterecord component
-
propertyPath
Returns the value of thepropertyPathrecord component.- Returns:
- the value of the
propertyPathrecord component
-
formattedPath
Returns the value of theformattedPathrecord component.- Returns:
- the value of the
formattedPathrecord component
-
invalidValue
Returns the value of theinvalidValuerecord component.- Returns:
- the value of the
invalidValuerecord component
-
rootBean
-
rootBeanClass
Returns the value of therootBeanClassrecord component.- Returns:
- the value of the
rootBeanClassrecord component
-
constraint
Returns the value of theconstraintrecord component.- Returns:
- the value of the
constraintrecord component
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-