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

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

public class SipHeaderValueImpl
extends Object
implements SipHeaderValue

Class representing a single SIP header value. If a SIP header contains multiple values, it will contain multiple instances of this class.


Constructor Summary
SipHeaderValueImpl(String valueString)
          Creates a new SIP header value with the specified string.
SipHeaderValueImpl(String baseValue, Map<String,String> params)
          Creates a new header value with the specified base value and the specified parameters.
 
Method Summary
 boolean equals(Object obj)
           
 String getBaseValue()
          Accessor for the header value with no parameters.
 Map<String,String> getParams()
          Accessor for the map of header value parameters.
 String getParamValue(String paramName)
          Accessor for the value of the specified parameter.
 int hashCode()
           
 boolean hasParam(String paramName)
          Determines whether this header value contains the specified parameter name.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SipHeaderValueImpl

public SipHeaderValueImpl(String valueString)
                   throws IOException
Creates a new SIP header value with the specified string.

Parameters:
valueString - The header value as a string.
Throws:
IOException - If the header value does not match the expected syntax.

SipHeaderValueImpl

public SipHeaderValueImpl(String baseValue,
                          Map<String,String> params)
Creates a new header value with the specified base value and the specified parameters.

Parameters:
baseValue - The base value of the header with no parameters.
params - The header value parameters.
Method Detail

getParams

public Map<String,String> getParams()
Description copied from interface: SipHeaderValue
Accessor for the map of header value parameters. This returns a copy of the parameters, preserving the immutability of the header value.

Specified by:
getParams in interface SipHeaderValue
Returns:
The map of header value parameters.

getBaseValue

public String getBaseValue()
Description copied from interface: SipHeaderValue
Accessor for the header value with no parameters.

Specified by:
getBaseValue in interface SipHeaderValue
Returns:
The header value with no parameters.

hasParam

public boolean hasParam(String paramName)
Description copied from interface: SipHeaderValue
Determines whether this header value contains the specified parameter name.

Specified by:
hasParam in interface SipHeaderValue
Parameters:
paramName - The name of the specified parameter.
Returns:
true if the value has a parameter of the specified name, otherwise false.

getParamValue

public String getParamValue(String paramName)
Description copied from interface: SipHeaderValue
Accessor for the value of the specified parameter. Note that param values are immutable strings, so this preserved the immutability of header values.

Specified by:
getParamValue in interface SipHeaderValue
Parameters:
paramName - The name of the parameter to access.
Returns:
The value of the parameter with the specified name.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 LittleShoot. All Rights Reserved.