class URL implements Serializable {

    static String appendDefaultPort(String address, int defaultPort) {
        if (address != null && address.length() > 0 && defaultPort > 0) {
            int i = address.indexOf(':');
            if (i < 0) {
                return address + ":" + defaultPort;
            } else if (Integer.parseInt(address.substring(i + 1)) == 0) {
                return address.substring(0, i + 1) + defaultPort;
            }
        }
        return address;
    }

    protected  URL();
    public  URL(String protocol, String host, int port);
    public  URL(String protocol, String host, int port, String[] pairs);
    public  URL(String protocol, String host, int port, Map<String, String> parameters);
    public  URL(String protocol, String host, int port, String path);
    public  URL(String protocol, String host, int port, String path, String... pairs);
    public  URL(String protocol, String host, int port, String path, Map<String, String> parameters);
    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  URL(String protocol,
               String username,
               String password,
               String host,
               int port,
               String path,
               Map<String, String> parameters);
    public  URL(String protocol,
               String username,
               String password,
               String host,
               int port,
               String path,
               Map<String, String> parameters,
               Map<String, Map<String, String>> methodParameters);

}