public class LuhnIdentifierValidator extends BaseHyphenatedIdentifierValidator
Constructor and Description |
---|
LuhnIdentifierValidator() |
Modifier and Type | Method and Description |
---|---|
String |
getAllowedCharacters() |
protected int |
getCheckDigit(String undecoratedIdentifier) |
String |
getName() |
String |
getValidIdentifier(String undecoratedIdentifier) |
checkAllowedIdentifier, isValid
protected int getCheckDigit(String undecoratedIdentifier)
getCheckDigit
in class BaseHyphenatedIdentifierValidator
public String getName()
getName
in interface IdentifierValidator
getName
in class BaseHyphenatedIdentifierValidator
IdentifierValidator.getName()
public String getAllowedCharacters()
getAllowedCharacters
in interface IdentifierValidator
getAllowedCharacters
in class BaseHyphenatedIdentifierValidator
IdentifierValidator.getAllowedCharacters()
public String getValidIdentifier(String undecoratedIdentifier) throws UnallowedIdentifierException
getValidIdentifier
in interface IdentifierValidator
getValidIdentifier
in class BaseHyphenatedIdentifierValidator
undecoratedIdentifier
- The identifier prior to being given a check digit or other form
of validation.UnallowedIdentifierException
- if the identifier contains unallowed characters or is
otherwise not appropriate for this validator.Should get valid identifier
Should fail with invalid identifiers
Copyright © 2024 OpenMRS Inc.. All rights reserved.