bbende commented on code in PR #9017:
URL: https://github.com/apache/nifi/pull/9017#discussion_r1664394357
##########
nifi-commons/nifi-web-client-api/src/main/java/org/apache/nifi/web/client/api/HttpResponseStatus.java:
##########
@@ -55,4 +57,12 @@ public enum HttpResponseStatus {
public int getCode() {
return code;
}
+
+ public boolean isSuccessful() {
+ return isSuccessful(code);
+ }
+
+ public static boolean isSuccessful(final int code) {
+ return code >= 200 && code < 300;
+ }
Review Comment:
I will probably just remove both then since the member method isn't really
helping since there is no way to get an instance of `HttpResonseStatus` from a
code.
The code I would want to write would be like:
```
HttpResponseStatus status = HttpResponseStatus.fromCode(code);
if (status.isSuccessful()) {
...
}
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]