public class Parameter extends java.lang.Object implements java.lang.Comparable<Parameter>, NamedValue<java.lang.String>
Constructor and Description |
---|
Parameter()
Default constructor.
|
Parameter(java.lang.String name,
java.lang.String value)
Preferred constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Parameter o) |
static Parameter |
create(java.lang.CharSequence name,
java.lang.CharSequence value)
Creates a parameter.
|
void |
encode(java.lang.Appendable buffer,
CharacterSet characterSet)
Encodes the parameter into the target buffer.
|
java.lang.String |
encode(CharacterSet characterSet)
Encodes the parameter as a string.
|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getName()
Returns the name of this parameter.
|
java.lang.String |
getValue()
Returns the value.
|
int |
hashCode() |
void |
setName(java.lang.String name) |
void |
setValue(java.lang.String value)
Sets the value.
|
java.lang.String |
toString() |
public Parameter()
public Parameter(java.lang.String name, java.lang.String value)
name
- The name.value
- The value.public static Parameter create(java.lang.CharSequence name, java.lang.CharSequence value)
name
- The parameter name buffer.value
- The parameter value buffer (can be null).java.io.IOException
public int compareTo(Parameter o)
compareTo
in interface java.lang.Comparable<Parameter>
public void encode(java.lang.Appendable buffer, CharacterSet characterSet) throws java.io.IOException
buffer
- The target buffer.characterSet
- The character set to use.java.io.IOException
public java.lang.String encode(CharacterSet characterSet) throws java.io.IOException
characterSet
- The character set to use.java.io.IOException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getName()
NamedValue
getName
in interface NamedValue<java.lang.String>
public java.lang.String getValue()
NamedValue
getValue
in interface NamedValue<java.lang.String>
public int hashCode()
hashCode
in class java.lang.Object
public void setName(java.lang.String name)
public void setValue(java.lang.String value)
NamedValue
setValue
in interface NamedValue<java.lang.String>
value
- The value.public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2005-2024 Restlet.