io.kubernetes.client.openapi.models.V1beta1AllocationResultFluent 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 V1beta1AllocationResultFluent> extends BaseFluent{
public V1beta1AllocationResultFluent() {
}
public V1beta1AllocationResultFluent(V1beta1AllocationResult instance) {
this.copyInstance(instance);
}
private V1beta1DeviceAllocationResultBuilder devices;
private V1NodeSelectorBuilder nodeSelector;
protected void copyInstance(V1beta1AllocationResult instance) {
instance = (instance != null ? instance : new V1beta1AllocationResult());
if (instance != null) {
this.withDevices(instance.getDevices());
this.withNodeSelector(instance.getNodeSelector());
}
}
public V1beta1DeviceAllocationResult buildDevices() {
return this.devices != null ? this.devices.build() : null;
}
public A withDevices(V1beta1DeviceAllocationResult devices) {
this._visitables.remove("devices");
if (devices != null) {
this.devices = new V1beta1DeviceAllocationResultBuilder(devices);
this._visitables.get("devices").add(this.devices);
} else {
this.devices = null;
this._visitables.get("devices").remove(this.devices);
}
return (A) this;
}
public boolean hasDevices() {
return this.devices != null;
}
public DevicesNested withNewDevices() {
return new DevicesNested(null);
}
public DevicesNested withNewDevicesLike(V1beta1DeviceAllocationResult item) {
return new DevicesNested(item);
}
public DevicesNested editDevices() {
return withNewDevicesLike(java.util.Optional.ofNullable(buildDevices()).orElse(null));
}
public DevicesNested editOrNewDevices() {
return withNewDevicesLike(java.util.Optional.ofNullable(buildDevices()).orElse(new V1beta1DeviceAllocationResultBuilder().build()));
}
public DevicesNested editOrNewDevicesLike(V1beta1DeviceAllocationResult item) {
return withNewDevicesLike(java.util.Optional.ofNullable(buildDevices()).orElse(item));
}
public V1NodeSelector buildNodeSelector() {
return this.nodeSelector != null ? this.nodeSelector.build() : null;
}
public A withNodeSelector(V1NodeSelector nodeSelector) {
this._visitables.remove("nodeSelector");
if (nodeSelector != null) {
this.nodeSelector = new V1NodeSelectorBuilder(nodeSelector);
this._visitables.get("nodeSelector").add(this.nodeSelector);
} else {
this.nodeSelector = null;
this._visitables.get("nodeSelector").remove(this.nodeSelector);
}
return (A) this;
}
public boolean hasNodeSelector() {
return this.nodeSelector != null;
}
public NodeSelectorNested withNewNodeSelector() {
return new NodeSelectorNested(null);
}
public NodeSelectorNested withNewNodeSelectorLike(V1NodeSelector item) {
return new NodeSelectorNested(item);
}
public NodeSelectorNested editNodeSelector() {
return withNewNodeSelectorLike(java.util.Optional.ofNullable(buildNodeSelector()).orElse(null));
}
public NodeSelectorNested editOrNewNodeSelector() {
return withNewNodeSelectorLike(java.util.Optional.ofNullable(buildNodeSelector()).orElse(new V1NodeSelectorBuilder().build()));
}
public NodeSelectorNested editOrNewNodeSelectorLike(V1NodeSelector item) {
return withNewNodeSelectorLike(java.util.Optional.ofNullable(buildNodeSelector()).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;
V1beta1AllocationResultFluent that = (V1beta1AllocationResultFluent) o;
if (!java.util.Objects.equals(devices, that.devices)) return false;
if (!java.util.Objects.equals(nodeSelector, that.nodeSelector)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(devices, nodeSelector, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (devices != null) { sb.append("devices:"); sb.append(devices + ","); }
if (nodeSelector != null) { sb.append("nodeSelector:"); sb.append(nodeSelector); }
sb.append("}");
return sb.toString();
}
public class DevicesNested extends V1beta1DeviceAllocationResultFluent> implements Nested{
DevicesNested(V1beta1DeviceAllocationResult item) {
this.builder = new V1beta1DeviceAllocationResultBuilder(this, item);
}
V1beta1DeviceAllocationResultBuilder builder;
public N and() {
return (N) V1beta1AllocationResultFluent.this.withDevices(builder.build());
}
public N endDevices() {
return and();
}
}
public class NodeSelectorNested extends V1NodeSelectorFluent> implements Nested{
NodeSelectorNested(V1NodeSelector item) {
this.builder = new V1NodeSelectorBuilder(this, item);
}
V1NodeSelectorBuilder builder;
public N and() {
return (N) V1beta1AllocationResultFluent.this.withNodeSelector(builder.build());
}
public N endNodeSelector() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy