larshelge commented on a change in pull request #237:
URL:
https://github.com/apache/httpcomponents-core/pull/237#discussion_r543116067
##########
File path:
httpcore5/src/main/java/org/apache/hc/core5/http/message/StatusLine.java
##########
@@ -100,6 +99,61 @@ public StatusClass getStatusClass() {
return this.statusClass;
}
+ /**
+ * Whether this status code is in the HTTP series {@link
StatusClass#INFORMATIONAL}.
+ *
+ * @since 5.1
+ */
+ public boolean isInformational() {
+ return getStatusClass() == StatusClass.INFORMATIONAL;
+ }
+
+ /**
+ * Whether this status code is in the HTTP series {@link
StatusClass#SUCCESSFUL}.
+ *
+ * @since 5.1
+ */
+ public boolean isSuccessful() {
+ return getStatusClass() == StatusClass.SUCCESSFUL;
+ }
+
+ /**
+ * Whether this status code is in the HTTP series {@link
StatusClass#REDIRECTION}.
+ *
+ * @since 5.1
+ */
+ public boolean isRedirection() {
+ return getStatusClass() == StatusClass.REDIRECTION;
+ }
+
+ /**
+ * Whether this status code is in the HTTP series {@link
StatusClass#CLIENT_ERROR}.
+ *
+ * @since 5.1
+ */
+ public boolean isClientError() {
+ return getStatusClass() == StatusClass.CLIENT_ERROR;
+ }
+
+ /**
+ * Whether this status code is in the HTTP series {@link
StatusClass#SERVER_ERROR}.
+ *
+ * @since 5.1
+ */
+ public boolean isServerError() {
+ return getStatusClass() == StatusClass.SERVER_ERROR;
+ }
+
+ /**
+ * Whether this status code is in the HTTP series {@link
StatusClass#CLIENT_ERROR}
+ * or {@link StatusClass#SERVER_ERROR}.
+ *
+ * @since 5.1
+ */
+ public boolean isError() {
+ return (isClientError() || isServerError());
Review comment:
Fixed now.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]