Package restapi.utils.services.phone
Class PhoneNumberService
java.lang.Object
restapi.utils.services.phone.PhoneNumberService
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.i18n.phonenumbers.PhoneNumberUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
equalPhones
(String phone1, String phone2, String country) formatAsInternational
(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone) formatAsNational
(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone) formatWithoutSpaces
(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone) getE164FormattedMobileNumber
(String mobile, String locale) getFormattedNumber
(String number) getFormattedNumberWithCountry
(String number, String country) boolean
isPossibleNumber
(String number, String country) boolean
isPossibleNumberForTypeFixedLine
(int number, int country) boolean
isPossibleNumberForTypeMobile
(int number, int country) boolean
isValidNumber
(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone) boolean
isValidNumberForRegion
(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone, String country) com.google.i18n.phonenumbers.Phonenumber.PhoneNumber
parsePhoneString
(String phone) com.google.i18n.phonenumbers.Phonenumber.PhoneNumber
parsePhoneStringWithCountry
(String phone, String country)
-
Field Details
-
phoneNumberUtil
private final com.google.i18n.phonenumbers.PhoneNumberUtil phoneNumberUtil
-
-
Constructor Details
-
PhoneNumberService
public PhoneNumberService()
-
-
Method Details
-
isPossibleNumber
-
isPossibleNumberForTypeFixedLine
public boolean isPossibleNumberForTypeFixedLine(int number, int country) -
isPossibleNumberForTypeMobile
public boolean isPossibleNumberForTypeMobile(int number, int country) -
parsePhoneString
public com.google.i18n.phonenumbers.Phonenumber.PhoneNumber parsePhoneString(String phone) throws CustomConflictException - Throws:
CustomConflictException
-
parsePhoneStringWithCountry
public com.google.i18n.phonenumbers.Phonenumber.PhoneNumber parsePhoneStringWithCountry(String phone, String country) throws CustomConflictException - Throws:
CustomConflictException
-
isValidNumber
public boolean isValidNumber(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone) -
isValidNumberForRegion
public boolean isValidNumberForRegion(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone, String country) -
formatAsInternational
-
formatAsNational
-
formatWithoutSpaces
-
getFormattedNumber
- Throws:
CustomConflictException
-
getFormattedNumberWithCountry
public String getFormattedNumberWithCountry(String number, String country) throws CustomConflictException - Throws:
CustomConflictException
-
equalPhones
-
getE164FormattedMobileNumber
public String getE164FormattedMobileNumber(String mobile, String locale) throws CustomInternalErrorException - Throws:
CustomInternalErrorException
-