Methods Summary |
---|
public java.lang.Object | clone()Copies the current instance.
CSeqHeader retval = new CSeqHeader();
if (this.seqno != null)
retval.seqno = new Integer(this.seqno.intValue());
retval.method = this.method;
return retval;
|
public java.lang.String | encodeBody()Return canonical header content. (encoded header except headerName:)
return seqno + Separators.SP + method.toUpperCase();
|
public boolean | equals(java.lang.Object other)Compare two cseq headers for equality.
if (! other.getClass().equals(this.getClass())) {
return false;
}
CSeqHeader that = (CSeqHeader) other;
if (! this.seqno.equals(that.seqno)) {
return false;
}
if (! equalsIgnoreCase(this.method, that.method)) {
return false;
}
return true;
|
public java.lang.String | getMethod()Get the method.
return method.toUpperCase();
|
public NameValueList | getParameters()Gets the parameters.
return null;
|
public int | getSequenceNumber()Gets the sequence number of this CSeqHeaderHeader.
if (this.seqno == null)
return 0;
else return this.seqno.intValue();
|
public java.lang.Object | getValue()Gets the header value.
return seqno + Separators.SP + method.toUpperCase();
|
public void | setHeaderValue(java.lang.String value)Sets the header value field.
int newSeqNo;
String newMethod;
value = value.trim();
// Check if the sequence number presents
int delimIndex = value.indexOf(' ");
if (delimIndex == -1) {
// IMPL_NOTE: set some flag to indicate that
// the Sequence Number is not set.
setMethod(value.trim());
return;
}
try {
String strNum = value.substring(0, delimIndex).trim();
newSeqNo = Integer.parseInt(strNum);
setSequenceNumber(newSeqNo);
} catch (IllegalArgumentException iae) {
throw iae;
}
newMethod = value.substring(delimIndex, value.length()).trim();
setMethod(newMethod);
|
public void | setMethod(java.lang.String meth)Set the method member
if (meth == null)
throw new NullPointerException("parameter is null");
method = meth;
|
public void | setSequenceNumber(int sequenceNumber)Sets the sequence number of this CSeqHeaderHeader. The sequence number
MUST be expressible as a 32-bit unsigned integer and MUST be less than
2**31.
if (sequenceNumber < 0)
throw new IllegalArgumentException
("the sequence number parameter is < 0");
seqno = new Integer(sequenceNumber);
|