NIST SIP Parser and Stack (v1.2) API

gov.nist.core
Class NameValue

java.lang.Object
  |
  +--gov.nist.core.GenericObject
        |
        +--gov.nist.core.NameValue

public class NameValue
extends GenericObject

Generic structure for storing name-value pairs.

Version:
JAIN-SIP-1.1
Author:
M. Ranganathan
This code is in the public domain.

Constructor Summary
NameValue()
           
NameValue(String n, Object v)
           
 
Method Summary
 Object clone()
          Make a clone of this object.
 String encode()
          Get the encoded representation of this namevalue object.
 boolean equals(Object other)
          Equality comparison predicate.
 String getName()
           
 Object getValue()
           
 boolean isValueQuoted()
          Return true if the value is quoted in doublequotes.
 void setName(String n)
          Set the name member
 void setQuotedValue()
          A flag that indicates that doublequotes should be put around the value when encoded (for example name=value when value is doublequoted).
 void setSeparator(String sep)
          Set the separator for the encoding method below.
 void setValue(Object v)
          Set the value member
 
Methods inherited from class gov.nist.core.GenericObject
debugDump, debugDump, getClassFromName, getMatcher, isMySubclass, match, merge, replace, replace, replace, replace, setMatcher
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameValue

public NameValue()

NameValue

public NameValue(String n,
                 Object v)
Method Detail

setSeparator

public void setSeparator(String sep)
Set the separator for the encoding method below.


setQuotedValue

public void setQuotedValue()
A flag that indicates that doublequotes should be put around the value when encoded (for example name=value when value is doublequoted).


isValueQuoted

public boolean isValueQuoted()
Return true if the value is quoted in doublequotes.


getName

public String getName()

getValue

public Object getValue()

setName

public void setName(String n)
Set the name member


setValue

public void setValue(Object v)
Set the value member


encode

public String encode()
Get the encoded representation of this namevalue object. Added doublequote for encoding doublequoted values (bug reported by Kirby Kiem).

Specified by:
encode in class GenericObject
Returns:
an encoded name value (eg. name=value) string.
Since:
1.0

clone

public Object clone()
Description copied from class: GenericObject
Make a clone of this object.

Overrides:
clone in class GenericObject

equals

public boolean equals(Object other)
Equality comparison predicate.

Overrides:
equals in class GenericObject
Returns:
true if the objects are euqal and false otherwise

NIST SIP Parser and Stack (v1.2) API

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Get the latest distribution.
Submit a bug report or feature request.