Package api.mpba.rastvdmy.dto.response
Record Class MessageResponse
java.lang.Object
java.lang.Record
api.mpba.rastvdmy.dto.response.MessageResponse
- Record Components:
receiverEmail
- The email of the message receiver.content
- The content of the message.senderEmail
- The email of the message sender.timestamp
- The timestamp of when the message was sent.
public record MessageResponse(String receiverEmail, String content, String senderEmail, LocalDateTime timestamp)
extends Record
This class represents a response for a message in the banking system.
-
Constructor Summary
ConstructorDescriptionMessageResponse
(String receiverEmail, String content, String senderEmail, LocalDateTime timestamp) Creates an instance of aMessageResponse
record class. -
Method Summary
Modifier and TypeMethodDescriptioncontent()
Returns the value of thecontent
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.Returns the value of thereceiverEmail
record component.Returns the value of thesenderEmail
record component.Returns the value of thetimestamp
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
MessageResponse
public MessageResponse(String receiverEmail, String content, String senderEmail, LocalDateTime timestamp) Creates an instance of aMessageResponse
record class.- Parameters:
receiverEmail
- the value for thereceiverEmail
record componentcontent
- the value for thecontent
record componentsenderEmail
- the value for thesenderEmail
record componenttimestamp
- the value for thetimestamp
record 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. All components in this record class are compared withObjects::equals(Object,Object)
. -
receiverEmail
Returns the value of thereceiverEmail
record component.- Returns:
- the value of the
receiverEmail
record component
-
content
Returns the value of thecontent
record component.- Returns:
- the value of the
content
record component
-
senderEmail
Returns the value of thesenderEmail
record component.- Returns:
- the value of the
senderEmail
record component
-
timestamp
Returns the value of thetimestamp
record component.- Returns:
- the value of the
timestamp
record component
-