Class RetryState
java.lang.Object
net.finmath.decryptionoracle.util.RetryState
Tiny helper to count retries.
Semantics:
- recordSuccessAndIsDone() returns true and resets retries to 0
- recordFailureAndIsDone() increments retries and returns true if retries exceeded maxRetries
- recordOutcomeAndIsDone(success) returns true if done (success OR retries exceeded)
- Author:
- Christian Fries
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanrecordOutcomeAndIsDone(boolean success) booleanlongretries()
-
Constructor Details
-
RetryState
public RetryState(long maxRetries)
-
-
Method Details
-
recordSuccessAndIsDone
public boolean recordSuccessAndIsDone() -
recordFailureAndIsDone
public boolean recordFailureAndIsDone() -
recordOutcomeAndIsDone
public boolean recordOutcomeAndIsDone(boolean success) -
retries
public long retries()
-