문제

URI를 인코딩하기위한 편의 수업이 있습니다. 그것에서 나는 내가 얼마나 구체적으로 필요한지에 따라 사용하는 세 가지 방법을 만들었습니다. 재사용하는 현명한 방법이 있는지 궁금합니다. @param 이 경우 Javadoc을 사용하는 설명? (나는 아무것도 찾지 못했다)

public class URLCreator {
    public static String getURLString(String host, int port, String path) {
        return getURLString("http", host, port, path, null);
    }
    public static String getURLString(String scheme, String host, int port, String path) {
        return getURLString(scheme, host, port, path, null);
    }
    public static String getURLString(String scheme, String host, int port, String path, String fragment) {
        try {
            URI uri = new URI(scheme, null, host, port, path, null, fragment);
            return uri.toString();
        } catch (URISyntaxException e) {
            throw new RuntimeException(e);
        }
    }
}
도움이 되었습니까?

해결책

아니요. 복사는 재정의를 위해 작동하지만 과부하 된 방법에는 적합하지 않습니다. http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javadoc.html#inheringcomments

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top