Class MobilePhoneNumberUtil


  • public final class MobilePhoneNumberUtil
    extends Object
    The MobilePhoneNumberUtil class is a utility class which provides methods for working with mobile phone numbers and MSISDNs.
    Author:
    Marcus Portmann
    • Field Detail

      • MSISDN_VALIDATION_REGEX

        public static final String MSISDN_VALIDATION_REGEX
        The regular expression used to validate an MobilePhoneNumberUtil.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MobilePhoneNumberUtil

        public MobilePhoneNumberUtil()
    • Method Detail

      • isValidMSISDN

        public static boolean isValidMSISDN​(String msisdn)
        Check whether the specified MobilePhoneNumberUtil is valid.
        Parameters:
        msisdn - the MobilePhoneNumberUtil
        Returns:
        true if the MobilePhoneNumberUtil is valid or false otherwise
      • mobilePhoneNumberToMSISDN

        public static String mobilePhoneNumberToMSISDN​(String mobilePhoneNumber,
                                                       String defaultInternationalPrefix)
        Returns the MobilePhoneNumberUtil for the specified mobile phone number.
        Parameters:
        mobilePhoneNumber - the mobile phone number
        defaultInternationalPrefix - the default international prefix
        Returns:
        the MobilePhoneNumberUtil for the mobile phone number