Class 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).
    • 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 class CheckDigitLT
        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 class LogicalType
        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 interface LTRandom
        Overrides:
        nextRandom in class CheckDigitLT
        Returns:
        a new valid example of the Semantic Type.