Class BahnCardValidator

java.lang.Object
org.apache.commons.validator.routines.BahnCardValidator
All Implemented Interfaces:
Serializable

public final class BahnCardValidator extends Object implements Serializable
Bahncard number validation.

BahnCard is a discount subscription program offered by Deutsche Bahn, the German national railway company.

The card number is a 16-digit number. For example, it may start with 7081.

For further information see Wikipedia.

Since:
2.10.5
See Also:
  • Method Details

    • getInstance

      public static BahnCardValidator getInstance()
      Gets the singleton instance of this validator.
      Returns:
      A singleton instance of the card validator.
    • isValid

      public boolean isValid(String code)
      Tests whether the code is a valid card number.
      Parameters:
      code - The card number to validate.
      Returns:
      true if a card number, otherwise false.