Version

Parameterable

Parameterable can be explained as useful for header manipulation, but less critical compared to Address or URI.
The Parameterable interface represents SIP header field values that may include optional parameters. It is implemented by SIP headers that allow parameters to be appended to their values. Common examples include address-related headers such as Contact, From, To, Route, Record-Route, and Reply-To, all of which extend Parameterable. Additionally, non-address headers such as Accept, Accept-Encoding, Alert-Info, Call-Info, Content-Disposition, Content-Type, Error-Info, Retry-After, and Via are also Parameterable. The interface provides a unified way to handle headers with name-value pairs, facilitating the management and manipulation of SIP message components while ensuring compliance with SIP protocol requirements. By extending Cloneable, Parameterable allows the creation of copies for headers, making it flexible for modifying or replicating headers without altering the originals.

Methods:

getValue

java.lang.String getValue()

Retrieves the field value of the Parameterable object as a string. This value excludes any associated parameters.
Returns: The field value as a string, without parameters.

setValue

void setValue(java.lang.String value)

Sets the field value of the Parameterable object. The new value should not include any parameters.
Parameters:
value: The new field value as a string, excluding parameters.
Throws:
IllegalStateException: If the header field cannot be modified for this object.
NullPointerException: If the value parameter is null.

getParameter

java.lang.String getParameter(java.lang.String key)

Retrieves the value of a specified parameter by its name. If the parameter is not set, the method returns null. A zero-length string indicates the parameter is a flag.
Parameters:
key: The name of the parameter to retrieve.
Returns:
The value of the specified parameter, or null if the parameter is not set. A zero-length string indicates a flag parameter.
Throws:
NullPointerException: If the key is null.

setParameter

void setParameter(java.lang.String name,
                  java.lang.String value)

Sets or updates the value of the specified parameter. If the parameter already exists, its value is replaced with the new value. To set a flag parameter, specify a zero-length string as the value. Passing a null value removes the parameter, equivalent to calling removeParameter(String).
Parameters:
name: The name of the parameter to set.
value: The new value for the parameter. Use a zero-length string to indicate a flag parameter or null to remove the parameter.
Throws:
IllegalStateException: If the parameters cannot be modified for this object.
NullPointerException: If the name is null.

removeParameter

void removeParameter(java.lang.String name)

Removes the specified parameter from the object. If the parameter does not exist, no action is taken.
Parameters:
name: The name of the parameter to remove.
Throws:
IllegalStateException: If the parameters of this object cannot be modified.
NullPointerException: If the name parameter is null.

getParameterNames

java.util.Iterator<java.lang.String> getParameterNames()

Provides an iterator over the names of all parameters in the object. The names are returned in the order they appear within the Parameterable.
Returns:
An Iterator of String objects representing the names of all parameters contained in this object.

getParameters

java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getParameters()

Returns a collection view of all parameter name-value pairs in this Parameterable object. The parameters are presented in the order they appear in the Parameterable.
Returns:
A Set of Map.Entry objects, where each entry represents a parameter name-value mapping.

clone

java.lang.Object clone()

Creates a clone of this Parameterable object. The cloned instance retains the same field value and parameter mappings as the original.
Returns:
A cloned copy of this Parameterable.

equals

boolean equals(java.lang.Object o)

Compares this Parameterable object with another object for equality. The comparison includes the field value and any associated parameters, following these rules:

  • If the field value is in the name-addr or addr-spec format, it is compared using the Address.equals() method. Otherwise, standard string comparison is used for field values consisting of tokens.
  • Parameters are compared using the rules specified for URI parameters in RFC 3261, Section 19.1.4, with no restrictions for well-known URI parameters.

Overrides:
equals in class java.lang.Object.
Parameters:
o: The Parameterable object to compare with this instance.
Returns:
true if the two Parameterable objects are considered equal, otherwise false.

Start innovating with Mobius

What's next? Let's talk!

Mobius Software

As a company you'll get:

  • Get started quickly

  • Support any business model

  • Join millions of businesses

Questions? websupport@mobius.com