com.mindee.AsyncPollingOptions Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mindee-api-java Show documentation
Show all versions of mindee-api-java Show documentation
Java Library to call Mindee's Off-The-Shelf and Custom APIs
The newest version!
package com.mindee;
import lombok.Builder;
import lombok.Value;
/**
* Options to pass for asynchronous parsing with polling.
*/
@Value
public class AsyncPollingOptions {
/**
* Wait this many seconds before the first polling attempt.
*/
Double initialDelaySec;
/**
* Wait this many seconds between each polling attempt.
*/
Double intervalSec;
/**
* Maximum number of times to poll.
*/
Integer maxRetries;
@Builder
private AsyncPollingOptions(
Double initialDelaySec,
Double intervalSec,
Integer maxRetries
) {
this.initialDelaySec = initialDelaySec == null ? 2.0 : initialDelaySec;
this.intervalSec = intervalSec == null ? 1.5 : intervalSec;
this.maxRetries = maxRetries == null ? 30 : maxRetries;
}
}