Package api.mpba.rastvdmy.dto.request
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 Summary
ConstructorsConstructorDescriptionCardRequest(UUID id, String cardNumber, String cvv, String pin, LocalDate startDate, LocalDate expirationDate, CardCategory cardCategory, CardType cardType, CardStatus cardStatus) Creates an instance of aCardRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecardCategoryrecord component.Returns the value of thecardNumberrecord component.Returns the value of thecardStatusrecord component.cardType()Returns the value of thecardTyperecord component.cvv()Returns the value of thecvvrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpirationDaterecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.pin()Returns the value of thepinrecord component.Returns the value of thestartDaterecord component.final StringtoString()Returns a string representation of this record class.
-
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 aCardRequestrecord class.- Parameters:
id- the value for theidrecord componentcardNumber- the value for thecardNumberrecord componentcvv- the value for thecvvrecord componentpin- the value for thepinrecord componentstartDate- the value for thestartDaterecord componentexpirationDate- the value for theexpirationDaterecord componentcardCategory- the value for thecardCategoryrecord componentcardType- the value for thecardTyperecord componentcardStatus- the value for thecardStatusrecord 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 theidrecord component.- Returns:
- the value of the
idrecord component
-
cardNumber
Returns the value of thecardNumberrecord component.- Returns:
- the value of the
cardNumberrecord component
-
cvv
Returns the value of thecvvrecord component.- Returns:
- the value of the
cvvrecord component
-
pin
Returns the value of thepinrecord component.- Returns:
- the value of the
pinrecord component
-
startDate
Returns the value of thestartDaterecord component.- Returns:
- the value of the
startDaterecord component
-
expirationDate
Returns the value of theexpirationDaterecord component.- Returns:
- the value of the
expirationDaterecord component
-
cardCategory
Returns the value of thecardCategoryrecord component.- Returns:
- the value of the
cardCategoryrecord component
-
cardType
Returns the value of thecardTyperecord component.- Returns:
- the value of the
cardTyperecord component
-
cardStatus
Returns the value of thecardStatusrecord component.- Returns:
- the value of the
cardStatusrecord component
-