org.lastbamboo.common.sip.stack.message.header
Class SipHeaderImpl

java.lang.Object
  extended by org.lastbamboo.common.sip.stack.message.header.SipHeaderImpl
All Implemented Interfaces:
SipHeader

public class SipHeaderImpl
extends Object
implements SipHeader

Bean for a single SIP header.


Constructor Summary
SipHeaderImpl(String headerName, List<SipHeaderValue> headerValues)
          Creates a new SIP header with the specified name and values.
SipHeaderImpl(String headerName, SipHeaderValue headerValue)
          Creates a new SIP header with the specified name and value.
 
Method Summary
 void addValue(SipHeaderValue headerValue)
          Adds the value of the specified header to the value for this header.
 String getName()
          Accessor for the name of the header.
 SipHeaderValue getValue()
          Accessor for the header value.
 List<SipHeaderValue> getValues()
          Accessor for the header values.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SipHeaderImpl

public SipHeaderImpl(String headerName,
                     List<SipHeaderValue> headerValues)
Creates a new SIP header with the specified name and values.

Parameters:
headerName - The name of the header.
headerValues - The values of the header.

SipHeaderImpl

public SipHeaderImpl(String headerName,
                     SipHeaderValue headerValue)
Creates a new SIP header with the specified name and value.

Parameters:
headerName - The name of the header.
headerValue - The value of the header.
Method Detail

getName

public String getName()
Description copied from interface: SipHeader
Accessor for the name of the header.

Specified by:
getName in interface SipHeader
Returns:
The name of the header.

getValues

public List<SipHeaderValue> getValues()
Description copied from interface: SipHeader
Accessor for the header values. This is useful for headers containing multiple values. For other headers, this Collection will contain only a single entry.

Specified by:
getValues in interface SipHeader
Returns:
The Collection of header field values. Each entry in the collection is a header value.

getValue

public SipHeaderValue getValue()
Description copied from interface: SipHeader
Accessor for the header value. If this header contains multiple values, this will return the first one.

Specified by:
getValue in interface SipHeader
Returns:
The header value, or simply the first value if this header contains multiple values.

addValue

public void addValue(SipHeaderValue headerValue)
Description copied from interface: SipHeader
Adds the value of the specified header to the value for this header. This uses the rules for providing multiple header values for a single header name specified in RFC 3261 section 7.3.1.

Specified by:
addValue in interface SipHeader
Parameters:
headerValue - The header value to add to this header.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 LittleShoot. All Rights Reserved.