public boolean isPolicyExceeded ( ) { boolean withinMaxRetries = maxAttempts == - 1 || attemptCount < maxAttempts ; boolean withinMaxDuration = maxDuration == - 1 || System . nanoTime ( ) - startTime < maxDuration ; return ! withinMaxRetries || ! withinMaxDuration ; }
Returns true if the max attempts or max duration for the recurring policy have been exceeded else false .