All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.kubernetes.client.openapi.models.V1beta2AllocationResultFluent Maven / Gradle / Ivy

The newest version!
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 V1beta2AllocationResultFluent> extends BaseFluent{
  public V1beta2AllocationResultFluent() {
  }
  
  public V1beta2AllocationResultFluent(V1beta2AllocationResult instance) {
    this.copyInstance(instance);
  }
  private V1beta2DeviceAllocationResultBuilder devices;
  private V1NodeSelectorBuilder nodeSelector;
  
  protected void copyInstance(V1beta2AllocationResult instance) {
    instance = (instance != null ? instance : new V1beta2AllocationResult());
    if (instance != null) {
          this.withDevices(instance.getDevices());
          this.withNodeSelector(instance.getNodeSelector());
        }
  }
  
  public V1beta2DeviceAllocationResult buildDevices() {
    return this.devices != null ? this.devices.build() : null;
  }
  
  public A withDevices(V1beta2DeviceAllocationResult devices) {
    this._visitables.remove("devices");
    if (devices != null) {
        this.devices = new V1beta2DeviceAllocationResultBuilder(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(V1beta2DeviceAllocationResult 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 V1beta2DeviceAllocationResultBuilder().build()));
  }
  
  public DevicesNested editOrNewDevicesLike(V1beta2DeviceAllocationResult 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;
    V1beta2AllocationResultFluent that = (V1beta2AllocationResultFluent) 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 V1beta2DeviceAllocationResultFluent> implements Nested{
    DevicesNested(V1beta2DeviceAllocationResult item) {
      this.builder = new V1beta2DeviceAllocationResultBuilder(this, item);
    }
    V1beta2DeviceAllocationResultBuilder builder;
    
    public N and() {
      return (N) V1beta2AllocationResultFluent.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) V1beta2AllocationResultFluent.this.withNodeSelector(builder.build());
    }
    
    public N endNodeSelector() {
      return and();
    }
    
  
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy