io.kubernetes.client.openapi.models.V2ContainerResourceMetricStatusFluent Maven / Gradle / Ivy
package io.kubernetes.client.openapi.models;
import java.lang.SuppressWarnings;
import io.kubernetes.client.fluent.BaseFluent;
import io.kubernetes.client.fluent.Nested;
import java.lang.Object;
import java.lang.String;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class V2ContainerResourceMetricStatusFluent> extends BaseFluent{
public V2ContainerResourceMetricStatusFluent() {
}
public V2ContainerResourceMetricStatusFluent(V2ContainerResourceMetricStatus instance) {
this.copyInstance(instance);
}
private String container;
private V2MetricValueStatusBuilder current;
private String name;
protected void copyInstance(V2ContainerResourceMetricStatus instance) {
instance = (instance != null ? instance : new V2ContainerResourceMetricStatus());
if (instance != null) {
this.withContainer(instance.getContainer());
this.withCurrent(instance.getCurrent());
this.withName(instance.getName());
}
}
public String getContainer() {
return this.container;
}
public A withContainer(String container) {
this.container = container;
return (A) this;
}
public boolean hasContainer() {
return this.container != null;
}
public V2MetricValueStatus buildCurrent() {
return this.current != null ? this.current.build() : null;
}
public A withCurrent(V2MetricValueStatus current) {
this._visitables.remove("current");
if (current != null) {
this.current = new V2MetricValueStatusBuilder(current);
this._visitables.get("current").add(this.current);
} else {
this.current = null;
this._visitables.get("current").remove(this.current);
}
return (A) this;
}
public boolean hasCurrent() {
return this.current != null;
}
public CurrentNested withNewCurrent() {
return new CurrentNested(null);
}
public CurrentNested withNewCurrentLike(V2MetricValueStatus item) {
return new CurrentNested(item);
}
public CurrentNested editCurrent() {
return withNewCurrentLike(java.util.Optional.ofNullable(buildCurrent()).orElse(null));
}
public CurrentNested editOrNewCurrent() {
return withNewCurrentLike(java.util.Optional.ofNullable(buildCurrent()).orElse(new V2MetricValueStatusBuilder().build()));
}
public CurrentNested editOrNewCurrentLike(V2MetricValueStatus item) {
return withNewCurrentLike(java.util.Optional.ofNullable(buildCurrent()).orElse(item));
}
public String getName() {
return this.name;
}
public A withName(String name) {
this.name = name;
return (A) this;
}
public boolean hasName() {
return this.name != null;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
V2ContainerResourceMetricStatusFluent that = (V2ContainerResourceMetricStatusFluent) o;
if (!java.util.Objects.equals(container, that.container)) return false;
if (!java.util.Objects.equals(current, that.current)) return false;
if (!java.util.Objects.equals(name, that.name)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(container, current, name, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (container != null) { sb.append("container:"); sb.append(container + ","); }
if (current != null) { sb.append("current:"); sb.append(current + ","); }
if (name != null) { sb.append("name:"); sb.append(name); }
sb.append("}");
return sb.toString();
}
public class CurrentNested extends V2MetricValueStatusFluent> implements Nested{
CurrentNested(V2MetricValueStatus item) {
this.builder = new V2MetricValueStatusBuilder(this, item);
}
V2MetricValueStatusBuilder builder;
public N and() {
return (N) V2ContainerResourceMetricStatusFluent.this.withCurrent(builder.build());
}
public N endCurrent() {
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy