guava-retrying
guava-retrying copied to clipboard
Make ExceptionAttempt and ResultAttempt public
trafficstars
I'm in (much belated) process of upgrading my company's codebase to 2.0.0. In doing so, I found that I had to copy-past these class definitions into our code in order to use them, so I thought that they'd be useful to expose.
I think that it could also make sense to demote these back to static classes and expose via factory methods:
public class Attempts {
public static <R> Attempt<R> exceptionAttempt(Throwable cause, long attemptNumber, long delaySinceFirstAttempt) {
return new ExceptionAttempt<R>(cause, attemptNumber, delaySinceFirstAttempt);
}
public static <R> Attempt<R> resultAttempt(R result, long attemptNumber, long delaySinceFirstAttempt) {
return new ResultAttempt<R>(result, attemptNumber, delaySinceFirstAttempt);
}
}
Let me know what you think: I'll happily iterate on this as desired!
@rholder
I think the build is failing trying to run under Guava 21.