Interface TelURL

    • Method Detail

      • getPhoneNumber

        String getPhoneNumber()
        Returns the phone number of this TelURL. The returned string includes any visual separators present in the phone number part of the URL but does not include a leading "+" for global tel URLs.
        Returns:
        the number of this TelURL
      • getPhoneContext

        String getPhoneContext()
        Returns the phone context of this TelURL for local numbers, or null if the phone number is global.
        Returns:
        the phone context of this TelURL for local numbers, or null if the phone number is global.
      • setPhoneNumber

        void setPhoneNumber​(String number)
        Sets the (global) phone number of this TelURL. The specified number must be a valid global number for the "tel" scheme as described in RFC3966 (URLs for Telephone Calls). The following usage of this method will result in valid global phone number:

        setPhoneNumber("+1-201-555-0123")

        Parameters:
        number - the new global phone number
        Throws:
        IllegalArgumentException - if not a valid phone number
      • setPhoneNumber

        void setPhoneNumber​(String number,
                            String phoneContext)
        Sets the (local) phone number of this TelURL. The specified number must be a local phone number for the "tel" scheme as described in RFC3966 (URLs for Telephone Calls). The following usage of this method will result in a valid local phone number:

        setPhoneNumber("7042","example.com")

        Parameters:
        number - the new local phone number
        phoneContext - the phone-context parameter for this TelURL
        Throws:
        IllegalArgumentException - if not a valid phone number or phone-context
      • isGlobal

        boolean isGlobal()
        Returns true if this TelURL is global, false otherwise
        Returns:
        true if this TelURL is in global form