Example usage for org.apache.commons.validator.routines.checkdigit CheckDigit isValid

List of usage examples for org.apache.commons.validator.routines.checkdigit CheckDigit isValid

Introduction

In this page you can find the example usage for org.apache.commons.validator.routines.checkdigit CheckDigit isValid.

Prototype

public boolean isValid(String code);

Source Link

Document

Validate the check digit for the code.

Usage

From source file:com.inkubator.common.util.CheckDigitLunh.java

/**
 * Check a series of number is valid or not using lunh algorithm
 *
 * @param number//from  w  w w.  j av a  2  s .c  o m
 * @return Boolean
 */
public static Boolean isValidNumberByLunh(String number) {
    CheckDigit checkDigit = new LuhnCheckDigit();
    return checkDigit.isValid(number);
}