/** * 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 HttpVersion} instance will be returned. */ public static HttpVersion valueOf(String text) { if (text == null) { throw new NullPointerException("text"); } text = text.trim().toUpperCase(); if ("RTSP/1.0".equals(text)) { return RTSP_1_0; } return new HttpVersion(text, true); }
/** * Returns an existing or new {@link HttpVersion} instance which matches to * the specified protocol version string. If the specified {@code text} is * equal to {@code "HTTP/1.0"}, {@link #HTTP_1_0} will be returned. If the * specified {@code text} is equal to {@code "HTTP/1.1"}, {@link #HTTP_1_1} * will be returned. Otherwise, a new {@link HttpVersion} instance will be * returned. */ public static HttpVersion valueOf(String text) { if (text == null) { throw new NullPointerException("text"); } text = text.trim().toUpperCase(); if ("HTTP/1.1".equals(text)) { return HTTP_1_1; } if ("HTTP/1.0".equals(text)) { return HTTP_1_0; } return new HttpVersion(text, true); }