Package org.apache.commons.validator
Class CreditCardValidator.Discover
- java.lang.Object
-
- org.apache.commons.validator.CreditCardValidator.Discover
-
- All Implemented Interfaces:
CreditCardValidator.CreditCardType
- Enclosing class:
- CreditCardValidator
private static class CreditCardValidator.Discover extends java.lang.Object implements CreditCardValidator.CreditCardType
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.StringPREFIX
-
Constructor Summary
Constructors Modifier Constructor Description privateDiscover()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanmatches(java.lang.String card)Returns true if the card number matches this type of credit card.
-
-
-
Field Detail
-
PREFIX
private static final java.lang.String PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
matches
public boolean matches(java.lang.String card)
Description copied from interface:CreditCardValidator.CreditCardTypeReturns true if the card number matches this type of credit card. Note that this method is not responsible for analyzing the general form of the card number becauseCreditCardValidatorperforms those checks before calling this method. It is generally only required to valid the length and prefix of the number to determine if it's the correct type.- Specified by:
matchesin interfaceCreditCardValidator.CreditCardType- Parameters:
card- The card number, never null.- Returns:
- true if the number matches.
-
-