Callable<Boolean> callable = new Callable<Boolean>() {
public Boolean call() throws Exception {
return true; // do something useful here
}
};
Retryer<Boolean> retryer = RetryerBuilder.<Boolean>newBuilder() =====>
.retryIfResult(Predicates.<Boolean>isNull()) =====>
.retryIfExceptionOfType(IOException.class)
.retryIfRuntimeException()
.withStopStrategy(StopStrategies.stopAfterAttempt(3))
.build();
try {
retryer.call(callable);
} catch (RetryException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
Qustion:
RetryerBuilder.<Boolean>newBuilder()
this line.
Why we can put <Boolean>
before a method?
this is a strange to me in Java.
can someone explain it for me thanks