Class PhoneNumberService

java.lang.Object
restapi.utils.services.phone.PhoneNumberService

@Service public class PhoneNumberService extends Object
  • Field Details

    • phoneNumberUtil

      private final com.google.i18n.phonenumbers.PhoneNumberUtil phoneNumberUtil
  • Constructor Details

    • PhoneNumberService

      public PhoneNumberService()
  • Method Details

    • isPossibleNumber

      public boolean isPossibleNumber(String number, String country)
    • 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

      public String formatAsInternational(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone)
    • formatAsNational

      public String formatAsNational(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone)
    • formatWithoutSpaces

      public String formatWithoutSpaces(com.google.i18n.phonenumbers.Phonenumber.PhoneNumber phone)
    • getFormattedNumber

      public String getFormattedNumber(String number) throws CustomConflictException
      Throws:
      CustomConflictException
    • getFormattedNumberWithCountry

      public String getFormattedNumberWithCountry(String number, String country) throws CustomConflictException
      Throws:
      CustomConflictException
    • equalPhones

      public boolean equalPhones(String phone1, String phone2, String country)
    • getE164FormattedMobileNumber

      public String getE164FormattedMobileNumber(String mobile, String locale) throws CustomInternalErrorException
      Throws:
      CustomInternalErrorException