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

annotations.io.alauda.kubernetes.api.model.policy.PodDisruptionBudgetSpecFluentImpl Maven / Gradle / Ivy

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

import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.model.IntOrString;
import io.alauda.kubernetes.api.model.LabelSelectorFluentImpl;
import io.alauda.kubernetes.api.builder.Nested;
import com.fasterxml.jackson.databind.JsonSerializer;
import java.lang.String;
import com.fasterxml.jackson.databind.JsonDeserializer;
import io.alauda.kubernetes.api.model.IntOrStringBuilder;
import java.lang.Deprecated;
import io.alauda.kubernetes.api.builder.BaseFluent;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.SerializerProvider;
import java.lang.Boolean;
import java.lang.Override;
import com.fasterxml.jackson.core.JsonParser;
import io.alauda.kubernetes.api.model.LabelSelectorBuilder;
import io.alauda.kubernetes.api.model.LabelSelector;
import java.lang.Integer;
import javax.validation.Valid;
import java.lang.Object;
import io.alauda.kubernetes.api.model.IntOrStringFluentImpl;

public class PodDisruptionBudgetSpecFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements PodDisruptionBudgetSpecFluent{

    private IntOrStringBuilder maxUnavailable;
    private IntOrStringBuilder minAvailable;
    private LabelSelectorBuilder selector;

    public PodDisruptionBudgetSpecFluentImpl(){
    }
    public PodDisruptionBudgetSpecFluentImpl(PodDisruptionBudgetSpec instance){
            this.withMaxUnavailable(instance.getMaxUnavailable()); 
            this.withMinAvailable(instance.getMinAvailable()); 
            this.withSelector(instance.getSelector()); 
    }

    
/**
 * This method has been deprecated, please use method buildMaxUnavailable instead.
 */
@Deprecated public IntOrString getMaxUnavailable(){
            return this.maxUnavailable!=null?this.maxUnavailable.build():null;
    }

    public IntOrString buildMaxUnavailable(){
            return this.maxUnavailable!=null?this.maxUnavailable.build():null;
    }

    public A withMaxUnavailable(IntOrString maxUnavailable){
            _visitables.remove(this.maxUnavailable);
            if (maxUnavailable!=null){ this.maxUnavailable= new IntOrStringBuilder(maxUnavailable); _visitables.add(this.maxUnavailable);} return (A) this;
    }

    public Boolean hasMaxUnavailable(){
            return this.maxUnavailable!=null;
    }

    public PodDisruptionBudgetSpecFluent.MaxUnavailableNested withNewMaxUnavailable(){
            return new MaxUnavailableNestedImpl();
    }

    public PodDisruptionBudgetSpecFluent.MaxUnavailableNested withNewMaxUnavailableLike(IntOrString item){
            return new MaxUnavailableNestedImpl(item);
    }

    public PodDisruptionBudgetSpecFluent.MaxUnavailableNested editMaxUnavailable(){
            return withNewMaxUnavailableLike(getMaxUnavailable());
    }

    public PodDisruptionBudgetSpecFluent.MaxUnavailableNested editOrNewMaxUnavailable(){
            return withNewMaxUnavailableLike(getMaxUnavailable() != null ? getMaxUnavailable(): new IntOrStringBuilder().build());
    }

    public PodDisruptionBudgetSpecFluent.MaxUnavailableNested editOrNewMaxUnavailableLike(IntOrString item){
            return withNewMaxUnavailableLike(getMaxUnavailable() != null ? getMaxUnavailable(): item);
    }

    public A withNewMaxUnavailable(Integer intVal){
            return (A)withMaxUnavailable(new IntOrString(intVal));
    }

    public A withNewMaxUnavailable(String strVal){
            return (A)withMaxUnavailable(new IntOrString(strVal));
    }

    
/**
 * This method has been deprecated, please use method buildMinAvailable instead.
 */
@Deprecated public IntOrString getMinAvailable(){
            return this.minAvailable!=null?this.minAvailable.build():null;
    }

    public IntOrString buildMinAvailable(){
            return this.minAvailable!=null?this.minAvailable.build():null;
    }

    public A withMinAvailable(IntOrString minAvailable){
            _visitables.remove(this.minAvailable);
            if (minAvailable!=null){ this.minAvailable= new IntOrStringBuilder(minAvailable); _visitables.add(this.minAvailable);} return (A) this;
    }

    public Boolean hasMinAvailable(){
            return this.minAvailable!=null;
    }

    public PodDisruptionBudgetSpecFluent.MinAvailableNested withNewMinAvailable(){
            return new MinAvailableNestedImpl();
    }

    public PodDisruptionBudgetSpecFluent.MinAvailableNested withNewMinAvailableLike(IntOrString item){
            return new MinAvailableNestedImpl(item);
    }

    public PodDisruptionBudgetSpecFluent.MinAvailableNested editMinAvailable(){
            return withNewMinAvailableLike(getMinAvailable());
    }

    public PodDisruptionBudgetSpecFluent.MinAvailableNested editOrNewMinAvailable(){
            return withNewMinAvailableLike(getMinAvailable() != null ? getMinAvailable(): new IntOrStringBuilder().build());
    }

    public PodDisruptionBudgetSpecFluent.MinAvailableNested editOrNewMinAvailableLike(IntOrString item){
            return withNewMinAvailableLike(getMinAvailable() != null ? getMinAvailable(): item);
    }

    public A withNewMinAvailable(Integer intVal){
            return (A)withMinAvailable(new IntOrString(intVal));
    }

    public A withNewMinAvailable(String strVal){
            return (A)withMinAvailable(new IntOrString(strVal));
    }

    
/**
 * 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 PodDisruptionBudgetSpecFluent.SelectorNested withNewSelector(){
            return new SelectorNestedImpl();
    }

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

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

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

    public PodDisruptionBudgetSpecFluent.SelectorNested editOrNewSelectorLike(LabelSelector item){
            return withNewSelectorLike(getSelector() != null ? getSelector(): 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;
            PodDisruptionBudgetSpecFluentImpl that = (PodDisruptionBudgetSpecFluentImpl) o;
            if (maxUnavailable != null ? !maxUnavailable.equals(that.maxUnavailable) :that.maxUnavailable != null) return false;
            if (minAvailable != null ? !minAvailable.equals(that.minAvailable) :that.minAvailable != null) return false;
            if (selector != null ? !selector.equals(that.selector) :that.selector != null) return false;
            return true;
    }


    public class MaxUnavailableNestedImpl extends IntOrStringFluentImpl> implements PodDisruptionBudgetSpecFluent.MaxUnavailableNested,io.alauda.kubernetes.api.builder.Nested{

            private final IntOrStringBuilder builder;
    
            MaxUnavailableNestedImpl(IntOrString item){
                    this.builder = new IntOrStringBuilder(this, item);
            }
            MaxUnavailableNestedImpl(){
                    this.builder = new IntOrStringBuilder(this);
            }
    
    public N and(){
            return (N) PodDisruptionBudgetSpecFluentImpl.this.withMaxUnavailable(builder.build());
    }
    public N endMaxUnavailable(){
            return and();
    }

}
    public class MinAvailableNestedImpl extends IntOrStringFluentImpl> implements PodDisruptionBudgetSpecFluent.MinAvailableNested,io.alauda.kubernetes.api.builder.Nested{

            private final IntOrStringBuilder builder;
    
            MinAvailableNestedImpl(IntOrString item){
                    this.builder = new IntOrStringBuilder(this, item);
            }
            MinAvailableNestedImpl(){
                    this.builder = new IntOrStringBuilder(this);
            }
    
    public N and(){
            return (N) PodDisruptionBudgetSpecFluentImpl.this.withMinAvailable(builder.build());
    }
    public N endMinAvailable(){
            return and();
    }

}
    public class SelectorNestedImpl extends LabelSelectorFluentImpl> implements PodDisruptionBudgetSpecFluent.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) PodDisruptionBudgetSpecFluentImpl.this.withSelector(builder.build());
    }
    public N endSelector(){
            return and();
    }

}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy