Methods Summary |
---|
public java.lang.Object | clone()Clone - do a deep copy.
try {
AcceptContactHeader retval = (AcceptContactHeader)
this.getClass().newInstance();
if (this.parameters != null)
retval.parameters = (NameValueList)parameters.clone();
return retval;
} catch (Exception ex) {
InternalErrorHandler.handleException(ex);
return null;
}
|
public java.lang.String | encodeBody()Encodes in canonical form.
return Separators.STAR + encodeWithSep();
|
public boolean | equals(java.lang.Object that)Compares for equivalence.
if (! that.getClass().equals(this.getClass())) {
return false;
} else {
AcceptContactHeader other = (AcceptContactHeader) that;
return this.parameters.equals(other.parameters);
}
|
public java.lang.String | getParameter(java.lang.String name)Returns the value of the named parameter, or null if it is not set. A
zero-length String indicates flag parameter.
String returnValue = super.getParameter(name);
if (returnValue != null) { // remove quotes
returnValue = returnValue.substring(1, returnValue.length() - 1);
}
return returnValue;
|
public java.lang.String | getType()Returns the value of the "type" parameter, or null if it is not set.
return getParameter(SIPConstants.GENERAL_TYPE);
|
public java.lang.Object | getValue()Gets the header value.
return Separators.STAR;
|
public void | setParameter(NameValue nv)Sets the specified parameter.
Object val = nv.getValue();
setParameter(nv.getName(), (val == null) ? null : val.toString());
|
public void | setParameter(java.lang.String name, java.lang.String value)Sets the specified parameter.
NameValue nv =
super.parameters.getNameValue(name.toLowerCase());
if (value == null) {
throw new NullPointerException("null value");
}
boolean quoteStart = value.startsWith(Separators.DOUBLE_QUOTE);
boolean quoteEnd = value.endsWith(Separators.DOUBLE_QUOTE);
if ((quoteStart && !quoteEnd) || (!quoteStart && quoteEnd)) {
throw new IllegalArgumentException
(value + " : Unexpected DOUBLE_QUOTE");
}
if (quoteStart) { // quoteEnd is true in this case
value = value.substring(1, value.length() - 1);
}
if (nv == null) {
nv = new NameValue(name.toLowerCase(), value);
nv.setQuotedValue();
super.setParameter(nv);
} else {
nv.setValue(value);
}
|
public void | setType(java.lang.String value)Sets the "type" parameter.
setParameter(SIPConstants.GENERAL_TYPE, value);
|