io.kubernetes.client.openapi.models.V2beta1PodsMetricStatusFluentImpl Maven / Gradle / Ivy
package io.kubernetes.client.openapi.models;
import java.lang.StringBuilder;
import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.fluent.Nested;
import io.kubernetes.client.custom.Quantity;
import java.lang.String;
import java.lang.StringBuffer;
import java.lang.Deprecated;
import io.kubernetes.client.fluent.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
public class V2beta1PodsMetricStatusFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V2beta1PodsMetricStatusFluent {
private Quantity currentAverageValue;
private String metricName;
private V1LabelSelectorBuilder selector;
public V2beta1PodsMetricStatusFluentImpl() {
}
public V2beta1PodsMetricStatusFluentImpl(V2beta1PodsMetricStatus instance) {
this.withCurrentAverageValue(instance.getCurrentAverageValue());
this.withMetricName(instance.getMetricName());
this.withSelector(instance.getSelector());
}
public Quantity getCurrentAverageValue() {
return this.currentAverageValue;
}
public A withCurrentAverageValue(Quantity currentAverageValue) {
this.currentAverageValue=currentAverageValue; return (A) this;
}
public Boolean hasCurrentAverageValue() {
return this.currentAverageValue != null;
}
public A withNewCurrentAverageValue(final String value) {
return (A)withCurrentAverageValue(new Quantity(value));
}
public String getMetricName() {
return this.metricName;
}
public A withMetricName(String metricName) {
this.metricName=metricName; return (A) this;
}
public Boolean hasMetricName() {
return this.metricName != null;
}
public A withNewMetricName(String arg1) {
return (A)withMetricName(new String(arg1));
}
public A withNewMetricName(StringBuilder arg1) {
return (A)withMetricName(new String(arg1));
}
public A withNewMetricName(StringBuffer arg1) {
return (A)withMetricName(new String(arg1));
}
/**
* This method has been deprecated, please use method buildSelector instead.
* @return The buildable object.
*/
@Deprecated public V1LabelSelector getSelector() {
return this.selector!=null?this.selector.build():null;
}
public V1LabelSelector buildSelector() {
return this.selector!=null?this.selector.build():null;
}
public A withSelector(V1LabelSelector selector) {
_visitables.get("selector").remove(this.selector);
if (selector!=null){ this.selector= new V1LabelSelectorBuilder(selector); _visitables.get("selector").add(this.selector);} return (A) this;
}
public Boolean hasSelector() {
return this.selector != null;
}
public V2beta1PodsMetricStatusFluent.SelectorNested withNewSelector() {
return new SelectorNestedImpl();
}
public V2beta1PodsMetricStatusFluent.SelectorNested withNewSelectorLike(V1LabelSelector item) {
return new SelectorNestedImpl(item);
}
public V2beta1PodsMetricStatusFluent.SelectorNested editSelector() {
return withNewSelectorLike(getSelector());
}
public V2beta1PodsMetricStatusFluent.SelectorNested editOrNewSelector() {
return withNewSelectorLike(getSelector() != null ? getSelector(): new V1LabelSelectorBuilder().build());
}
public V2beta1PodsMetricStatusFluent.SelectorNested editOrNewSelectorLike(V1LabelSelector item) {
return withNewSelectorLike(getSelector() != null ? getSelector(): item);
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
V2beta1PodsMetricStatusFluentImpl that = (V2beta1PodsMetricStatusFluentImpl) o;
if (currentAverageValue != null ? !currentAverageValue.equals(that.currentAverageValue) :that.currentAverageValue != null) return false;
if (metricName != null ? !metricName.equals(that.metricName) :that.metricName != null) return false;
if (selector != null ? !selector.equals(that.selector) :that.selector != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(currentAverageValue, metricName, selector, super.hashCode());
}
public class SelectorNestedImpl extends V1LabelSelectorFluentImpl> implements V2beta1PodsMetricStatusFluent.SelectorNested,io.kubernetes.client.fluent.Nested {
private final V1LabelSelectorBuilder builder;
SelectorNestedImpl(V1LabelSelector item) {
this.builder = new V1LabelSelectorBuilder(this, item);
}
SelectorNestedImpl() {
this.builder = new V1LabelSelectorBuilder(this);
}
public N and() {
return (N) V2beta1PodsMetricStatusFluentImpl.this.withSelector(builder.build());
}
public N endSelector() {
return and();
}
}
}