io.kubernetes.client.openapi.models.V2ObjectMetricStatusFluent 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 V2ObjectMetricStatusFluent> extends BaseFluent{
public V2ObjectMetricStatusFluent() {
}
public V2ObjectMetricStatusFluent(V2ObjectMetricStatus instance) {
this.copyInstance(instance);
}
private V2MetricValueStatusBuilder current;
private V2CrossVersionObjectReferenceBuilder describedObject;
private V2MetricIdentifierBuilder metric;
protected void copyInstance(V2ObjectMetricStatus instance) {
instance = (instance != null ? instance : new V2ObjectMetricStatus());
if (instance != null) {
this.withCurrent(instance.getCurrent());
this.withDescribedObject(instance.getDescribedObject());
this.withMetric(instance.getMetric());
}
}
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 V2CrossVersionObjectReference buildDescribedObject() {
return this.describedObject != null ? this.describedObject.build() : null;
}
public A withDescribedObject(V2CrossVersionObjectReference describedObject) {
this._visitables.remove("describedObject");
if (describedObject != null) {
this.describedObject = new V2CrossVersionObjectReferenceBuilder(describedObject);
this._visitables.get("describedObject").add(this.describedObject);
} else {
this.describedObject = null;
this._visitables.get("describedObject").remove(this.describedObject);
}
return (A) this;
}
public boolean hasDescribedObject() {
return this.describedObject != null;
}
public DescribedObjectNested withNewDescribedObject() {
return new DescribedObjectNested(null);
}
public DescribedObjectNested withNewDescribedObjectLike(V2CrossVersionObjectReference item) {
return new DescribedObjectNested(item);
}
public DescribedObjectNested editDescribedObject() {
return withNewDescribedObjectLike(java.util.Optional.ofNullable(buildDescribedObject()).orElse(null));
}
public DescribedObjectNested editOrNewDescribedObject() {
return withNewDescribedObjectLike(java.util.Optional.ofNullable(buildDescribedObject()).orElse(new V2CrossVersionObjectReferenceBuilder().build()));
}
public DescribedObjectNested editOrNewDescribedObjectLike(V2CrossVersionObjectReference item) {
return withNewDescribedObjectLike(java.util.Optional.ofNullable(buildDescribedObject()).orElse(item));
}
public V2MetricIdentifier buildMetric() {
return this.metric != null ? this.metric.build() : null;
}
public A withMetric(V2MetricIdentifier metric) {
this._visitables.remove("metric");
if (metric != null) {
this.metric = new V2MetricIdentifierBuilder(metric);
this._visitables.get("metric").add(this.metric);
} else {
this.metric = null;
this._visitables.get("metric").remove(this.metric);
}
return (A) this;
}
public boolean hasMetric() {
return this.metric != null;
}
public MetricNested withNewMetric() {
return new MetricNested(null);
}
public MetricNested withNewMetricLike(V2MetricIdentifier item) {
return new MetricNested(item);
}
public MetricNested editMetric() {
return withNewMetricLike(java.util.Optional.ofNullable(buildMetric()).orElse(null));
}
public MetricNested editOrNewMetric() {
return withNewMetricLike(java.util.Optional.ofNullable(buildMetric()).orElse(new V2MetricIdentifierBuilder().build()));
}
public MetricNested editOrNewMetricLike(V2MetricIdentifier item) {
return withNewMetricLike(java.util.Optional.ofNullable(buildMetric()).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;
V2ObjectMetricStatusFluent that = (V2ObjectMetricStatusFluent) o;
if (!java.util.Objects.equals(current, that.current)) return false;
if (!java.util.Objects.equals(describedObject, that.describedObject)) return false;
if (!java.util.Objects.equals(metric, that.metric)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(current, describedObject, metric, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (current != null) { sb.append("current:"); sb.append(current + ","); }
if (describedObject != null) { sb.append("describedObject:"); sb.append(describedObject + ","); }
if (metric != null) { sb.append("metric:"); sb.append(metric); }
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) V2ObjectMetricStatusFluent.this.withCurrent(builder.build());
}
public N endCurrent() {
return and();
}
}
public class DescribedObjectNested extends V2CrossVersionObjectReferenceFluent> implements Nested{
DescribedObjectNested(V2CrossVersionObjectReference item) {
this.builder = new V2CrossVersionObjectReferenceBuilder(this, item);
}
V2CrossVersionObjectReferenceBuilder builder;
public N and() {
return (N) V2ObjectMetricStatusFluent.this.withDescribedObject(builder.build());
}
public N endDescribedObject() {
return and();
}
}
public class MetricNested extends V2MetricIdentifierFluent> implements Nested{
MetricNested(V2MetricIdentifier item) {
this.builder = new V2MetricIdentifierBuilder(this, item);
}
V2MetricIdentifierBuilder builder;
public N and() {
return (N) V2ObjectMetricStatusFluent.this.withMetric(builder.build());
}
public N endMetric() {
return and();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy