io.kubernetes.client.openapi.models.V2beta2ObjectMetricStatusFluentImpl 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 V2beta2ObjectMetricStatusFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V2beta2ObjectMetricStatusFluent {
private V2beta2MetricValueStatusBuilder current;
private V2beta2CrossVersionObjectReferenceBuilder describedObject;
private V2beta2MetricIdentifierBuilder metric;
public V2beta2ObjectMetricStatusFluentImpl() {
}
public V2beta2ObjectMetricStatusFluentImpl(V2beta2ObjectMetricStatus instance) {
this.withCurrent(instance.getCurrent());
this.withDescribedObject(instance.getDescribedObject());
this.withMetric(instance.getMetric());
}
/**
* This method has been deprecated, please use method buildCurrent instead.
* @return The buildable object.
*/
@Deprecated public V2beta2MetricValueStatus getCurrent() {
return this.current!=null?this.current.build():null;
}
public V2beta2MetricValueStatus buildCurrent() {
return this.current!=null?this.current.build():null;
}
public A withCurrent(V2beta2MetricValueStatus current) {
_visitables.get("current").remove(this.current);
if (current!=null){ this.current= new V2beta2MetricValueStatusBuilder(current); _visitables.get("current").add(this.current);} return (A) this;
}
public Boolean hasCurrent() {
return this.current != null;
}
public V2beta2ObjectMetricStatusFluent.CurrentNested withNewCurrent() {
return new CurrentNestedImpl();
}
public V2beta2ObjectMetricStatusFluent.CurrentNested withNewCurrentLike(V2beta2MetricValueStatus item) {
return new CurrentNestedImpl(item);
}
public V2beta2ObjectMetricStatusFluent.CurrentNested editCurrent() {
return withNewCurrentLike(getCurrent());
}
public V2beta2ObjectMetricStatusFluent.CurrentNested editOrNewCurrent() {
return withNewCurrentLike(getCurrent() != null ? getCurrent(): new V2beta2MetricValueStatusBuilder().build());
}
public V2beta2ObjectMetricStatusFluent.CurrentNested editOrNewCurrentLike(V2beta2MetricValueStatus item) {
return withNewCurrentLike(getCurrent() != null ? getCurrent(): item);
}
/**
* This method has been deprecated, please use method buildDescribedObject instead.
* @return The buildable object.
*/
@Deprecated public V2beta2CrossVersionObjectReference getDescribedObject() {
return this.describedObject!=null?this.describedObject.build():null;
}
public V2beta2CrossVersionObjectReference buildDescribedObject() {
return this.describedObject!=null?this.describedObject.build():null;
}
public A withDescribedObject(V2beta2CrossVersionObjectReference describedObject) {
_visitables.get("describedObject").remove(this.describedObject);
if (describedObject!=null){ this.describedObject= new V2beta2CrossVersionObjectReferenceBuilder(describedObject); _visitables.get("describedObject").add(this.describedObject);} return (A) this;
}
public Boolean hasDescribedObject() {
return this.describedObject != null;
}
public V2beta2ObjectMetricStatusFluent.DescribedObjectNested withNewDescribedObject() {
return new DescribedObjectNestedImpl();
}
public V2beta2ObjectMetricStatusFluent.DescribedObjectNested withNewDescribedObjectLike(V2beta2CrossVersionObjectReference item) {
return new DescribedObjectNestedImpl(item);
}
public V2beta2ObjectMetricStatusFluent.DescribedObjectNested editDescribedObject() {
return withNewDescribedObjectLike(getDescribedObject());
}
public V2beta2ObjectMetricStatusFluent.DescribedObjectNested editOrNewDescribedObject() {
return withNewDescribedObjectLike(getDescribedObject() != null ? getDescribedObject(): new V2beta2CrossVersionObjectReferenceBuilder().build());
}
public V2beta2ObjectMetricStatusFluent.DescribedObjectNested editOrNewDescribedObjectLike(V2beta2CrossVersionObjectReference item) {
return withNewDescribedObjectLike(getDescribedObject() != null ? getDescribedObject(): item);
}
/**
* This method has been deprecated, please use method buildMetric instead.
* @return The buildable object.
*/
@Deprecated public V2beta2MetricIdentifier getMetric() {
return this.metric!=null?this.metric.build():null;
}
public V2beta2MetricIdentifier buildMetric() {
return this.metric!=null?this.metric.build():null;
}
public A withMetric(V2beta2MetricIdentifier metric) {
_visitables.get("metric").remove(this.metric);
if (metric!=null){ this.metric= new V2beta2MetricIdentifierBuilder(metric); _visitables.get("metric").add(this.metric);} return (A) this;
}
public Boolean hasMetric() {
return this.metric != null;
}
public V2beta2ObjectMetricStatusFluent.MetricNested withNewMetric() {
return new MetricNestedImpl();
}
public V2beta2ObjectMetricStatusFluent.MetricNested withNewMetricLike(V2beta2MetricIdentifier item) {
return new MetricNestedImpl(item);
}
public V2beta2ObjectMetricStatusFluent.MetricNested editMetric() {
return withNewMetricLike(getMetric());
}
public V2beta2ObjectMetricStatusFluent.MetricNested editOrNewMetric() {
return withNewMetricLike(getMetric() != null ? getMetric(): new V2beta2MetricIdentifierBuilder().build());
}
public V2beta2ObjectMetricStatusFluent.MetricNested editOrNewMetricLike(V2beta2MetricIdentifier item) {
return withNewMetricLike(getMetric() != null ? getMetric(): item);
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
V2beta2ObjectMetricStatusFluentImpl that = (V2beta2ObjectMetricStatusFluentImpl) o;
if (current != null ? !current.equals(that.current) :that.current != null) return false;
if (describedObject != null ? !describedObject.equals(that.describedObject) :that.describedObject != null) return false;
if (metric != null ? !metric.equals(that.metric) :that.metric != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(current, describedObject, metric, super.hashCode());
}
public class CurrentNestedImpl extends V2beta2MetricValueStatusFluentImpl> implements V2beta2ObjectMetricStatusFluent.CurrentNested,io.kubernetes.client.fluent.Nested {
private final V2beta2MetricValueStatusBuilder builder;
CurrentNestedImpl(V2beta2MetricValueStatus item) {
this.builder = new V2beta2MetricValueStatusBuilder(this, item);
}
CurrentNestedImpl() {
this.builder = new V2beta2MetricValueStatusBuilder(this);
}
public N and() {
return (N) V2beta2ObjectMetricStatusFluentImpl.this.withCurrent(builder.build());
}
public N endCurrent() {
return and();
}
}
public class DescribedObjectNestedImpl extends V2beta2CrossVersionObjectReferenceFluentImpl> implements V2beta2ObjectMetricStatusFluent.DescribedObjectNested,io.kubernetes.client.fluent.Nested {
private final V2beta2CrossVersionObjectReferenceBuilder builder;
DescribedObjectNestedImpl(V2beta2CrossVersionObjectReference item) {
this.builder = new V2beta2CrossVersionObjectReferenceBuilder(this, item);
}
DescribedObjectNestedImpl() {
this.builder = new V2beta2CrossVersionObjectReferenceBuilder(this);
}
public N and() {
return (N) V2beta2ObjectMetricStatusFluentImpl.this.withDescribedObject(builder.build());
}
public N endDescribedObject() {
return and();
}
}
public class MetricNestedImpl extends V2beta2MetricIdentifierFluentImpl> implements V2beta2ObjectMetricStatusFluent.MetricNested,io.kubernetes.client.fluent.Nested {
private final V2beta2MetricIdentifierBuilder builder;
MetricNestedImpl(V2beta2MetricIdentifier item) {
this.builder = new V2beta2MetricIdentifierBuilder(this, item);
}
MetricNestedImpl() {
this.builder = new V2beta2MetricIdentifierBuilder(this);
}
public N and() {
return (N) V2beta2ObjectMetricStatusFluentImpl.this.withMetric(builder.build());
}
public N endMetric() {
return and();
}
}
}