| 构造器和说明 |
|---|
ResultAttempt(R result,
long attemptNumber,
long delaySinceFirstAttempt) |
| 限定符和类型 | 方法和说明 |
|---|---|
R |
get()
Returns the result of the attempt, if any.
|
long |
getAttemptNumber()
The number, starting from 1, of this attempt.
|
long |
getDelaySinceFirstAttempt()
The delay since the start of the first attempt, in milliseconds.
|
Throwable |
getExceptionCause()
Gets the exception thrown by the call
|
R |
getResult()
Gets the result of the call
|
boolean |
hasException()
Tells if the call threw an exception or not
|
boolean |
hasResult()
Tells if the call returned a result or not
|
public ResultAttempt(R result, long attemptNumber, long delaySinceFirstAttempt)
public R get() throws ExecutionException
Attemptget 在接口中 Attempt<R>ExecutionException - if an exception was thrown by the attempt. The thrown
exception is set as the cause of the ExecutionExceptionpublic boolean hasResult()
Attemptpublic boolean hasException()
AttempthasException 在接口中 Attempt<R>true if the call threw an exception, false
if it returned a resultpublic R getResult() throws IllegalStateException
AttemptgetResult 在接口中 Attempt<R>IllegalStateException - if the call didn't return a result, but threw an exception,
as indicated by Attempt.hasResult()public Throwable getExceptionCause() throws IllegalStateException
AttemptgetExceptionCause 在接口中 Attempt<R>IllegalStateException - if the call didn't throw an exception,
as indicated by Attempt.hasException()public long getAttemptNumber()
AttemptgetAttemptNumber 在接口中 Attempt<R>public long getDelaySinceFirstAttempt()
AttemptgetDelaySinceFirstAttempt 在接口中 Attempt<R>Copyright © 2018. All rights reserved.