public final class ParameterList extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable, java.lang.Comparable<ParameterList>
ParameterList
- Represents the parameter list of a parameterized header.Constructor and Description |
---|
ParameterList()
Initializes a new, empty parameter list.
|
ParameterList(java.lang.String parameterList)
Initializes a new parameter list from specified parameter list's string representation.
|
Modifier and Type | Method and Description |
---|---|
void |
addParameter(java.lang.String name,
java.lang.String value)
Adds specified value to given parameter name.
|
void |
appendRFC2045String(com.openexchange.java.StringAllocator sb)
Appends the RFC2045 style (ASCII-only) string representation of this parameter list including empty parameters.
|
void |
appendRFC2045String(com.openexchange.java.StringAllocator sb,
boolean skipEmptyParam)
Appends the RFC2045 style (ASCII-only) string representation of this parameter list.
|
void |
clearParameters()
Clears all parameters contained in this parameter list.
|
java.lang.Object |
clone() |
int |
compareTo(ParameterList other) |
boolean |
containsParameter(java.lang.String name)
Checks if parameter is present
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getParameter(java.lang.String name)
Gets specified parameter's value
|
java.util.Iterator<java.lang.String> |
getParameterNames()
Gets all parameter names wrapped in an
Iterator |
int |
hashCode() |
java.lang.String |
removeParameter(java.lang.String name)
Removes specified parameter and returns its value
|
void |
setParameter(java.lang.String name,
java.lang.String value)
Sets the given parameter.
|
java.lang.String |
toString()
Returns the unicode (mail-safe) string representation of this parameter list
|
public ParameterList()
public ParameterList(java.lang.String parameterList)
parameterList
- The parameter list's string representationpublic int compareTo(ParameterList other)
compareTo
in interface java.lang.Comparable<ParameterList>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.Object clone()
clone
in class java.lang.Object
public void setParameter(java.lang.String name, java.lang.String value)
name
- The sole parameter namevalue
- The parameter valuepublic void addParameter(java.lang.String name, java.lang.String value)
name
- The parameter namevalue
- The parameter value to addpublic java.lang.String getParameter(java.lang.String name)
name
- The parameter namenull
if not existingpublic java.lang.String removeParameter(java.lang.String name)
name
- The parameter namenull
if not existingpublic boolean containsParameter(java.lang.String name)
name
- the parameter nametrue
if parameter is present; otherwise false
public java.util.Iterator<java.lang.String> getParameterNames()
Iterator
Iterator
public void clearParameters()
public void appendRFC2045String(com.openexchange.java.StringAllocator sb)
sb
- The string builder to append toappendRFC2045String(com.openexchange.java.StringAllocator, boolean)
public void appendRFC2045String(com.openexchange.java.StringAllocator sb, boolean skipEmptyParam)
sb
- The string builder to append toskipEmptyParam
- true
to skip empty parameters; otherwise false
public java.lang.String toString()
toString
in class java.lang.Object