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

me.snowdrop.istio.mixer.adapter.stackdriver.StackdriverSpecFluentImpl Maven / Gradle / Ivy

package me.snowdrop.istio.mixer.adapter.stackdriver;

import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import java.lang.Boolean;
import java.lang.Double;
import java.lang.Integer;
import javax.validation.Valid;
import java.lang.Object;
import java.util.Map;

public class StackdriverSpecFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements StackdriverSpecFluent{

    private VisitableBuilder creds;
    private String endpoint;
    private Map logInfo;
    private Map metricInfo;
    private String projectId;
    private Integer pushInterval;
    private TraceBuilder trace;

    public StackdriverSpecFluentImpl(){
    }
    public StackdriverSpecFluentImpl(StackdriverSpec instance){
            this.withCreds(instance.getCreds()); 
            this.withEndpoint(instance.getEndpoint()); 
            this.withLogInfo(instance.getLogInfo()); 
            this.withMetricInfo(instance.getMetricInfo()); 
            this.withProjectId(instance.getProjectId()); 
            this.withPushInterval(instance.getPushInterval()); 
            this.withTrace(instance.getTrace()); 
    }

    
/**
 * This method has been deprecated, please use method buildCreds instead.
 * @return The buildable object.
 */
@Deprecated public me.snowdrop.istio.mixer.adapter.stackdriver.StackdriverSpec.Creds getCreds(){
            return this.creds!=null?this.creds.build():null;
    }

    public me.snowdrop.istio.mixer.adapter.stackdriver.StackdriverSpec.Creds buildCreds(){
            return this.creds!=null?this.creds.build():null;
    }

    public A withCreds(me.snowdrop.istio.mixer.adapter.stackdriver.StackdriverSpec.Creds creds){
            if (creds instanceof ApiKeyCreds){ this.creds= new ApiKeyCredsBuilder((ApiKeyCreds)creds); _visitables.add(this.creds);}
            if (creds instanceof AppCredentialsCreds){ this.creds= new AppCredentialsCredsBuilder((AppCredentialsCreds)creds); _visitables.add(this.creds);}
            if (creds instanceof ServiceAccountPathCreds){ this.creds= new ServiceAccountPathCredsBuilder((ServiceAccountPathCreds)creds); _visitables.add(this.creds);}
            return (A) this;
    }

    public Boolean hasCreds(){
            return this.creds != null;
    }

    public A withApiKeyCreds(ApiKeyCreds apiKeyCreds){
            _visitables.remove(this.creds);
            if (apiKeyCreds!=null){ this.creds= new ApiKeyCredsBuilder(apiKeyCreds); _visitables.add(this.creds);} return (A) this;
    }

    public StackdriverSpecFluent.ApiKeyCredsNested withNewApiKeyCreds(){
            return new ApiKeyCredsNestedImpl();
    }

    public StackdriverSpecFluent.ApiKeyCredsNested withNewApiKeyCredsLike(ApiKeyCreds item){
            return new ApiKeyCredsNestedImpl(item);
    }

    public A withNewApiKeyCreds(String apiKey){
            return (A)withApiKeyCreds(new ApiKeyCreds(apiKey));
    }

    public A withAppCredentialsCreds(AppCredentialsCreds appCredentialsCreds){
            _visitables.remove(this.creds);
            if (appCredentialsCreds!=null){ this.creds= new AppCredentialsCredsBuilder(appCredentialsCreds); _visitables.add(this.creds);} return (A) this;
    }

    public StackdriverSpecFluent.AppCredentialsCredsNested withNewAppCredentialsCreds(){
            return new AppCredentialsCredsNestedImpl();
    }

    public StackdriverSpecFluent.AppCredentialsCredsNested withNewAppCredentialsCredsLike(AppCredentialsCreds item){
            return new AppCredentialsCredsNestedImpl(item);
    }

    public A withNewAppCredentialsCreds(Boolean appCredentials){
            return (A)withAppCredentialsCreds(new AppCredentialsCreds(appCredentials));
    }

    public A withServiceAccountPathCreds(ServiceAccountPathCreds serviceAccountPathCreds){
            _visitables.remove(this.creds);
            if (serviceAccountPathCreds!=null){ this.creds= new ServiceAccountPathCredsBuilder(serviceAccountPathCreds); _visitables.add(this.creds);} return (A) this;
    }

    public StackdriverSpecFluent.ServiceAccountPathCredsNested withNewServiceAccountPathCreds(){
            return new ServiceAccountPathCredsNestedImpl();
    }

    public StackdriverSpecFluent.ServiceAccountPathCredsNested withNewServiceAccountPathCredsLike(ServiceAccountPathCreds item){
            return new ServiceAccountPathCredsNestedImpl(item);
    }

    public A withNewServiceAccountPathCreds(String serviceAccountPath){
            return (A)withServiceAccountPathCreds(new ServiceAccountPathCreds(serviceAccountPath));
    }

    public String getEndpoint(){
            return this.endpoint;
    }

    public A withEndpoint(String endpoint){
            this.endpoint=endpoint; return (A) this;
    }

    public Boolean hasEndpoint(){
            return this.endpoint != null;
    }

    public A addToLogInfo(String key,me.snowdrop.istio.mixer.adapter.stackdriver.LogInfo value){
            if(this.logInfo == null && key != null && value != null) { this.logInfo = new LinkedHashMap(); }
            if(key != null && value != null) {this.logInfo.put(key, value);} return (A)this;
    }

    public A addToLogInfo(Map map){
            if(this.logInfo == null && map != null) { this.logInfo = new LinkedHashMap(); }
            if(map != null) { this.logInfo.putAll(map);} return (A)this;
    }

    public A removeFromLogInfo(String key){
            if(this.logInfo == null) { return (A) this; }
            if(key != null && this.logInfo != null) {this.logInfo.remove(key);} return (A)this;
    }

    public A removeFromLogInfo(Map map){
            if(this.logInfo == null) { return (A) this; }
            if(map != null) { for(Object key : map.keySet()) {if (this.logInfo != null){this.logInfo.remove(key);}}} return (A)this;
    }

    public Map getLogInfo(){
            return this.logInfo;
    }

    public A withLogInfo(Map logInfo){
            if (logInfo == null) { this.logInfo =  null;} else {this.logInfo = new LinkedHashMap(logInfo);} return (A) this;
    }

    public Boolean hasLogInfo(){
            return this.logInfo != null;
    }

    public A addToMetricInfo(String key,me.snowdrop.istio.mixer.adapter.stackdriver.MetricInfo value){
            if(this.metricInfo == null && key != null && value != null) { this.metricInfo = new LinkedHashMap(); }
            if(key != null && value != null) {this.metricInfo.put(key, value);} return (A)this;
    }

    public A addToMetricInfo(Map map){
            if(this.metricInfo == null && map != null) { this.metricInfo = new LinkedHashMap(); }
            if(map != null) { this.metricInfo.putAll(map);} return (A)this;
    }

    public A removeFromMetricInfo(String key){
            if(this.metricInfo == null) { return (A) this; }
            if(key != null && this.metricInfo != null) {this.metricInfo.remove(key);} return (A)this;
    }

    public A removeFromMetricInfo(Map map){
            if(this.metricInfo == null) { return (A) this; }
            if(map != null) { for(Object key : map.keySet()) {if (this.metricInfo != null){this.metricInfo.remove(key);}}} return (A)this;
    }

    public Map getMetricInfo(){
            return this.metricInfo;
    }

    public A withMetricInfo(Map metricInfo){
            if (metricInfo == null) { this.metricInfo =  null;} else {this.metricInfo = new LinkedHashMap(metricInfo);} return (A) this;
    }

    public Boolean hasMetricInfo(){
            return this.metricInfo != null;
    }

    public String getProjectId(){
            return this.projectId;
    }

    public A withProjectId(String projectId){
            this.projectId=projectId; return (A) this;
    }

    public Boolean hasProjectId(){
            return this.projectId != null;
    }

    public Integer getPushInterval(){
            return this.pushInterval;
    }

    public A withPushInterval(Integer pushInterval){
            this.pushInterval=pushInterval; return (A) this;
    }

    public Boolean hasPushInterval(){
            return this.pushInterval != null;
    }

    public A withNewPushInterval(String arg1){
            return (A)withPushInterval(new Integer(arg1));
    }

    public A withNewPushInterval(int arg1){
            return (A)withPushInterval(new Integer(arg1));
    }

    
/**
 * This method has been deprecated, please use method buildTrace instead.
 * @return The buildable object.
 */
@Deprecated public Trace getTrace(){
            return this.trace!=null?this.trace.build():null;
    }

    public Trace buildTrace(){
            return this.trace!=null?this.trace.build():null;
    }

    public A withTrace(Trace trace){
            _visitables.remove(this.trace);
            if (trace!=null){ this.trace= new TraceBuilder(trace); _visitables.add(this.trace);} return (A) this;
    }

    public Boolean hasTrace(){
            return this.trace != null;
    }

    public A withNewTrace(Double sampleProbability){
            return (A)withTrace(new Trace(sampleProbability));
    }

    public StackdriverSpecFluent.TraceNested withNewTrace(){
            return new TraceNestedImpl();
    }

    public StackdriverSpecFluent.TraceNested withNewTraceLike(Trace item){
            return new TraceNestedImpl(item);
    }

    public StackdriverSpecFluent.TraceNested editTrace(){
            return withNewTraceLike(getTrace());
    }

    public StackdriverSpecFluent.TraceNested editOrNewTrace(){
            return withNewTraceLike(getTrace() != null ? getTrace(): new TraceBuilder().build());
    }

    public StackdriverSpecFluent.TraceNested editOrNewTraceLike(Trace item){
            return withNewTraceLike(getTrace() != null ? getTrace(): item);
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            StackdriverSpecFluentImpl that = (StackdriverSpecFluentImpl) o;
            if (creds != null ? !creds.equals(that.creds) :that.creds != null) return false;
            if (endpoint != null ? !endpoint.equals(that.endpoint) :that.endpoint != null) return false;
            if (logInfo != null ? !logInfo.equals(that.logInfo) :that.logInfo != null) return false;
            if (metricInfo != null ? !metricInfo.equals(that.metricInfo) :that.metricInfo != null) return false;
            if (projectId != null ? !projectId.equals(that.projectId) :that.projectId != null) return false;
            if (pushInterval != null ? !pushInterval.equals(that.pushInterval) :that.pushInterval != null) return false;
            if (trace != null ? !trace.equals(that.trace) :that.trace != null) return false;
            return true;
    }


    public class ApiKeyCredsNestedImpl extends ApiKeyCredsFluentImpl> implements StackdriverSpecFluent.ApiKeyCredsNested,io.fabric8.kubernetes.api.builder.Nested{

            private final ApiKeyCredsBuilder builder;
    
            ApiKeyCredsNestedImpl(ApiKeyCreds item){
                    this.builder = new ApiKeyCredsBuilder(this, item);
            }
            ApiKeyCredsNestedImpl(){
                    this.builder = new ApiKeyCredsBuilder(this);
            }
    
    public N and(){
            return (N) StackdriverSpecFluentImpl.this.withApiKeyCreds(builder.build());
    }
    public N endApiKeyCreds(){
            return and();
    }

}
    public class AppCredentialsCredsNestedImpl extends AppCredentialsCredsFluentImpl> implements StackdriverSpecFluent.AppCredentialsCredsNested,io.fabric8.kubernetes.api.builder.Nested{

            private final AppCredentialsCredsBuilder builder;
    
            AppCredentialsCredsNestedImpl(AppCredentialsCreds item){
                    this.builder = new AppCredentialsCredsBuilder(this, item);
            }
            AppCredentialsCredsNestedImpl(){
                    this.builder = new AppCredentialsCredsBuilder(this);
            }
    
    public N and(){
            return (N) StackdriverSpecFluentImpl.this.withAppCredentialsCreds(builder.build());
    }
    public N endAppCredentialsCreds(){
            return and();
    }

}
    public class ServiceAccountPathCredsNestedImpl extends ServiceAccountPathCredsFluentImpl> implements StackdriverSpecFluent.ServiceAccountPathCredsNested,io.fabric8.kubernetes.api.builder.Nested{

            private final ServiceAccountPathCredsBuilder builder;
    
            ServiceAccountPathCredsNestedImpl(ServiceAccountPathCreds item){
                    this.builder = new ServiceAccountPathCredsBuilder(this, item);
            }
            ServiceAccountPathCredsNestedImpl(){
                    this.builder = new ServiceAccountPathCredsBuilder(this);
            }
    
    public N and(){
            return (N) StackdriverSpecFluentImpl.this.withServiceAccountPathCreds(builder.build());
    }
    public N endServiceAccountPathCreds(){
            return and();
    }

}
    public class TraceNestedImpl extends TraceFluentImpl> implements StackdriverSpecFluent.TraceNested,io.fabric8.kubernetes.api.builder.Nested{

            private final TraceBuilder builder;
    
            TraceNestedImpl(Trace item){
                    this.builder = new TraceBuilder(this, item);
            }
            TraceNestedImpl(){
                    this.builder = new TraceBuilder(this);
            }
    
    public N and(){
            return (N) StackdriverSpecFluentImpl.this.withTrace(builder.build());
    }
    public N endTrace(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy