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

annotations.me.snowdrop.istio.api.model.IstioResourceFluentImpl Maven / Gradle / Ivy

package me.snowdrop.istio.api.model;

import me.snowdrop.istio.api.builder.VisitableBuilder;
import java.lang.String;
import me.snowdrop.istio.api.model.v1.mixer.template.ListEntryFluentImpl;
import me.snowdrop.istio.api.builder.BaseFluent;
import me.snowdrop.istio.api.model.v1.routing.EgressRule;
import me.snowdrop.istio.api.model.v1.routing.DestinationPolicyFluentImpl;
import java.lang.Boolean;
import me.snowdrop.istio.api.model.v1.routing.RouteRuleBuilder;
import me.snowdrop.istio.api.model.v1.routing.RouteRuleFluentImpl;
import me.snowdrop.istio.api.model.v1.routing.EgressRuleFluentImpl;
import me.snowdrop.istio.api.model.v1.routing.RouteRule;
import io.fabric8.kubernetes.api.model.ObjectMetaBuilder;
import me.snowdrop.istio.api.model.v1.mixer.template.ListEntryBuilder;
import java.lang.Object;
import me.snowdrop.istio.api.model.v1.mixer.template.LogEntryFluentImpl;
import me.snowdrop.istio.api.model.v1.mixer.template.QuotaBuilder;
import me.snowdrop.istio.api.model.v1.mixer.template.ReportNothing;
import me.snowdrop.istio.api.builder.Nested;
import me.snowdrop.istio.api.model.v1.mixer.template.MetricFluentImpl;
import me.snowdrop.istio.api.model.v1.mixer.template.ReportNothingBuilder;
import me.snowdrop.istio.api.model.v1.mixer.template.ReportNothingFluentImpl;
import java.lang.Deprecated;
import me.snowdrop.istio.api.model.v1.routing.DestinationPolicyBuilder;
import me.snowdrop.istio.api.model.v1.mixer.template.LogEntryBuilder;
import me.snowdrop.istio.api.model.v1.mixer.template.CheckNothing;
import me.snowdrop.istio.api.model.v1.mixer.template.MetricBuilder;
import me.snowdrop.istio.api.model.v1.mixer.template.LogEntry;
import me.snowdrop.istio.api.model.v1.mixer.template.ListEntry;
import io.fabric8.kubernetes.api.model.ObjectMeta;
import me.snowdrop.istio.api.model.v1.mixer.template.CheckNothingFluentImpl;
import io.fabric8.kubernetes.api.model.ObjectMetaFluentImpl;
import me.snowdrop.istio.api.model.v1.routing.DestinationPolicy;
import me.snowdrop.istio.api.model.v1.mixer.template.CheckNothingBuilder;
import me.snowdrop.istio.api.model.v1.mixer.template.Quota;
import me.snowdrop.istio.api.model.v1.routing.EgressRuleBuilder;
import me.snowdrop.istio.api.model.v1.mixer.template.QuotaFluentImpl;
import me.snowdrop.istio.api.model.v1.mixer.template.Metric;

public class IstioResourceFluentImpl> extends me.snowdrop.istio.api.builder.BaseFluent implements IstioResourceFluent{

    private ObjectMetaBuilder metadata;
    private String kind;
    private String apiVersion;
    private me.snowdrop.istio.api.builder.VisitableBuilder spec;

    public IstioResourceFluentImpl(){
    }
    public IstioResourceFluentImpl(IstioResource instance){
            this.withApiVersion(instance.getApiVersion()); 
            this.withKind(instance.getKind()); 
            this.withMetadata(instance.getMetadata()); 
            this.withSpec(instance.getSpec()); 
    }

    
/**
 * This method has been deprecated, please use method buildMetadata instead.
 */
@Deprecated public ObjectMeta getMetadata(){
            return this.metadata!=null?this.metadata.build():null;
    }

    public ObjectMeta buildMetadata(){
            return this.metadata!=null?this.metadata.build():null;
    }

    public A withMetadata(ObjectMeta metadata){
            _visitables.remove(this.metadata);
            if (metadata!=null){ this.metadata= new ObjectMetaBuilder(metadata); _visitables.add(this.metadata);} return (A) this;
    }

    public Boolean hasMetadata(){
            return this.metadata != null;
    }

    public IstioResourceFluent.MetadataNested withNewMetadata(){
            return new MetadataNestedImpl();
    }

    public IstioResourceFluent.MetadataNested withNewMetadataLike(ObjectMeta item){
            return new MetadataNestedImpl(item);
    }

    public IstioResourceFluent.MetadataNested editMetadata(){
            return withNewMetadataLike(getMetadata());
    }

    public IstioResourceFluent.MetadataNested editOrNewMetadata(){
            return withNewMetadataLike(getMetadata() != null ? getMetadata(): new ObjectMetaBuilder().build());
    }

    public IstioResourceFluent.MetadataNested editOrNewMetadataLike(ObjectMeta item){
            return withNewMetadataLike(getMetadata() != null ? getMetadata(): item);
    }

    public String getKind(){
            return this.kind;
    }

    public A withKind(String kind){
            this.kind=kind; return (A) this;
    }

    public Boolean hasKind(){
            return this.kind != null;
    }

    public String getApiVersion(){
            return this.apiVersion;
    }

    public A withApiVersion(String apiVersion){
            this.apiVersion=apiVersion; return (A) this;
    }

    public Boolean hasApiVersion(){
            return this.apiVersion != null;
    }

    
/**
 * This method has been deprecated, please use method buildSpec instead.
 */
@Deprecated public IstioSpec getSpec(){
            return this.spec!=null?this.spec.build():null;
    }

    public IstioSpec buildSpec(){
            return this.spec!=null?this.spec.build():null;
    }

    public A withSpec(IstioSpec spec){
            if (spec instanceof ListEntry){ this.spec= new ListEntryBuilder((ListEntry)spec); _visitables.add(this.spec);}
            if (spec instanceof CheckNothing){ this.spec= new CheckNothingBuilder((CheckNothing)spec); _visitables.add(this.spec);}
            if (spec instanceof EgressRule){ this.spec= new EgressRuleBuilder((EgressRule)spec); _visitables.add(this.spec);}
            if (spec instanceof LogEntry){ this.spec= new LogEntryBuilder((LogEntry)spec); _visitables.add(this.spec);}
            if (spec instanceof ReportNothing){ this.spec= new ReportNothingBuilder((ReportNothing)spec); _visitables.add(this.spec);}
            if (spec instanceof RouteRule){ this.spec= new RouteRuleBuilder((RouteRule)spec); _visitables.add(this.spec);}
            if (spec instanceof DestinationPolicy){ this.spec= new DestinationPolicyBuilder((DestinationPolicy)spec); _visitables.add(this.spec);}
            if (spec instanceof Quota){ this.spec= new QuotaBuilder((Quota)spec); _visitables.add(this.spec);}
            if (spec instanceof IstioBaseSpec){ this.spec= new IstioBaseSpecBuilder((IstioBaseSpec)spec); _visitables.add(this.spec);}
            if (spec instanceof Metric){ this.spec= new MetricBuilder((Metric)spec); _visitables.add(this.spec);}
            return (A) this;
    }

    public Boolean hasSpec(){
            return this.spec != null;
    }

    public A withListEntrySpec(ListEntry listEntrySpec){
            _visitables.remove(this.spec);
            if (listEntrySpec!=null){ this.spec= new ListEntryBuilder(listEntrySpec); _visitables.add(this.spec);} return (A) this;
    }

    public IstioResourceFluent.ListEntrySpecNested withNewListEntrySpec(){
            return new ListEntrySpecNestedImpl();
    }

    public IstioResourceFluent.ListEntrySpecNested withNewListEntrySpecLike(ListEntry item){
            return new ListEntrySpecNestedImpl(item);
    }

    public A withCheckNothingSpec(CheckNothing checkNothingSpec){
            _visitables.remove(this.spec);
            if (checkNothingSpec!=null){ this.spec= new CheckNothingBuilder(checkNothingSpec); _visitables.add(this.spec);} return (A) this;
    }

    public IstioResourceFluent.CheckNothingSpecNested withNewCheckNothingSpec(){
            return new CheckNothingSpecNestedImpl();
    }

    public IstioResourceFluent.CheckNothingSpecNested withNewCheckNothingSpecLike(CheckNothing item){
            return new CheckNothingSpecNestedImpl(item);
    }

    public A withEgressRuleSpec(EgressRule egressRuleSpec){
            _visitables.remove(this.spec);
            if (egressRuleSpec!=null){ this.spec= new EgressRuleBuilder(egressRuleSpec); _visitables.add(this.spec);} return (A) this;
    }

    public IstioResourceFluent.EgressRuleSpecNested withNewEgressRuleSpec(){
            return new EgressRuleSpecNestedImpl();
    }

    public IstioResourceFluent.EgressRuleSpecNested withNewEgressRuleSpecLike(EgressRule item){
            return new EgressRuleSpecNestedImpl(item);
    }

    public A withLogEntrySpec(LogEntry logEntrySpec){
            _visitables.remove(this.spec);
            if (logEntrySpec!=null){ this.spec= new LogEntryBuilder(logEntrySpec); _visitables.add(this.spec);} return (A) this;
    }

    public IstioResourceFluent.LogEntrySpecNested withNewLogEntrySpec(){
            return new LogEntrySpecNestedImpl();
    }

    public IstioResourceFluent.LogEntrySpecNested withNewLogEntrySpecLike(LogEntry item){
            return new LogEntrySpecNestedImpl(item);
    }

    public A withReportNothingSpec(ReportNothing reportNothingSpec){
            _visitables.remove(this.spec);
            if (reportNothingSpec!=null){ this.spec= new ReportNothingBuilder(reportNothingSpec); _visitables.add(this.spec);} return (A) this;
    }

    public IstioResourceFluent.ReportNothingSpecNested withNewReportNothingSpec(){
            return new ReportNothingSpecNestedImpl();
    }

    public IstioResourceFluent.ReportNothingSpecNested withNewReportNothingSpecLike(ReportNothing item){
            return new ReportNothingSpecNestedImpl(item);
    }

    public A withRouteRuleSpec(RouteRule routeRuleSpec){
            _visitables.remove(this.spec);
            if (routeRuleSpec!=null){ this.spec= new RouteRuleBuilder(routeRuleSpec); _visitables.add(this.spec);} return (A) this;
    }

    public IstioResourceFluent.RouteRuleSpecNested withNewRouteRuleSpec(){
            return new RouteRuleSpecNestedImpl();
    }

    public IstioResourceFluent.RouteRuleSpecNested withNewRouteRuleSpecLike(RouteRule item){
            return new RouteRuleSpecNestedImpl(item);
    }

    public A withDestinationPolicySpec(DestinationPolicy destinationPolicySpec){
            _visitables.remove(this.spec);
            if (destinationPolicySpec!=null){ this.spec= new DestinationPolicyBuilder(destinationPolicySpec); _visitables.add(this.spec);} return (A) this;
    }

    public IstioResourceFluent.DestinationPolicySpecNested withNewDestinationPolicySpec(){
            return new DestinationPolicySpecNestedImpl();
    }

    public IstioResourceFluent.DestinationPolicySpecNested withNewDestinationPolicySpecLike(DestinationPolicy item){
            return new DestinationPolicySpecNestedImpl(item);
    }

    public A withQuotaSpec(Quota quotaSpec){
            _visitables.remove(this.spec);
            if (quotaSpec!=null){ this.spec= new QuotaBuilder(quotaSpec); _visitables.add(this.spec);} return (A) this;
    }

    public IstioResourceFluent.QuotaSpecNested withNewQuotaSpec(){
            return new QuotaSpecNestedImpl();
    }

    public IstioResourceFluent.QuotaSpecNested withNewQuotaSpecLike(Quota item){
            return new QuotaSpecNestedImpl(item);
    }

    public A withIstioBaseSpec(IstioBaseSpec istioBaseSpec){
            _visitables.remove(this.spec);
            if (istioBaseSpec!=null){ this.spec= new IstioBaseSpecBuilder(istioBaseSpec); _visitables.add(this.spec);} return (A) this;
    }

    public IstioResourceFluent.IstioBaseSpecNested withNewIstioBaseSpec(){
            return new IstioBaseSpecNestedImpl();
    }

    public IstioResourceFluent.IstioBaseSpecNested withNewIstioBaseSpecLike(IstioBaseSpec item){
            return new IstioBaseSpecNestedImpl(item);
    }

    public A withMetricSpec(Metric metricSpec){
            _visitables.remove(this.spec);
            if (metricSpec!=null){ this.spec= new MetricBuilder(metricSpec); _visitables.add(this.spec);} return (A) this;
    }

    public IstioResourceFluent.MetricSpecNested withNewMetricSpec(){
            return new MetricSpecNestedImpl();
    }

    public IstioResourceFluent.MetricSpecNested withNewMetricSpecLike(Metric item){
            return new MetricSpecNestedImpl(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;
            IstioResourceFluentImpl that = (IstioResourceFluentImpl) o;
            if (metadata != null ? !metadata.equals(that.metadata) :that.metadata != null) return false;
            if (kind != null ? !kind.equals(that.kind) :that.kind != null) return false;
            if (apiVersion != null ? !apiVersion.equals(that.apiVersion) :that.apiVersion != null) return false;
            if (spec != null ? !spec.equals(that.spec) :that.spec != null) return false;
            return true;
    }


    public class MetadataNestedImpl extends ObjectMetaFluentImpl> implements IstioResourceFluent.MetadataNested,me.snowdrop.istio.api.builder.Nested{

            private final ObjectMetaBuilder builder;
    
            MetadataNestedImpl(ObjectMeta item){
                    this.builder = new ObjectMetaBuilder(this, item);
            }
            MetadataNestedImpl(){
                    this.builder = new ObjectMetaBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withMetadata(builder.build());
    }
    public N endMetadata(){
            return and();
    }

}
    public class ListEntrySpecNestedImpl extends ListEntryFluentImpl> implements IstioResourceFluent.ListEntrySpecNested,me.snowdrop.istio.api.builder.Nested{

            private final ListEntryBuilder builder;
    
            ListEntrySpecNestedImpl(ListEntry item){
                    this.builder = new ListEntryBuilder(this, item);
            }
            ListEntrySpecNestedImpl(){
                    this.builder = new ListEntryBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withListEntrySpec(builder.build());
    }
    public N endListEntrySpec(){
            return and();
    }

}
    public class CheckNothingSpecNestedImpl extends CheckNothingFluentImpl> implements IstioResourceFluent.CheckNothingSpecNested,me.snowdrop.istio.api.builder.Nested{

            private final CheckNothingBuilder builder;
    
            CheckNothingSpecNestedImpl(CheckNothing item){
                    this.builder = new CheckNothingBuilder(this, item);
            }
            CheckNothingSpecNestedImpl(){
                    this.builder = new CheckNothingBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withCheckNothingSpec(builder.build());
    }
    public N endCheckNothingSpec(){
            return and();
    }

}
    public class EgressRuleSpecNestedImpl extends EgressRuleFluentImpl> implements IstioResourceFluent.EgressRuleSpecNested,me.snowdrop.istio.api.builder.Nested{

            private final EgressRuleBuilder builder;
    
            EgressRuleSpecNestedImpl(EgressRule item){
                    this.builder = new EgressRuleBuilder(this, item);
            }
            EgressRuleSpecNestedImpl(){
                    this.builder = new EgressRuleBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withEgressRuleSpec(builder.build());
    }
    public N endEgressRuleSpec(){
            return and();
    }

}
    public class LogEntrySpecNestedImpl extends LogEntryFluentImpl> implements IstioResourceFluent.LogEntrySpecNested,me.snowdrop.istio.api.builder.Nested{

            private final LogEntryBuilder builder;
    
            LogEntrySpecNestedImpl(LogEntry item){
                    this.builder = new LogEntryBuilder(this, item);
            }
            LogEntrySpecNestedImpl(){
                    this.builder = new LogEntryBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withLogEntrySpec(builder.build());
    }
    public N endLogEntrySpec(){
            return and();
    }

}
    public class ReportNothingSpecNestedImpl extends ReportNothingFluentImpl> implements IstioResourceFluent.ReportNothingSpecNested,me.snowdrop.istio.api.builder.Nested{

            private final ReportNothingBuilder builder;
    
            ReportNothingSpecNestedImpl(ReportNothing item){
                    this.builder = new ReportNothingBuilder(this, item);
            }
            ReportNothingSpecNestedImpl(){
                    this.builder = new ReportNothingBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withReportNothingSpec(builder.build());
    }
    public N endReportNothingSpec(){
            return and();
    }

}
    public class RouteRuleSpecNestedImpl extends RouteRuleFluentImpl> implements IstioResourceFluent.RouteRuleSpecNested,me.snowdrop.istio.api.builder.Nested{

            private final RouteRuleBuilder builder;
    
            RouteRuleSpecNestedImpl(RouteRule item){
                    this.builder = new RouteRuleBuilder(this, item);
            }
            RouteRuleSpecNestedImpl(){
                    this.builder = new RouteRuleBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withRouteRuleSpec(builder.build());
    }
    public N endRouteRuleSpec(){
            return and();
    }

}
    public class DestinationPolicySpecNestedImpl extends DestinationPolicyFluentImpl> implements IstioResourceFluent.DestinationPolicySpecNested,me.snowdrop.istio.api.builder.Nested{

            private final DestinationPolicyBuilder builder;
    
            DestinationPolicySpecNestedImpl(DestinationPolicy item){
                    this.builder = new DestinationPolicyBuilder(this, item);
            }
            DestinationPolicySpecNestedImpl(){
                    this.builder = new DestinationPolicyBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withDestinationPolicySpec(builder.build());
    }
    public N endDestinationPolicySpec(){
            return and();
    }

}
    public class QuotaSpecNestedImpl extends QuotaFluentImpl> implements IstioResourceFluent.QuotaSpecNested,me.snowdrop.istio.api.builder.Nested{

            private final QuotaBuilder builder;
    
            QuotaSpecNestedImpl(Quota item){
                    this.builder = new QuotaBuilder(this, item);
            }
            QuotaSpecNestedImpl(){
                    this.builder = new QuotaBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withQuotaSpec(builder.build());
    }
    public N endQuotaSpec(){
            return and();
    }

}
    public class IstioBaseSpecNestedImpl extends IstioBaseSpecFluentImpl> implements IstioResourceFluent.IstioBaseSpecNested,me.snowdrop.istio.api.builder.Nested{

            private final IstioBaseSpecBuilder builder;
    
            IstioBaseSpecNestedImpl(IstioBaseSpec item){
                    this.builder = new IstioBaseSpecBuilder(this, item);
            }
            IstioBaseSpecNestedImpl(){
                    this.builder = new IstioBaseSpecBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withIstioBaseSpec(builder.build());
    }
    public N endIstioBaseSpec(){
            return and();
    }

}
    public class MetricSpecNestedImpl extends MetricFluentImpl> implements IstioResourceFluent.MetricSpecNested,me.snowdrop.istio.api.builder.Nested{

            private final MetricBuilder builder;
    
            MetricSpecNestedImpl(Metric item){
                    this.builder = new MetricBuilder(this, item);
            }
            MetricSpecNestedImpl(){
                    this.builder = new MetricBuilder(this);
            }
    
    public N and(){
            return (N) IstioResourceFluentImpl.this.withMetricSpec(builder.build());
    }
    public N endMetricSpec(){
            return and();
    }

}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy