public final class UriBuilder extends Object
| Modifier and Type | Method and Description |
|---|---|
UriBuilder |
addQuery(String key,
String value)
Sets the value to the toString value of the argument.
|
URI |
build() |
URL |
buildURL() |
static UriBuilder |
create()
Creates an empty builder populated with null values.
|
static UriBuilder |
create(String uri) |
static UriBuilder |
create(String scheme,
String userInfo,
String host,
Integer port,
String path,
String query,
String fragment) |
static UriBuilder |
create(URI uri) |
String |
getFragment() |
String |
getHost() |
String |
getPath() |
int |
getPort()
Returns the port or 80 if not set.
|
String |
getQuery() |
List<String> |
getQuery(String key) |
String |
getScheme() |
String |
getUserInfo() |
boolean |
hasQuery(String key) |
UriBuilder |
parse(String uriString) |
NameListPair<String> |
removeQuery(String key) |
UriBuilder |
setFragment(Object fragment)
Sets the value to the toString value of the argument.
|
UriBuilder |
setHost(Object host)
Sets the value to the toString value of the argument.
|
UriBuilder |
setPath(Object path)
Sets the value to the toString value of the argument.
|
UriBuilder |
setPort(int port) |
UriBuilder |
setQuery(String query)
Sets the value to the toString value of the argument.
|
UriBuilder |
setQuery(String key,
String value)
Sets the value to the toString value of the argument.
|
UriBuilder |
setScheme(Object scheme)
Sets the value to the toString value of the argument.
|
UriBuilder |
setUserInfo(Object userInfo)
Sets the value to the toString value of the argument.
|
String |
toString()
Returns the URI as a string.
|
static String |
writeQuery(CaseInsensitiveMap<NameListPair<String>> map) |
public static String writeQuery(CaseInsensitiveMap<NameListPair<String>> map)
public static UriBuilder create(String scheme, String userInfo, String host, Integer port, String path, String query, String fragment)
public static UriBuilder create(URI uri)
public static UriBuilder create(String uri)
public static UriBuilder create()
public String getScheme()
public UriBuilder setScheme(Object scheme)
scheme - an object whose toString value forms the scheme part; may be nullpublic String getUserInfo()
public UriBuilder setUserInfo(Object userInfo)
userInfo - an object whose toString value forms the user info part; may be
nullpublic String getHost()
public UriBuilder setHost(Object host)
host - an object whose toString value forms the host part; may be nullpublic int getPort()
public UriBuilder setPort(int port)
port - the port number or 80 to unsetpublic String getPath()
public UriBuilder setPath(Object path)
path - an object whose toString value forms the fragment part; may be
nullpublic String getQuery()
public UriBuilder setQuery(String query)
query - an object whose toString value forms the query part; may be nullpublic UriBuilder setQuery(String key, String value)
key - keyvalue - valuepublic UriBuilder addQuery(String key, String value)
key - keyvalue - valuepublic boolean hasQuery(String key)
public NameListPair<String> removeQuery(String key)
public String getFragment()
public UriBuilder setFragment(Object fragment)
fragment - an object whose toString value forms the fragment part; may be
nullpublic URI build()
public URL buildURL() throws MalformedURLException
MalformedURLExceptionpublic UriBuilder parse(String uriString)
Copyright © 2016. All rights reserved.