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 Details

    • BankAccountRequest

      public BankAccountRequest(UUID id, String accountNumber, BigDecimal balance, Currency currency, String iban)
      Creates an instance of a BankAccountRequest record class.
      Parameters:
      id - the value for the id record component
      accountNumber - the value for the accountNumber record component
      balance - the value for the balance record component
      currency - the value for the currency record component
      iban - the value for the iban record component
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • accountNumber

      public String accountNumber()
      Returns the value of the accountNumber record component.
      Returns:
      the value of the accountNumber record component
    • balance

      public BigDecimal balance()
      Returns the value of the balance record component.
      Returns:
      the value of the balance record component
    • currency

      public Currency currency()
      Returns the value of the currency record component.
      Returns:
      the value of the currency record component
    • iban

      public String iban()
      Returns the value of the iban record component.
      Returns:
      the value of the iban record component