/** * Tests if this protocol version is less or equal to the given one. * * @param version the version against which to check this version * * @return {@code true} if this protocol version is * {@link #isComparable comparable} to the argument * and {@link #compareToVersion compares} as less or equal, * {@code false} otherwise */ public final boolean lessEquals(final ProtocolVersion version) { return isComparable(version) && (compareToVersion(version) <= 0); }
/** * Tests if this protocol version is greater or equal to the given one. * * @param version the version against which to check this version * * @return {@code true} if this protocol version is * {@link #isComparable comparable} to the argument * and {@link #compareToVersion compares} as greater or equal, * {@code false} otherwise */ public final boolean greaterEquals(final ProtocolVersion version) { return isComparable(version) && (compareToVersion(version) >= 0); }
private boolean requestProtocolGreaterThanAccepted(final HttpRequest req) { return req.getProtocolVersion().compareToVersion(HttpVersion.HTTP_1_1) > 0; }
protected boolean requestVersionIsTooLow(final HttpRequest request) { return request.getProtocolVersion().compareToVersion(HttpVersion.HTTP_1_1) < 0; }
private void transferEncodingIsNotReturnedTo1_0Client(final HttpRequestWrapper request, final HttpResponse response) { final HttpRequest originalRequest = request.getOriginal(); if (originalRequest.getProtocolVersion().compareToVersion(HttpVersion.HTTP_1_1) >= 0) { return; } removeResponseTransferEncoding(response); }