Record Class CardRequest

java.lang.Object
java.lang.Record
api.mpba.rastvdmy.dto.request.CardRequest
Record Components:
id - The unique identifier for the card.
cardNumber - The card number.
cvv - The CVV of the card.
pin - The PIN of the card.
startDate - The start date of the card.
expirationDate - The expiration date of the card.
cardCategory - The category of the card.
cardType - The type of the card.
cardStatus - The status of the card.

public record CardRequest(UUID id, String cardNumber, String cvv, String pin, LocalDate startDate, LocalDate expirationDate, CardCategory cardCategory, CardType cardType, CardStatus cardStatus) extends Record
This class represents a request for a card in the banking system.

It includes the following fields:

  • id: The unique identifier for the card.
  • cardNumber: The card number, serialized to/from JSON with the key "card_number".
  • cvv: The CVV (Card Verification Value) of the card.
  • pin: The PIN (Personal Identification Number) of the card.
  • startDate: The start date of the card, serialized to/from JSON with the key "start_date".
  • expirationDate: The expiration date of the card, serialized to/from JSON with the key "expiration_date".
  • cardCategory: The category of the card (e.g., debit, credit), serialized to/from JSON with the key "card_category".
  • cardType: The type of the card (e.g., physical, virtual), serialized to/from JSON with the key "card_type".
  • cardStatus: The current status of the card (e.g., active, blocked), serialized to/from JSON with the key "card_status".
  • Constructor Details

    • CardRequest

      public CardRequest(UUID id, String cardNumber, String cvv, String pin, LocalDate startDate, LocalDate expirationDate, CardCategory cardCategory, CardType cardType, CardStatus cardStatus)
      Creates an instance of a CardRequest record class.
      Parameters:
      id - the value for the id record component
      cardNumber - the value for the cardNumber record component
      cvv - the value for the cvv record component
      pin - the value for the pin record component
      startDate - the value for the startDate record component
      expirationDate - the value for the expirationDate record component
      cardCategory - the value for the cardCategory record component
      cardType - the value for the cardType record component
      cardStatus - the value for the cardStatus 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
    • cardNumber

      public String cardNumber()
      Returns the value of the cardNumber record component.
      Returns:
      the value of the cardNumber record component
    • cvv

      public String cvv()
      Returns the value of the cvv record component.
      Returns:
      the value of the cvv record component
    • pin

      public String pin()
      Returns the value of the pin record component.
      Returns:
      the value of the pin record component
    • startDate

      public LocalDate startDate()
      Returns the value of the startDate record component.
      Returns:
      the value of the startDate record component
    • expirationDate

      public LocalDate expirationDate()
      Returns the value of the expirationDate record component.
      Returns:
      the value of the expirationDate record component
    • cardCategory

      public CardCategory cardCategory()
      Returns the value of the cardCategory record component.
      Returns:
      the value of the cardCategory record component
    • cardType

      public CardType cardType()
      Returns the value of the cardType record component.
      Returns:
      the value of the cardType record component
    • cardStatus

      public CardStatus cardStatus()
      Returns the value of the cardStatus record component.
      Returns:
      the value of the cardStatus record component