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

com.alibaba.easyretry.core.SyncRetryerBuilder Maven / Gradle / Ivy

package com.alibaba.easyretry.core;

import java.util.Objects;

import com.alibaba.easyretry.common.RetryConfiguration;
import com.alibaba.easyretry.common.retryer.RetryerInfo;

/**
 * @author Created by zhangchi on 2023-07-12
 */
public class SyncRetryerBuilder {

	private SyncRetryer syncRetryer;

	public SyncRetryerBuilder(RetryConfiguration retryConfiguration) {
		RetryerInfo retryerInfo = new RetryerInfo<>();
		syncRetryer = new SyncRetryer<>(retryerInfo);
	}

	public static  SyncRetryerBuilder of(RetryConfiguration retryConfiguration) {
		return new SyncRetryerBuilder<>(retryConfiguration);
	}

	public SyncRetryerBuilder withConfiguration(RetryConfiguration retryConfiguration) {
		syncRetryer.getRetryerInfo().setRetryConfiguration(retryConfiguration);
		return this;
	}


	public SyncRetryer build() {
		return syncRetryer;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy