public class QueryStringEncoder
extends java.lang.Object
QueryStringEncoderencoder = newQueryStringEncoder("/hello"); encoder.addParam("recipient", "world"); assert encoder.toString().equals("/hello?recipient=world");
QueryStringDecoder| Constructor and Description |
|---|
QueryStringEncoder(java.lang.String uri)
Creates a new encoder that encodes a URI that starts with the specified
path string.
|
QueryStringEncoder(java.lang.String uri,
java.nio.charset.Charset charset)
Creates a new encoder that encodes a URI that starts with the specified
path string in the specified charset.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addParam(java.lang.String name,
java.lang.String value)
Adds a parameter with the specified name and value to this encoder.
|
java.lang.String |
toString()
Returns the URL-encoded URI which was created from the path string
specified in the constructor and the parameters added by
addParam(String, String) method. |
java.net.URI |
toUri()
Returns the URL-encoded URI object which was created from the path string
specified in the constructor and the parameters added by
addParam(String, String) method. |
public QueryStringEncoder(java.lang.String uri)
public QueryStringEncoder(java.lang.String uri,
java.nio.charset.Charset charset)
public void addParam(java.lang.String name,
java.lang.String value)
public java.net.URI toUri()
throws java.net.URISyntaxException
addParam(String, String) method.java.net.URISyntaxExceptionpublic java.lang.String toString()
addParam(String, String) method.toString in class java.lang.ObjectCopyright © 2008–2018 The Netty Project. All rights reserved.