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.3
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 String url;
    private final ResilienceConfig resilienceConfig;
    private final PollingParameters polling;
    private final RequestEnhancer requestEnhancer;

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


    public String getUrl() {
        return url;
    }

    public ResilienceConfig getResilienceConfig() {
        return resilienceConfig;
    }

    public RequestEnhancer getRequestEnhancer() {
        return requestEnhancer;
    }

    public PollingParameters getPolling() {
        return polling;
    }

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

        private Builder() {
        }

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

        public Builder url(String url) {
            this.url = url;
            return this;
        }

        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(url, resilienceConfig, polling, requestEnhancer);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy