public final class QueryString extends Object implements Serializable
QueryStringUtil
,
Serialized FormConstructor and Description |
---|
QueryString()
Private constructor prevents creation of an instance outside this class.
|
Modifier and Type | Method and Description |
---|---|
QueryString |
add(String name,
String value)
Adds the supplied name and value to this query string.
|
String |
toString()
Creates a String representation of this query string.
|
public QueryString()
public QueryString add(String name, String value)
QueryString query = new QueryString();
query.add("age", "41");
query.add"gender", "M");
Note: This method does not guard against adding the same name twice.name
- Name of the query parameter to add.
value
- Value of the query parameter to add.
IllegalArgumentException
- When the supplied name is empty.NullPointerException
- When the supplied name is null.public String toString()
Copyright © 2008–2018. All rights reserved.