diff --git a/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspRequestDecoder.java b/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspRequestDecoder.java index e328a34a90..856c4b254c 100644 --- a/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspRequestDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspRequestDecoder.java @@ -23,7 +23,7 @@ import org.jboss.netty.handler.codec.http.HttpRequest; /** * Decodes {@link ChannelBuffer}s into {@link HttpRequest}s whose method is - * {@link RtspMethods} and protocol version is {@link RtspVersion}. + * {@link RtspMethods} and protocol version is {@link RtspVersions}. *

* Please refer to {@link HttpMessageDecoder} for the detailed information on * how this decoder works and what parameters are available. @@ -54,7 +54,7 @@ public class RtspRequestDecoder extends HttpMessageDecoder { @Override protected HttpMessage createMessage(String[] initialLine) throws Exception { - return new DefaultHttpRequest(RtspVersion.valueOf(initialLine[2]), + return new DefaultHttpRequest(RtspVersions.valueOf(initialLine[2]), RtspMethods.valueOf(initialLine[0]), initialLine[1]); } diff --git a/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspResponseDecoder.java b/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspResponseDecoder.java index 38919eb842..3a7fe74f2d 100644 --- a/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspResponseDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspResponseDecoder.java @@ -24,7 +24,7 @@ import org.jboss.netty.handler.codec.http.HttpResponseStatus; /** * Decodes {@link ChannelBuffer}s into {@link HttpResponse}s whose status is - * {@link RtspResponseStatuses} and protocol version is {@link RtspVersion}. + * {@link RtspResponseStatuses} and protocol version is {@link RtspVersions}. *

* Please refer to {@link HttpMessageDecoder} for the detailed information on * how this decoder works and what parameters are available. @@ -56,7 +56,7 @@ public class RtspResponseDecoder extends HttpMessageDecoder { @Override protected HttpMessage createMessage(String[] initialLine) throws Exception { return new DefaultHttpResponse( - RtspVersion.valueOf(initialLine[0]), + RtspVersions.valueOf(initialLine[0]), new HttpResponseStatus(Integer.valueOf(initialLine[1]),initialLine[2])); } diff --git a/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspVersion.java b/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspVersions.java similarity index 61% rename from src/main/java/org/jboss/netty/handler/codec/rtsp/RtspVersion.java rename to src/main/java/org/jboss/netty/handler/codec/rtsp/RtspVersions.java index 886bd0bd1b..6d90f2e9f8 100644 --- a/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspVersion.java +++ b/src/main/java/org/jboss/netty/handler/codec/rtsp/RtspVersions.java @@ -25,20 +25,20 @@ import org.jboss.netty.handler.codec.http.HttpVersion; * @author Trustin Lee (trustin@gmail.com) * @version $Rev$, $Date$ */ -public class RtspVersion extends HttpVersion { +public final class RtspVersions { /** * RTSP/1.0 */ - public static final RtspVersion RTSP_1_0 = new RtspVersion("RTSP", 1, 0); + public static final HttpVersion RTSP_1_0 = new HttpVersion("RTSP", 1, 0); /** - * Returns an existing or new {@link RtspVersion} instance which matches to - * the specified protocol version string. If the specified {@code text} is + * Returns an existing or new {@link HttpVersion} instance which matches to + * the specified RTSP version string. If the specified {@code text} is * equal to {@code "RTSP/1.0"}, {@link #RTSP_1_0} will be returned. - * Otherwise, a new {@link RtspVersion} instance will be returned. + * Otherwise, a new {@link HttpVersion} instance will be returned. */ - public static RtspVersion valueOf(String text) { + public static HttpVersion valueOf(String text) { if (text == null) { throw new NullPointerException("text"); } @@ -48,21 +48,10 @@ public class RtspVersion extends HttpVersion { return RTSP_1_0; } - return new RtspVersion(text); + return new HttpVersion(text); } - /** - * Creates a new RTSP version with the specified version string. - */ - public RtspVersion(String text) { - super(text); - } - - /** - * Creates a new HTTP version with the specified protocol name and version - * numbers. - */ - public RtspVersion(String protocolName, int majorVersion, int minorVersion) { - super(protocolName, majorVersion, minorVersion); + private RtspVersions() { + super(); } }