Package com.cobber.fta.plugins
Class CheckDigitLuhn
- java.lang.Object
-
- com.cobber.fta.LogicalType
-
- com.cobber.fta.LogicalTypeCode
-
- com.cobber.fta.LogicalTypeInfinite
-
- com.cobber.fta.plugins.CheckDigitLT
-
- com.cobber.fta.plugins.CheckDigitLuhn
-
- All Implemented Interfaces:
LTRandom
,java.lang.Comparable<LogicalType>
public class CheckDigitLuhn extends CheckDigitLT
Plugin to detect valid Luhn check digits (typically Credit Cards or IMEI Numbers).
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SEMANTIC_TYPE
-
Fields inherited from class com.cobber.fta.plugins.CheckDigitLT
BACKOUT_REGEXP, validator
-
Fields inherited from class com.cobber.fta.LogicalTypeCode
random
-
Fields inherited from class com.cobber.fta.LogicalType
defn, headerPatterns, locale, priority, threshold
-
-
Constructor Summary
Constructors Constructor Description CheckDigitLuhn(PluginDefinition plugin)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getQualifier()
The user-friendly name of the Qualifier.boolean
isValid(java.lang.String input)
Is the supplied String an instance of this logical type?java.lang.String
nextRandom()
nextRandom will generate a random (secure) valid example of this Semantic Type.-
Methods inherited from class com.cobber.fta.plugins.CheckDigitLT
getBaseType, getRegExp, initialize, isCandidate, isValidSet
-
Methods inherited from class com.cobber.fta.LogicalTypeInfinite
isClosed, isRegExpComplete
-
Methods inherited from class com.cobber.fta.LogicalTypeCode
seed
-
Methods inherited from class com.cobber.fta.LogicalType
acceptsBaseType, compareTo, getConfidence, getDescription, getHeaderConfidence, getPluginDefinition, getPriority, getSignature, getThreshold, isLocaleSensitive, setThreshold
-
-
-
-
Field Detail
-
SEMANTIC_TYPE
public static final java.lang.String SEMANTIC_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CheckDigitLuhn
public CheckDigitLuhn(PluginDefinition plugin)
-
-
Method Detail
-
isValid
public boolean isValid(java.lang.String input)
Description copied from class:LogicalType
Is the supplied String an instance of this logical type?- Overrides:
isValid
in classCheckDigitLT
- Parameters:
input
- String to check (trimmed for Numeric base Types, un-trimmed for String base Type)- Returns:
- true iff the supplied String is an instance of this Logical type.
-
getQualifier
public java.lang.String getQualifier()
Description copied from class:LogicalType
The user-friendly name of the Qualifier. For example, EMAIL for an email address- Specified by:
getQualifier
in classLogicalType
- Returns:
- The user-friendly name of the type-qualifier.
-
nextRandom
public java.lang.String nextRandom()
Description copied from interface:LTRandom
nextRandom will generate a random (secure) valid example of this Semantic Type.- Specified by:
nextRandom
in interfaceLTRandom
- Overrides:
nextRandom
in classCheckDigitLT
- Returns:
- a new valid example of the Semantic Type.
-
-