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 TypeMethodDescriptionbooleanequalPhones(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) booleanisPossibleNumber(String number, String country) booleanisPossibleNumberForTypeFixedLine(int number, int country) booleanisPossibleNumberForTypeMobile(int number, int country) booleanisValidNumber(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone) booleanisValidNumberForRegion(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone, String country) com.google.i18n.phonenumbers.Phonenumber.PhoneNumberparsePhoneString(String phone) com.google.i18n.phonenumbers.Phonenumber.PhoneNumberparsePhoneStringWithCountry(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
-