Created
February 5, 2016 16:19
-
-
Save spockz/524dcfbaf23e36f58656 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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