Record Class ValidationErrorResponse
java.lang.Object
java.lang.Record
uk.co.jasonmarston.kiunzi.utility.exception.mapper.response.ValidationErrorResponse
- Record Components:
title- the summary title of the validation failurestatus- the HTTP status code associated with the responseviolations- the individual field or property violations that caused the failure
public record ValidationErrorResponse(String title, int status, List<ValidationErrorResponse.Violation> violations)
extends Record
Error payload returned when one or more validation or invariant violations must be
reported to the client.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDescribes a single validation failure within aValidationErrorResponse. -
Constructor Summary
ConstructorsConstructorDescriptionValidationErrorResponse(String title, int status, List<ValidationErrorResponse.Violation> violations) Creates an instance of aValidationErrorResponserecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intstatus()Returns the value of thestatusrecord component.title()Returns the value of thetitlerecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theviolationsrecord component.
-
Constructor Details
-
ValidationErrorResponse
public ValidationErrorResponse(String title, int status, List<ValidationErrorResponse.Violation> violations) Creates an instance of aValidationErrorResponserecord class.- Parameters:
title- the value for thetitlerecord componentstatus- the value for thestatusrecord componentviolations- the value for theviolationsrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
title
-
status
-
violations
Returns the value of theviolationsrecord component.- Returns:
- the value of the
violationsrecord component
-