Package api.mpba.rastvdmy.dto.request
Record Class BankAccountRequest
java.lang.Object
java.lang.Record
api.mpba.rastvdmy.dto.request.BankAccountRequest
- Record Components:
id
- The unique identifier of the bank account.accountNumber
- The account number of the bank account.balance
- The current balance of the bank account.currency
- The currency of the bank account.iban
- The International Bank Account Number (IBAN) for the bank account.
public record BankAccountRequest(UUID id, String accountNumber, BigDecimal balance, Currency currency, String iban)
extends Record
A Data Transfer Object (DTO) that represents a request for a bank account.
This record encapsulates the essential information needed to create or
update a bank account.
The following fields are included:
- id: The unique identifier of the bank account, represented as a UUID.
- accountNumber: The account number of the bank account, serialized to/from JSON with the key "account_number".
- balance: The current balance of the bank account, represented as a BigDecimal.
- currency: The currency of the bank account, represented as a Currency object.
- iban: The International Bank Account Number (IBAN) for the bank account.
-
Constructor Summary
ConstructorDescriptionBankAccountRequest
(UUID id, String accountNumber, BigDecimal balance, Currency currency, String iban) Creates an instance of aBankAccountRequest
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaccountNumber
record component.balance()
Returns the value of thebalance
record component.currency()
Returns the value of thecurrency
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.iban()
Returns the value of theiban
record component.id()
Returns the value of theid
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
BankAccountRequest
public BankAccountRequest(UUID id, String accountNumber, BigDecimal balance, Currency currency, String iban) Creates an instance of aBankAccountRequest
record class.- Parameters:
id
- the value for theid
record componentaccountNumber
- the value for theaccountNumber
record componentbalance
- the value for thebalance
record componentcurrency
- the value for thecurrency
record componentiban
- the value for theiban
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
-
accountNumber
Returns the value of theaccountNumber
record component.- Returns:
- the value of the
accountNumber
record component
-
balance
Returns the value of thebalance
record component.- Returns:
- the value of the
balance
record component
-
currency
Returns the value of thecurrency
record component.- Returns:
- the value of the
currency
record component
-
iban
Returns the value of theiban
record component.- Returns:
- the value of the
iban
record component
-