V - The type returned by the wrapped callable.public interface Attempt<V>
| 限定符和类型 | 方法和说明 |
|---|---|
V |
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
|
V |
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
|
V get() throws ExecutionException
ExecutionException - if an exception was thrown by the attempt. The thrown
exception is set as the cause of the ExecutionExceptionboolean hasResult()
true if the call returned a result, false
if it threw an exceptionboolean hasException()
true if the call threw an exception, false
if it returned a resultV getResult() throws IllegalStateException
IllegalStateException - if the call didn't return a result, but threw an exception,
as indicated by hasResult()Throwable getExceptionCause() throws IllegalStateException
IllegalStateException - if the call didn't throw an exception,
as indicated by hasException()long getAttemptNumber()
long getDelaySinceFirstAttempt()
Copyright © 2023. All rights reserved.