Skip to content

Instantly share code, notes, and snippets.

@spockz
Created February 5, 2016 16:19
Show Gist options
  • Save spockz/524dcfbaf23e36f58656 to your computer and use it in GitHub Desktop.
Save spockz/524dcfbaf23e36f58656 to your computer and use it in GitHub Desktop.
import com.twitter.util.Function;
public class Test {
public void test() {
final PartialFunction<Tuple2<Object, Try<Response>>, scala.Boolean> decider =
new Function<Tuple2<Object,Try<Response>>, Boolean>() {
@Override
public scala.Boolean apply(Tuple2<Object, Try<Response>> v1) {
if (v1._2().isReturn()) {
final int responseCode = v1._2().get().getStatusCode();
return responseCode >= 500 && responseCode < 600;
}
return false;
}
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment