All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.co.moneyforward.autotest.framework.action.RetryCall Maven / Gradle / Ivy

The newest version!
package jp.co.moneyforward.autotest.framework.action;

import com.github.dakusui.actionunit.core.Action;

import java.util.concurrent.TimeUnit;

import static java.util.concurrent.TimeUnit.SECONDS;

public final class RetryCall extends CallDecorator.Base  {
  private final int interval;
  private final int retryTimes;
  private final Class onExceptionType;
  
  ///
  /// Creates an instance of this class.
  ///
  public RetryCall(Call target, Class onExceptionType, int retryTimes, int interval) {
    super(target);
    this.interval = interval;
    this.retryTimes = retryTimes;
    this.onExceptionType = onExceptionType;
  }
  
  @Override
  public Action toAction(ActionComposer actionComposer) {
    return actionComposer.create(this);
  }
  
  public int times() {
    return retryTimes;
  }
  
  public Class onException() {
    return onExceptionType;
  }
  
  public long interval() {
    return interval;
  }
  
  public TimeUnit intervalUnit() {
    return SECONDS;
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy