Record Class MessagingErrorResponseDto
java.lang.Object
java.lang.Record
com.finconsgroup.itserr.marketplace.usercommunication.dm.exception.MessagingErrorResponseDto
- Record Components:
code- the status code for the response similar to http statusmessages- the list of error messagesdestination- the destinationrequestMessageId- the id to uniquely identify the request that sent the messagestackTrace- the error stack trace
public record MessagingErrorResponseDto(int code, List<String> messages, String destination, String requestMessageId, List<String> stackTrace)
extends Record
Dto for sending error responses for web socket messages.
This record contains a list of error messages returned in the response body when an exception occurs.
Example usage:
Listmessages = List.of("Error message 1", "Error message 2"); MessagingErrorResponseDto errorResponseDto = new MessagingErrorResponseDto(400, messages, destination, stackTrace);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcode()Returns the value of thecoderecord component.Returns the value of thedestinationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.messages()Returns the value of themessagesrecord component.Returns the value of therequestMessageIdrecord component.Returns the value of thestackTracerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessagingErrorResponseDto
public MessagingErrorResponseDto(int code, List<String> messages, String destination, String requestMessageId, List<String> stackTrace) Creates an instance of aMessagingErrorResponseDtorecord class.- Parameters:
code- the value for thecoderecord componentmessages- the value for themessagesrecord componentdestination- the value for thedestinationrecord componentrequestMessageId- the value for therequestMessageIdrecord componentstackTrace- the value for thestackTracerecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
code
public int code()Returns the value of thecoderecord component.- Returns:
- the value of the
coderecord component
-
messages
Returns the value of themessagesrecord component.- Returns:
- the value of the
messagesrecord component
-
destination
Returns the value of thedestinationrecord component.- Returns:
- the value of the
destinationrecord component
-
requestMessageId
Returns the value of therequestMessageIdrecord component.- Returns:
- the value of the
requestMessageIdrecord component
-
stackTrace
Returns the value of thestackTracerecord component.- Returns:
- the value of the
stackTracerecord component
-