Package org.jainslee.resources.sip
Interface TelURL
-
- All Superinterfaces:
Cloneable
,Serializable
,URI
public interface TelURL extends URI
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getPhoneContext()
Returns the phone context of this TelURL for local numbers, ornull
if the phone number is global.String
getPhoneNumber()
Returns the phone number of this TelURL.boolean
isGlobal()
Returnstrue
if this TelURL is global,false
otherwisevoid
setPhoneNumber(String number)
Sets the (global) phone number of this TelURL.void
setPhoneNumber(String number, String phoneContext)
Sets the (local) phone number of this TelURL.-
Methods inherited from interface org.jainslee.resources.sip.URI
clone, getParameter, getParameterNames, getScheme, isSipURI, removeParameter, setParameter, toString
-
-
-
-
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, ornull
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 numberphoneContext
- the phone-context parameter for this TelURL- Throws:
IllegalArgumentException
- if not a valid phone number or phone-context
-
isGlobal
boolean isGlobal()
Returnstrue
if this TelURL is global,false
otherwise- Returns:
true
if this TelURL is in global form
-
-