Package io.github.multiform_validator
Class CreditCardValidator
java.lang.Object
io.github.multiform_validator.CreditCardValidator
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
identifyFlagCard
(String cardNumber) Identifies the flag of a credit card based on its number.static boolean
isCreditCardValid
(String creditCard) Validates a credit card number.
-
Method Details
-
isCreditCardValid
Validates a credit card number.- Parameters:
creditCard
- The credit card number to validate.- Returns:
- true if the credit card number is valid, false otherwise.
- Throws:
IllegalArgumentException
- if the input value is null or empty.
-
identifyFlagCard
Identifies the flag of a credit card based on its number.- Parameters:
cardNumber
- The credit card number.- Returns:
- The flag of the credit card, or "Unknown" if the flag is not recognized.
- Throws:
IllegalArgumentException
- if the input value is null or empty.
-