Class TelephoneValidator

  • All Implemented Interfaces:
    IValidator, Serializable

    public class TelephoneValidator
    extends Object
    implements IValidator
    Validates telephone number The object of this class is constructed using default constructor and validate function is used to validate telephone number passing the telephone number as argument to the function. Upon validation the validate function returns boolean value.
    See Also:
    Serialized Form
    • Constructor Detail

      • TelephoneValidator

        public TelephoneValidator()
    • Method Detail

      • validate

        public boolean validate​(String value,
                                String rule)
        Determines if the value is a valid "basic" telephone number string
        Specified by:
        validate in interface IValidator
        Parameters:
        value - string value to validate
        rule - not used by this method
        Returns:
        true if the value represents a valid telephone number string
      • validate

        public boolean validate​(String telephone)
        Determines whether the specified string is a valid "basic" telephone number string
        Parameters:
        telephone - string telephone to validate
        Returns:
        true if telephone is a valid telephone number string