Skip to content

Instantly share code, notes, and snippets.

@isopropylcyanide
Created September 5, 2020 17:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isopropylcyanide/1618aef86ccc0101944097e42e37bce2 to your computer and use it in GitHub Desktop.
Save isopropylcyanide/1618aef86ccc0101944097e42e37bce2 to your computer and use it in GitHub Desktop.
public enum ResponseCondition implements Predicate<Integer> {
ON_RESPONSE_4XX_5XX {
@Override
public boolean test(Integer responseCode) {
return responseCode >= 400 && responseCode <= 599;
}
},
ON_RESPONSE_4XX_5XX_NON_NOT_FOUND {
@Override
public boolean test(Integer responseCode) {
return responseCode >= 400 && responseCode <= 599 && responseCode != 404;
}
},
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment