
io.kubernetes.client.openapi.models.V2HorizontalPodAutoscalerBehaviorFluent Maven / Gradle / Ivy
package io.kubernetes.client.openapi.models;
import java.lang.SuppressWarnings;
import io.kubernetes.client.fluent.Nested;
import java.lang.String;
import io.kubernetes.client.fluent.BaseFluent;
import java.lang.Object;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class V2HorizontalPodAutoscalerBehaviorFluent> extends BaseFluent{
public V2HorizontalPodAutoscalerBehaviorFluent() {
}
public V2HorizontalPodAutoscalerBehaviorFluent(V2HorizontalPodAutoscalerBehavior instance) {
this.copyInstance(instance);
}
private V2HPAScalingRulesBuilder scaleDown;
private V2HPAScalingRulesBuilder scaleUp;
protected void copyInstance(V2HorizontalPodAutoscalerBehavior instance) {
instance = (instance != null ? instance : new V2HorizontalPodAutoscalerBehavior());
if (instance != null) {
this.withScaleDown(instance.getScaleDown());
this.withScaleUp(instance.getScaleUp());
}
}
public V2HPAScalingRules buildScaleDown() {
return this.scaleDown != null ? this.scaleDown.build() : null;
}
public A withScaleDown(V2HPAScalingRules scaleDown) {
this._visitables.remove("scaleDown");
if (scaleDown != null) {
this.scaleDown = new V2HPAScalingRulesBuilder(scaleDown);
this._visitables.get("scaleDown").add(this.scaleDown);
} else {
this.scaleDown = null;
this._visitables.get("scaleDown").remove(this.scaleDown);
}
return (A) this;
}
public boolean hasScaleDown() {
return this.scaleDown != null;
}
public ScaleDownNested withNewScaleDown() {
return new ScaleDownNested(null);
}
public ScaleDownNested withNewScaleDownLike(V2HPAScalingRules item) {
return new ScaleDownNested(item);
}
public ScaleDownNested editScaleDown() {
return withNewScaleDownLike(java.util.Optional.ofNullable(buildScaleDown()).orElse(null));
}
public ScaleDownNested editOrNewScaleDown() {
return withNewScaleDownLike(java.util.Optional.ofNullable(buildScaleDown()).orElse(new V2HPAScalingRulesBuilder().build()));
}
public ScaleDownNested editOrNewScaleDownLike(V2HPAScalingRules item) {
return withNewScaleDownLike(java.util.Optional.ofNullable(buildScaleDown()).orElse(item));
}
public V2HPAScalingRules buildScaleUp() {
return this.scaleUp != null ? this.scaleUp.build() : null;
}
public A withScaleUp(V2HPAScalingRules scaleUp) {
this._visitables.remove("scaleUp");
if (scaleUp != null) {
this.scaleUp = new V2HPAScalingRulesBuilder(scaleUp);
this._visitables.get("scaleUp").add(this.scaleUp);
} else {
this.scaleUp = null;
this._visitables.get("scaleUp").remove(this.scaleUp);
}
return (A) this;
}
public boolean hasScaleUp() {
return this.scaleUp != null;
}
public ScaleUpNested withNewScaleUp() {
return new ScaleUpNested(null);
}
public ScaleUpNested withNewScaleUpLike(V2HPAScalingRules item) {
return new ScaleUpNested(item);
}
public ScaleUpNested editScaleUp() {
return withNewScaleUpLike(java.util.Optional.ofNullable(buildScaleUp()).orElse(null));
}
public ScaleUpNested editOrNewScaleUp() {
return withNewScaleUpLike(java.util.Optional.ofNullable(buildScaleUp()).orElse(new V2HPAScalingRulesBuilder().build()));
}
public ScaleUpNested editOrNewScaleUpLike(V2HPAScalingRules item) {
return withNewScaleUpLike(java.util.Optional.ofNullable(buildScaleUp()).orElse(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;
V2HorizontalPodAutoscalerBehaviorFluent that = (V2HorizontalPodAutoscalerBehaviorFluent) o;
if (!java.util.Objects.equals(scaleDown, that.scaleDown)) return false;
if (!java.util.Objects.equals(scaleUp, that.scaleUp)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(scaleDown, scaleUp, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (scaleDown != null) { sb.append("scaleDown:"); sb.append(scaleDown + ","); }
if (scaleUp != null) { sb.append("scaleUp:"); sb.append(scaleUp); }
sb.append("}");
return sb.toString();
}
public class ScaleDownNested extends V2HPAScalingRulesFluent> implements Nested{
ScaleDownNested(V2HPAScalingRules item) {
this.builder = new V2HPAScalingRulesBuilder(this, item);
}
V2HPAScalingRulesBuilder builder;
public N and() {
return (N) V2HorizontalPodAutoscalerBehaviorFluent.this.withScaleDown(builder.build());
}
public N endScaleDown() {
return and();
}
}
public class ScaleUpNested extends V2HPAScalingRulesFluent> implements Nested{
ScaleUpNested(V2HPAScalingRules item) {
this.builder = new V2HPAScalingRulesBuilder(this, item);
}
V2HPAScalingRulesBuilder builder;
public N and() {
return (N) V2HorizontalPodAutoscalerBehaviorFluent.this.withScaleUp(builder.build());
}
public N endScaleUp() {
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy