org.apache.commons.validator

Class CreditCardValidator.Mastercard

Enclosing Class:
CreditCardValidator
Implemented Interfaces:
CreditCardValidator.CreditCardType

private class CreditCardValidator.Mastercard
extends java.lang.Object
implements CreditCardValidator.CreditCardType

Nested Class Summary

Field Summary

private static String
PREFIX

Method Summary

boolean
matches(String card)
Returns true if the card number matches this type of credit card.

Field Details

PREFIX

private static final String PREFIX

Method Details

matches

public boolean matches(String card)
Returns 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 because CreditCardValidator performs 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:
matches in interface CreditCardValidator.CreditCardType

Parameters:
card - The card number, never null.

Returns:
true if the number matches.


Copyright (c) 2001-2004 Apache Software Foundation