io.kubernetes.client.openapi.models.V2beta2HorizontalPodAutoscalerBehaviorFluentImpl Maven / Gradle / Ivy
package io.kubernetes.client.openapi.models;
import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.fluent.Nested;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
public class V2beta2HorizontalPodAutoscalerBehaviorFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V2beta2HorizontalPodAutoscalerBehaviorFluent {
private V2beta2HPAScalingRulesBuilder scaleDown;
private V2beta2HPAScalingRulesBuilder scaleUp;
public V2beta2HorizontalPodAutoscalerBehaviorFluentImpl() {
}
public V2beta2HorizontalPodAutoscalerBehaviorFluentImpl(V2beta2HorizontalPodAutoscalerBehavior instance) {
this.withScaleDown(instance.getScaleDown());
this.withScaleUp(instance.getScaleUp());
}
/**
* This method has been deprecated, please use method buildScaleDown instead.
* @return The buildable object.
*/
@Deprecated public V2beta2HPAScalingRules getScaleDown() {
return this.scaleDown!=null?this.scaleDown.build():null;
}
public V2beta2HPAScalingRules buildScaleDown() {
return this.scaleDown!=null?this.scaleDown.build():null;
}
public A withScaleDown(V2beta2HPAScalingRules scaleDown) {
_visitables.get("scaleDown").remove(this.scaleDown);
if (scaleDown!=null){ this.scaleDown= new V2beta2HPAScalingRulesBuilder(scaleDown); _visitables.get("scaleDown").add(this.scaleDown);} return (A) this;
}
public Boolean hasScaleDown() {
return this.scaleDown != null;
}
public V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleDownNested withNewScaleDown() {
return new ScaleDownNestedImpl();
}
public V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleDownNested withNewScaleDownLike(V2beta2HPAScalingRules item) {
return new ScaleDownNestedImpl(item);
}
public V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleDownNested editScaleDown() {
return withNewScaleDownLike(getScaleDown());
}
public V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleDownNested editOrNewScaleDown() {
return withNewScaleDownLike(getScaleDown() != null ? getScaleDown(): new V2beta2HPAScalingRulesBuilder().build());
}
public V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleDownNested editOrNewScaleDownLike(V2beta2HPAScalingRules item) {
return withNewScaleDownLike(getScaleDown() != null ? getScaleDown(): item);
}
/**
* This method has been deprecated, please use method buildScaleUp instead.
* @return The buildable object.
*/
@Deprecated public V2beta2HPAScalingRules getScaleUp() {
return this.scaleUp!=null?this.scaleUp.build():null;
}
public V2beta2HPAScalingRules buildScaleUp() {
return this.scaleUp!=null?this.scaleUp.build():null;
}
public A withScaleUp(V2beta2HPAScalingRules scaleUp) {
_visitables.get("scaleUp").remove(this.scaleUp);
if (scaleUp!=null){ this.scaleUp= new V2beta2HPAScalingRulesBuilder(scaleUp); _visitables.get("scaleUp").add(this.scaleUp);} return (A) this;
}
public Boolean hasScaleUp() {
return this.scaleUp != null;
}
public V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleUpNested withNewScaleUp() {
return new ScaleUpNestedImpl();
}
public V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleUpNested withNewScaleUpLike(V2beta2HPAScalingRules item) {
return new ScaleUpNestedImpl(item);
}
public V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleUpNested editScaleUp() {
return withNewScaleUpLike(getScaleUp());
}
public V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleUpNested editOrNewScaleUp() {
return withNewScaleUpLike(getScaleUp() != null ? getScaleUp(): new V2beta2HPAScalingRulesBuilder().build());
}
public V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleUpNested editOrNewScaleUpLike(V2beta2HPAScalingRules item) {
return withNewScaleUpLike(getScaleUp() != null ? getScaleUp(): item);
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
V2beta2HorizontalPodAutoscalerBehaviorFluentImpl that = (V2beta2HorizontalPodAutoscalerBehaviorFluentImpl) o;
if (scaleDown != null ? !scaleDown.equals(that.scaleDown) :that.scaleDown != null) return false;
if (scaleUp != null ? !scaleUp.equals(that.scaleUp) :that.scaleUp != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(scaleDown, scaleUp, super.hashCode());
}
public class ScaleDownNestedImpl extends V2beta2HPAScalingRulesFluentImpl> implements V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleDownNested,io.kubernetes.client.fluent.Nested {
private final V2beta2HPAScalingRulesBuilder builder;
ScaleDownNestedImpl(V2beta2HPAScalingRules item) {
this.builder = new V2beta2HPAScalingRulesBuilder(this, item);
}
ScaleDownNestedImpl() {
this.builder = new V2beta2HPAScalingRulesBuilder(this);
}
public N and() {
return (N) V2beta2HorizontalPodAutoscalerBehaviorFluentImpl.this.withScaleDown(builder.build());
}
public N endScaleDown() {
return and();
}
}
public class ScaleUpNestedImpl extends V2beta2HPAScalingRulesFluentImpl> implements V2beta2HorizontalPodAutoscalerBehaviorFluent.ScaleUpNested,io.kubernetes.client.fluent.Nested {
private final V2beta2HPAScalingRulesBuilder builder;
ScaleUpNestedImpl(V2beta2HPAScalingRules item) {
this.builder = new V2beta2HPAScalingRulesBuilder(this, item);
}
ScaleUpNestedImpl() {
this.builder = new V2beta2HPAScalingRulesBuilder(this);
}
public N and() {
return (N) V2beta2HorizontalPodAutoscalerBehaviorFluentImpl.this.withScaleUp(builder.build());
}
public N endScaleUp() {
return and();
}
}
}