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

com.sap.cloud.mt.subscription.ServiceSpecification Maven / Gradle / Ivy

There is a newer version: 3.3.1
Show newest version
/*
 * ----------------------------------------------------------------
 * © 2022 SAP SE or an SAP affiliate company. All rights reserved.
 * ----------------------------------------------------------------
 *
 */

package com.sap.cloud.mt.subscription;

import com.sap.cloud.mt.tools.api.RequestEnhancer;
import com.sap.cloud.mt.tools.api.ResilienceConfig;

public class ServiceSpecification {
    private final ResilienceConfig resilienceConfig;
    private final PollingParameters polling;
    private final RequestEnhancer requestEnhancer;

    private ServiceSpecification(ResilienceConfig resilienceConfig,
                                 PollingParameters polling, RequestEnhancer requestEnhancer) {
        this.resilienceConfig = resilienceConfig;
        this.polling = polling;
        this.requestEnhancer = requestEnhancer;
    }


    public ResilienceConfig getResilienceConfig() {
        return resilienceConfig;
    }

    public RequestEnhancer getRequestEnhancer() {
        return requestEnhancer;
    }

    public PollingParameters getPolling() {
        return polling;
    }

    public static final class Builder {
        private ResilienceConfig resilienceConfig;
        private PollingParameters polling;
        private RequestEnhancer requestEnhancer;

        private Builder() {
        }

        public static Builder create() {
            return new Builder();
        }

        public Builder resilienceConfig(ResilienceConfig resilienceConfig) {
            this.resilienceConfig = resilienceConfig;
            return this;
        }

        public Builder polling(PollingParameters polling) {
            this.polling = polling;
            return this;
        }

        public Builder requestEnhancer(RequestEnhancer requestEnhancer) {
            this.requestEnhancer = requestEnhancer;
            return this;
        }

        public ServiceSpecification build() {
            return new ServiceSpecification(resilienceConfig, polling, requestEnhancer);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy