public static class TelUri.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder(java.lang.String globalNumber)
Initializes the builder with a global telephone number.
|
Builder(java.lang.String localNumber,
java.lang.String phoneContext)
Initializes the builder with a local telephone number.
|
Builder(TelUri original)
Creates a new
TelUri builder. |
Modifier and Type | Method and Description |
---|---|
TelUri |
build()
Builds the final
TelUri object. |
TelUri.Builder |
extension(java.lang.String extension)
Sets the extension.
|
TelUri.Builder |
globalNumber(java.lang.String globalNumber)
Sets the telephone number as a global number.
|
TelUri.Builder |
isdnSubaddress(java.lang.String isdnSubaddress)
Sets the ISDN sub address.
|
TelUri.Builder |
localNumber(java.lang.String localNumber,
java.lang.String phoneContext)
Sets the telephone number as a local number.
|
TelUri.Builder |
parameter(java.lang.String name,
java.lang.String value)
Adds a parameter.
|
public Builder(java.lang.String globalNumber)
Initializes the builder with a global telephone number.
Global telephone numbers must:
0-9
(digits)-
(hypen).
(period)(
(opening paraenthesis))
(closing paraenthesis)globalNumber
- the telephone number (e.g. "+1-212-555-0101")java.lang.IllegalArgumentException
- if the given telephone number does
not adhere to the above rulespublic Builder(java.lang.String localNumber, java.lang.String phoneContext)
Initializes the builder with a local telephone number. Note, however, that the global format is preferred.
Local telephone numbers must:
0-9
(digit)*
(asterisk)#
(hash)0-9
(digits)-
(hypen).
(period)(
(opening paraenthesis))
(closing paraenthesis)*
(asterisk)#
(hash)localNumber
- the telephone number (e.g. "7042")phoneContext
- the context under which the local number is valid
(e.g. "example.com")java.lang.IllegalArgumentException
- if the given telephone number does
not adhere to the above rulespublic TelUri.Builder globalNumber(java.lang.String globalNumber)
Sets the telephone number as a global number.
Global telephone numbers must:
0-9
(digits)-
(hypen).
(period)(
(opening paraenthesis))
(closing paraenthesis)globalNumber
- the telephone number (e.g. "+1-212-555-0101")java.lang.IllegalArgumentException
- if the given telephone number does
not adhere to the above rulespublic TelUri.Builder localNumber(java.lang.String localNumber, java.lang.String phoneContext)
Sets the telephone number as a local number. Note, however, that the global format is preferred.
Local telephone numbers must:
0-9
(digit)*
(asterisk)#
(hash)0-9
(digits)-
(hypen).
(period)(
(opening paraenthesis))
(closing paraenthesis)*
(asterisk)#
(hash)localNumber
- the telephone number (e.g. "7042")phoneContext
- the context under which the local number is valid
(e.g. "example.com")java.lang.IllegalArgumentException
- if the given telephone number does
not adhere to the above rulespublic TelUri.Builder extension(java.lang.String extension)
extension
- the extension (e.g. "101") or null to removejava.lang.IllegalArgumentException
- if the extension contains characters
other than the following: digits, hypens, parenthesis, periodspublic TelUri.Builder isdnSubaddress(java.lang.String isdnSubaddress)
isdnSubaddress
- the ISDN sub address or null to removepublic TelUri.Builder parameter(java.lang.String name, java.lang.String value)
name
- the parameter name (can only contain letters, numbers,
and hyphens)value
- the parameter value or null to remove itjava.lang.IllegalArgumentException
- if the parameter name contains
invalid charactersThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.