aps/validate/phone

Table of contents

Public Methods

METHOD

RETURN

DESCRIPTION

getInvalidMessage (phoneNumber, countryCode)

Returns reason when validation not passed

isValid (phoneNumber, countryCode)

boolean

Tests whether a phone number matches a valid pattern

getInvalidMessage

Returns reason when validation not passed.

ARGUMENT

TYPE

DESCRIPTION

phoneNumber

String

The phone number in string

countryCode

String

ISO 3166-1 two-letter country code. Region that we are expecting the number to be from. This is only used if the number being parsed is not written in international format.

isValid

Tests whether a phone number matches a valid pattern.

Return: boolean

ARGUMENT

TYPE

DESCRIPTION

phoneNumber

String

The phone number in string

countryCode

String

ISO 3166-1 two-letter country code. Region that we are expecting the number to be from. This is only used if the number being parsed is not written in international format.