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

annotations.io.alauda.kubernetes.api.model.JobSpecFluentImpl Maven / Gradle / Ivy

There is a newer version: 0.2.12
Show newest version
package io.alauda.kubernetes.api.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.builder.Nested;
import java.lang.Integer;
import java.lang.Deprecated;
import javax.validation.Valid;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Long;
import java.lang.Object;
import java.lang.Boolean;

public class JobSpecFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements JobSpecFluent{

    private Long activeDeadlineSeconds;
    private Integer completions;
    private Boolean manualSelector;
    private Integer parallelism;
    private LabelSelectorBuilder selector;
    private PodTemplateSpecBuilder template;

    public JobSpecFluentImpl(){
    }
    public JobSpecFluentImpl(JobSpec instance){
            this.withActiveDeadlineSeconds(instance.getActiveDeadlineSeconds()); 
            this.withCompletions(instance.getCompletions()); 
            this.withManualSelector(instance.getManualSelector()); 
            this.withParallelism(instance.getParallelism()); 
            this.withSelector(instance.getSelector()); 
            this.withTemplate(instance.getTemplate()); 
    }

    public Long getActiveDeadlineSeconds(){
            return this.activeDeadlineSeconds;
    }

    public A withActiveDeadlineSeconds(Long activeDeadlineSeconds){
            this.activeDeadlineSeconds=activeDeadlineSeconds; return (A) this;
    }

    public Boolean hasActiveDeadlineSeconds(){
            return this.activeDeadlineSeconds!=null;
    }

    public Integer getCompletions(){
            return this.completions;
    }

    public A withCompletions(Integer completions){
            this.completions=completions; return (A) this;
    }

    public Boolean hasCompletions(){
            return this.completions!=null;
    }

    public Boolean isManualSelector(){
            return this.manualSelector;
    }

    public A withManualSelector(Boolean manualSelector){
            this.manualSelector=manualSelector; return (A) this;
    }

    public Boolean hasManualSelector(){
            return this.manualSelector!=null;
    }

    public Integer getParallelism(){
            return this.parallelism;
    }

    public A withParallelism(Integer parallelism){
            this.parallelism=parallelism; return (A) this;
    }

    public Boolean hasParallelism(){
            return this.parallelism!=null;
    }

    
/**
 * This method has been deprecated, please use method buildSelector instead.
 */
@Deprecated public LabelSelector getSelector(){
            return this.selector!=null?this.selector.build():null;
    }

    public LabelSelector buildSelector(){
            return this.selector!=null?this.selector.build():null;
    }

    public A withSelector(LabelSelector selector){
            _visitables.remove(this.selector);
            if (selector!=null){ this.selector= new LabelSelectorBuilder(selector); _visitables.add(this.selector);} return (A) this;
    }

    public Boolean hasSelector(){
            return this.selector!=null;
    }

    public JobSpecFluent.SelectorNested withNewSelector(){
            return new SelectorNestedImpl();
    }

    public JobSpecFluent.SelectorNested withNewSelectorLike(LabelSelector item){
            return new SelectorNestedImpl(item);
    }

    public JobSpecFluent.SelectorNested editSelector(){
            return withNewSelectorLike(getSelector());
    }

    public JobSpecFluent.SelectorNested editOrNewSelector(){
            return withNewSelectorLike(getSelector() != null ? getSelector(): new LabelSelectorBuilder().build());
    }

    public JobSpecFluent.SelectorNested editOrNewSelectorLike(LabelSelector item){
            return withNewSelectorLike(getSelector() != null ? getSelector(): item);
    }

    
/**
 * This method has been deprecated, please use method buildTemplate instead.
 */
@Deprecated public PodTemplateSpec getTemplate(){
            return this.template!=null?this.template.build():null;
    }

    public PodTemplateSpec buildTemplate(){
            return this.template!=null?this.template.build():null;
    }

    public A withTemplate(PodTemplateSpec template){
            _visitables.remove(this.template);
            if (template!=null){ this.template= new PodTemplateSpecBuilder(template); _visitables.add(this.template);} return (A) this;
    }

    public Boolean hasTemplate(){
            return this.template!=null;
    }

    public JobSpecFluent.TemplateNested withNewTemplate(){
            return new TemplateNestedImpl();
    }

    public JobSpecFluent.TemplateNested withNewTemplateLike(PodTemplateSpec item){
            return new TemplateNestedImpl(item);
    }

    public JobSpecFluent.TemplateNested editTemplate(){
            return withNewTemplateLike(getTemplate());
    }

    public JobSpecFluent.TemplateNested editOrNewTemplate(){
            return withNewTemplateLike(getTemplate() != null ? getTemplate(): new PodTemplateSpecBuilder().build());
    }

    public JobSpecFluent.TemplateNested editOrNewTemplateLike(PodTemplateSpec item){
            return withNewTemplateLike(getTemplate() != null ? getTemplate(): 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;
            JobSpecFluentImpl that = (JobSpecFluentImpl) o;
            if (activeDeadlineSeconds != null ? !activeDeadlineSeconds.equals(that.activeDeadlineSeconds) :that.activeDeadlineSeconds != null) return false;
            if (completions != null ? !completions.equals(that.completions) :that.completions != null) return false;
            if (manualSelector != null ? !manualSelector.equals(that.manualSelector) :that.manualSelector != null) return false;
            if (parallelism != null ? !parallelism.equals(that.parallelism) :that.parallelism != null) return false;
            if (selector != null ? !selector.equals(that.selector) :that.selector != null) return false;
            if (template != null ? !template.equals(that.template) :that.template != null) return false;
            return true;
    }


    public class SelectorNestedImpl extends LabelSelectorFluentImpl> implements JobSpecFluent.SelectorNested,io.alauda.kubernetes.api.builder.Nested{

            private final LabelSelectorBuilder builder;
    
            SelectorNestedImpl(LabelSelector item){
                    this.builder = new LabelSelectorBuilder(this, item);
            }
            SelectorNestedImpl(){
                    this.builder = new LabelSelectorBuilder(this);
            }
    
    public N and(){
            return (N) JobSpecFluentImpl.this.withSelector(builder.build());
    }
    public N endSelector(){
            return and();
    }

}
    public class TemplateNestedImpl extends PodTemplateSpecFluentImpl> implements JobSpecFluent.TemplateNested,io.alauda.kubernetes.api.builder.Nested{

            private final PodTemplateSpecBuilder builder;
    
            TemplateNestedImpl(PodTemplateSpec item){
                    this.builder = new PodTemplateSpecBuilder(this, item);
            }
            TemplateNestedImpl(){
                    this.builder = new PodTemplateSpecBuilder(this);
            }
    
    public N and(){
            return (N) JobSpecFluentImpl.this.withTemplate(builder.build());
    }
    public N endTemplate(){
            return and();
    }

}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy