Package api.mpba.rastvdmy.dto.response
Record Class PaymentResponse
java.lang.Object
java.lang.Record
api.mpba.rastvdmy.dto.response.PaymentResponse
- Record Components:
id
- The unique identifier of the payment.senderName
- The name of the payment sender.recipientName
- The name of the payment recipient.dateTime
- The date and time when the payment was made.description
- A description of the payment.amount
- The amount of money involved in the payment.type
- The type of the payment.status
- The financial status of the payment.currency
- The currency in which the payment is made.
public record PaymentResponse(UUID id, String senderName, String recipientName, LocalDate dateTime, String description, BigDecimal amount, PaymentType type, FinancialStatus status, Currency currency)
extends Record
This class represents a response for a payment in the banking system.
-
Constructor Summary
ConstructorDescriptionPaymentResponse
(UUID id, String senderName, String recipientName, LocalDate dateTime, String description, BigDecimal amount, PaymentType type, FinancialStatus status, Currency currency) Creates an instance of aPaymentResponse
record class. -
Method Summary
Modifier and TypeMethodDescriptionamount()
Returns the value of theamount
record component.currency()
Returns the value of thecurrency
record component.dateTime()
Returns the value of thedateTime
record component.Returns the value of thedescription
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.id()
Returns the value of theid
record component.Returns the value of therecipientName
record component.Returns the value of thesenderName
record component.status()
Returns the value of thestatus
record component.final String
toString()
Returns a string representation of this record class.type()
Returns the value of thetype
record component.
-
Constructor Details
-
PaymentResponse
public PaymentResponse(UUID id, String senderName, String recipientName, LocalDate dateTime, String description, BigDecimal amount, PaymentType type, FinancialStatus status, Currency currency) Creates an instance of aPaymentResponse
record class.- Parameters:
id
- the value for theid
record componentsenderName
- the value for thesenderName
record componentrecipientName
- the value for therecipientName
record componentdateTime
- the value for thedateTime
record componentdescription
- the value for thedescription
record componentamount
- the value for theamount
record componenttype
- the value for thetype
record componentstatus
- the value for thestatus
record componentcurrency
- the value for thecurrency
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)
. -
id
Returns the value of theid
record component.- Returns:
- the value of the
id
record component
-
senderName
Returns the value of thesenderName
record component.- Returns:
- the value of the
senderName
record component
-
recipientName
Returns the value of therecipientName
record component.- Returns:
- the value of the
recipientName
record component
-
dateTime
Returns the value of thedateTime
record component.- Returns:
- the value of the
dateTime
record component
-
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
amount
Returns the value of theamount
record component.- Returns:
- the value of the
amount
record component
-
type
Returns the value of thetype
record component.- Returns:
- the value of the
type
record component
-
status
Returns the value of thestatus
record component.- Returns:
- the value of the
status
record component
-
currency
Returns the value of thecurrency
record component.- Returns:
- the value of the
currency
record component
-