Class NumberChecker


  • public class NumberChecker
    extends CodeValidation
    Provide a means to check if a String consist of characters from 0 to 9 and a decimal point in case a decimal is expected.
    • Constructor Detail

      • NumberChecker

        public NumberChecker​(int type)
        Creates a specific number checker.
        Parameters:
        type - the type of checker that needs to be created: INTEGER, ANY_DECIMALS, TWO_DECIMALS, or FOUR_DECIMALS
    • Method Detail

      • isValid

        public boolean isValid​(String code)
        Description copied from class: CodeValidation
        Checks if a specific code is valid.
        Specified by:
        isValid in class CodeValidation
        Parameters:
        code - the value you want to check
        Returns:
        true if the code is valid