Package api.mpba.rastvdmy.dto.request
Record Class MessageRequest
java.lang.Object
java.lang.Record
api.mpba.rastvdmy.dto.request.MessageRequest
- Record Components:
receiverEmail- The email of the message receiver.content- The content of the message.senderEmail- The email of the message sender.timestamp- The time when the message was sent.
public record MessageRequest(String receiverEmail, String content, String senderEmail, LocalDateTime timestamp)
extends Record
This class represents a message in the banking system.
It contains information about the sender, receiver, content, and timestamp.
-
Constructor Summary
ConstructorsConstructorDescriptionMessageRequest(String receiverEmail, String content, String senderEmail, LocalDateTime timestamp) Creates an instance of aMessageRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncontent()Returns the value of thecontentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thereceiverEmailrecord component.Returns the value of thesenderEmailrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MessageRequest
public MessageRequest(String receiverEmail, String content, String senderEmail, LocalDateTime timestamp) Creates an instance of aMessageRequestrecord class.- Parameters:
receiverEmail- the value for thereceiverEmailrecord componentcontent- the value for thecontentrecord componentsenderEmail- the value for thesenderEmailrecord componenttimestamp- the value for thetimestamprecord 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 thereceiverEmailrecord component.- Returns:
- the value of the
receiverEmailrecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
senderEmail
Returns the value of thesenderEmailrecord component.- Returns:
- the value of the
senderEmailrecord component
-
timestamp
Returns the value of thetimestamprecord component.- Returns:
- the value of the
timestamprecord component
-