public static class TelUri.Builder extends Object
| Constructor and Description |
|---|
Builder(String globalNumber)
Initializes the builder with a global telephone number.
|
Builder(String localNumber,
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(String extension)
Sets the extension.
|
TelUri.Builder |
globalNumber(String globalNumber)
Sets the telephone number as a global number.
|
TelUri.Builder |
isdnSubaddress(String isdnSubaddress)
Sets the ISDN sub address.
|
TelUri.Builder |
localNumber(String localNumber,
String phoneContext)
Sets the telephone number as a local number.
|
TelUri.Builder |
parameter(String name,
String value)
Adds a parameter.
|
public Builder(String globalNumber)
Initializes the builder with a global telephone number.
Global telephone numbers must:
0-9 (digits)- (hyphen). (period)( (opening parenthesis)) (closing parenthesis)globalNumber - the telephone number (e.g. "+1-212-555-0101")IllegalArgumentException - if the given telephone number does
not adhere to the above rulespublic Builder(String localNumber, 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)- (hyphen). (period)( (opening parenthesis)) (closing parenthesis)* (asterisk)# (hash)localNumber - the telephone number (e.g. "7042")phoneContext - the context under which the local number is valid
(e.g. "example.com")IllegalArgumentException - if the given telephone number does
not adhere to the above rulespublic TelUri.Builder globalNumber(String globalNumber)
Sets the telephone number as a global number.
Global telephone numbers must:
0-9 (digits)- (hyphen). (period)( (opening parenthesis)) (closing parenthesis)globalNumber - the telephone number (e.g. "+1-212-555-0101")IllegalArgumentException - if the given telephone number does
not adhere to the above rulespublic TelUri.Builder localNumber(String localNumber, 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)- (hyphen). (period)( (opening parenthesis)) (closing parenthesis)* (asterisk)# (hash)localNumber - the telephone number (e.g. "7042")phoneContext - the context under which the local number is valid
(e.g. "example.com")IllegalArgumentException - if the given telephone number does
not adhere to the above rulespublic TelUri.Builder extension(String extension)
extension - the extension (e.g. "101") or null to removeIllegalArgumentException - if the extension contains characters
other than the following: digits, hypens, parenthesis, periodspublic TelUri.Builder isdnSubaddress(String isdnSubaddress)
isdnSubaddress - the ISDN sub address or null to removepublic TelUri.Builder parameter(String name, String value)
name - the parameter name (can only contain letters, numbers,
and hyphens)value - the parameter value or null to remove itIllegalArgumentException - if the parameter name contains
invalid charactersCopyright © 2012–2023 Michael Angstadt. All rights reserved.