public final class URL extends Object implements Serializable
url example:
Some strange example below:
URL,
URI,
Serialized Form| Constructor and Description |
|---|
URL(String protocol,
String host,
int port) |
URL(String protocol,
String host,
int port,
Map<String,String> parameters) |
URL(String protocol,
String host,
int port,
String path) |
URL(String protocol,
String host,
int port,
String[] pairs) |
URL(String protocol,
String host,
int port,
String path,
Map<String,String> parameters) |
URL(String protocol,
String host,
int port,
String path,
String... pairs) |
URL(String protocol,
String username,
String password,
String host,
int port,
String path) |
URL(String protocol,
String username,
String password,
String host,
int port,
String path,
Map<String,String> parameters) |
URL(String protocol,
String username,
String password,
String host,
int port,
String path,
String... pairs) |
| Modifier and Type | Method and Description |
|---|---|
URL |
addParameter(String key,
boolean value) |
URL |
addParameter(String key,
byte value) |
URL |
addParameter(String key,
char value) |
URL |
addParameter(String key,
CharSequence value) |
URL |
addParameter(String key,
double value) |
URL |
addParameter(String key,
Enum<?> value) |
URL |
addParameter(String key,
float value) |
URL |
addParameter(String key,
int value) |
URL |
addParameter(String key,
long value) |
URL |
addParameter(String key,
Number value) |
URL |
addParameter(String key,
short value) |
URL |
addParameter(String key,
String value) |
URL |
addParameterAndEncoded(String key,
String value) |
URL |
addParameterIfAbsent(String key,
String value) |
URL |
addParameters(Map<String,String> parameters)
Add parameters to a new url.
|
URL |
addParameters(String... pairs) |
URL |
addParametersIfAbsent(Map<String,String> parameters) |
URL |
addParameterString(String query) |
URL |
clearParameters() |
static String |
decode(String value) |
static String |
encode(String value) |
boolean |
equals(Object obj) |
String |
getAbsolutePath() |
String |
getAddress() |
String |
getAuthority() |
String |
getBackupAddress() |
String |
getBackupAddress(int defaultPort) |
List<URL> |
getBackupUrls() |
boolean |
getBooleanParameter(String key)
Deprecated.
Replace to
getParameter(String, boolean) |
boolean |
getBooleanParameter(String key,
boolean defaultValue)
Deprecated.
Replace to
getParameter(String, boolean) |
String |
getHost() |
int |
getIntParameter(String key)
Deprecated.
Replace to
getParameter(String, int) |
int |
getIntParameter(String key,
int defaultValue)
Deprecated.
Replace to
getParameter(String, int) |
String |
getIp()
Fetch IP address for this URL.
|
boolean |
getMethodBooleanParameter(String method,
String key)
Deprecated.
Replace to
getMethodParameter(String, String, boolean) |
boolean |
getMethodBooleanParameter(String method,
String key,
boolean defaultValue)
Deprecated.
Replace to
getMethodParameter(String, String, boolean) |
int |
getMethodIntParameter(String method,
String key)
Deprecated.
Replace to
getMethodParameter(String, String, int) |
int |
getMethodIntParameter(String method,
String key,
int defaultValue)
Deprecated.
Replace to
getMethodParameter(String, String, int) |
String |
getMethodParameter(String method,
String key) |
boolean |
getMethodParameter(String method,
String key,
boolean defaultValue) |
byte |
getMethodParameter(String method,
String key,
byte defaultValue) |
char |
getMethodParameter(String method,
String key,
char defaultValue) |
double |
getMethodParameter(String method,
String key,
double defaultValue) |
float |
getMethodParameter(String method,
String key,
float defaultValue) |
int |
getMethodParameter(String method,
String key,
int defaultValue) |
long |
getMethodParameter(String method,
String key,
long defaultValue) |
short |
getMethodParameter(String method,
String key,
short defaultValue) |
String |
getMethodParameter(String method,
String key,
String defaultValue) |
String |
getMethodParameterAndDecoded(String method,
String key) |
String |
getMethodParameterAndDecoded(String method,
String key,
String defaultValue) |
int |
getMethodPositiveIntParameter(String method,
String key,
int defaultValue)
Deprecated.
Replace to
getMethodPositiveParameter(String, String, int) |
byte |
getMethodPositiveParameter(String method,
String key,
byte defaultValue) |
double |
getMethodPositiveParameter(String method,
String key,
double defaultValue) |
float |
getMethodPositiveParameter(String method,
String key,
float defaultValue) |
int |
getMethodPositiveParameter(String method,
String key,
int defaultValue) |
long |
getMethodPositiveParameter(String method,
String key,
long defaultValue) |
short |
getMethodPositiveParameter(String method,
String key,
short defaultValue) |
String |
getParameter(String key) |
boolean |
getParameter(String key,
boolean defaultValue) |
byte |
getParameter(String key,
byte defaultValue) |
char |
getParameter(String key,
char defaultValue) |
double |
getParameter(String key,
double defaultValue) |
float |
getParameter(String key,
float defaultValue) |
int |
getParameter(String key,
int defaultValue) |
long |
getParameter(String key,
long defaultValue) |
short |
getParameter(String key,
short defaultValue) |
String |
getParameter(String key,
String defaultValue) |
String[] |
getParameter(String key,
String[] defaultValue) |
String |
getParameterAndDecoded(String key) |
String |
getParameterAndDecoded(String key,
String defaultValue) |
Map<String,String> |
getParameters() |
String |
getPassword() |
String |
getPath() |
int |
getPort() |
int |
getPort(int defaultPort) |
int |
getPositiveIntParameter(String key,
int defaultValue)
Deprecated.
Replace to
getPositiveParameter(String, int) |
byte |
getPositiveParameter(String key,
byte defaultValue) |
double |
getPositiveParameter(String key,
double defaultValue) |
float |
getPositiveParameter(String key,
float defaultValue) |
int |
getPositiveParameter(String key,
int defaultValue) |
long |
getPositiveParameter(String key,
long defaultValue) |
short |
getPositiveParameter(String key,
short defaultValue) |
String |
getProtocol() |
String |
getRawParameter(String key) |
String |
getServiceInterface() |
String |
getServiceKey() |
String |
getServiceName()
Deprecated.
|
URL |
getUrlParameter(String key) |
String |
getUsername() |
int |
hashCode() |
boolean |
hasMethodParameter(String method,
String key) |
boolean |
hasParameter(String key) |
boolean |
isAnyHost() |
boolean |
isLocalHost() |
URL |
removeParameter(String key) |
URL |
removeParameters(Collection<String> keys) |
URL |
removeParameters(String... keys) |
URL |
setAddress(String address) |
URL |
setHost(String host) |
URL |
setPassword(String password) |
URL |
setPath(String path) |
URL |
setPort(int port) |
URL |
setProtocol(String protocol) |
URL |
setServiceInterface(String service) |
URL |
setUsername(String username) |
String |
toFullString() |
String |
toFullString(String... parameters) |
String |
toIdentityString() |
String |
toIdentityString(String... parameters) |
InetSocketAddress |
toInetSocketAddress() |
URL |
toJavaURL() |
Map<String,String> |
toMap() |
String |
toParameterString() |
String |
toParameterString(String... parameters) |
String |
toServiceString() |
String |
toServiceStringWithoutResolving() |
String |
toString() |
String |
toString(String... parameters) |
static URL |
valueOf(String url)
Parse url string
|
public URL(String protocol, String username, String password, String host, int port, String path)
public URL(String protocol, String username, String password, String host, int port, String path, String... pairs)
public static URL valueOf(String url)
url - URL stringURLpublic String getProtocol()
public String getUsername()
public String getPassword()
public String getAuthority()
public String getHost()
public String getIp()
public int getPort()
public URL setPort(int port)
public int getPort(int defaultPort)
public String getAddress()
public String getBackupAddress()
public String getBackupAddress(int defaultPort)
public String getPath()
public String getAbsolutePath()
public double getParameter(String key, double defaultValue)
public float getParameter(String key, float defaultValue)
public long getParameter(String key, long defaultValue)
public int getParameter(String key, int defaultValue)
public short getParameter(String key, short defaultValue)
public byte getParameter(String key, byte defaultValue)
public float getPositiveParameter(String key, float defaultValue)
public double getPositiveParameter(String key, double defaultValue)
public long getPositiveParameter(String key, long defaultValue)
public int getPositiveParameter(String key, int defaultValue)
public short getPositiveParameter(String key, short defaultValue)
public byte getPositiveParameter(String key, byte defaultValue)
public char getParameter(String key, char defaultValue)
public boolean getParameter(String key, boolean defaultValue)
public boolean hasParameter(String key)
public String getMethodParameterAndDecoded(String method, String key, String defaultValue)
public double getMethodPositiveParameter(String method, String key, double defaultValue)
public float getMethodPositiveParameter(String method, String key, float defaultValue)
public long getMethodPositiveParameter(String method, String key, long defaultValue)
public int getMethodPositiveParameter(String method, String key, int defaultValue)
public short getMethodPositiveParameter(String method, String key, short defaultValue)
public byte getMethodPositiveParameter(String method, String key, byte defaultValue)
public boolean getMethodParameter(String method, String key, boolean defaultValue)
public boolean isLocalHost()
public boolean isAnyHost()
public URL addParameter(String key, CharSequence value)
public URL addParameters(Map<String,String> parameters)
parameters - parameters in key-value pairspublic URL removeParameters(Collection<String> keys)
public URL clearParameters()
public String toIdentityString()
public String toFullString()
public String toParameterString()
public URL toJavaURL()
public InetSocketAddress toInetSocketAddress()
public String getServiceKey()
public String toServiceStringWithoutResolving()
public String toServiceString()
@Deprecated public String getServiceName()
public String getServiceInterface()
@Deprecated public int getIntParameter(String key)
getParameter(String, int)getParameter(String, int)@Deprecated public int getIntParameter(String key, int defaultValue)
getParameter(String, int)getParameter(String, int)@Deprecated public int getPositiveIntParameter(String key, int defaultValue)
getPositiveParameter(String, int)getPositiveParameter(String, int)@Deprecated public boolean getBooleanParameter(String key)
getParameter(String, boolean)getParameter(String, boolean)@Deprecated public boolean getBooleanParameter(String key, boolean defaultValue)
getParameter(String, boolean)getParameter(String, boolean)@Deprecated public int getMethodIntParameter(String method, String key)
getMethodParameter(String, String, int)@Deprecated public int getMethodIntParameter(String method, String key, int defaultValue)
getMethodParameter(String, String, int)@Deprecated public int getMethodPositiveIntParameter(String method, String key, int defaultValue)
getMethodPositiveParameter(String, String, int)@Deprecated public boolean getMethodBooleanParameter(String method, String key)
getMethodParameter(String, String, boolean)@Deprecated public boolean getMethodBooleanParameter(String method, String key, boolean defaultValue)
getMethodParameter(String, String, boolean)Copyright © 2011–2018 The Dubbo Project. All rights reserved.