io.fabric8.openshift.api.model.installer.vsphere.v1.HostFluent Maven / Gradle / Ivy
The newest version!
package io.fabric8.openshift.api.model.installer.vsphere.v1;
import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.util.Map;
/**
* Generated
*/
@SuppressWarnings("unchecked")
public class HostFluent> extends BaseFluent{
public HostFluent() {
}
public HostFluent(Host instance) {
this.copyInstance(instance);
}
private String failureDomain;
private NetworkDeviceSpecBuilder networkDevice;
private String role;
private Map additionalProperties;
protected void copyInstance(Host instance) {
instance = (instance != null ? instance : new Host());
if (instance != null) {
this.withFailureDomain(instance.getFailureDomain());
this.withNetworkDevice(instance.getNetworkDevice());
this.withRole(instance.getRole());
this.withAdditionalProperties(instance.getAdditionalProperties());
}
}
public String getFailureDomain() {
return this.failureDomain;
}
public A withFailureDomain(String failureDomain) {
this.failureDomain = failureDomain;
return (A) this;
}
public boolean hasFailureDomain() {
return this.failureDomain != null;
}
public NetworkDeviceSpec buildNetworkDevice() {
return this.networkDevice != null ? this.networkDevice.build() : null;
}
public A withNetworkDevice(NetworkDeviceSpec networkDevice) {
this._visitables.remove("networkDevice");
if (networkDevice != null) {
this.networkDevice = new NetworkDeviceSpecBuilder(networkDevice);
this._visitables.get("networkDevice").add(this.networkDevice);
} else {
this.networkDevice = null;
this._visitables.get("networkDevice").remove(this.networkDevice);
}
return (A) this;
}
public boolean hasNetworkDevice() {
return this.networkDevice != null;
}
public NetworkDeviceNested withNewNetworkDevice() {
return new NetworkDeviceNested(null);
}
public NetworkDeviceNested withNewNetworkDeviceLike(NetworkDeviceSpec item) {
return new NetworkDeviceNested(item);
}
public NetworkDeviceNested editNetworkDevice() {
return withNewNetworkDeviceLike(java.util.Optional.ofNullable(buildNetworkDevice()).orElse(null));
}
public NetworkDeviceNested editOrNewNetworkDevice() {
return withNewNetworkDeviceLike(java.util.Optional.ofNullable(buildNetworkDevice()).orElse(new NetworkDeviceSpecBuilder().build()));
}
public NetworkDeviceNested editOrNewNetworkDeviceLike(NetworkDeviceSpec item) {
return withNewNetworkDeviceLike(java.util.Optional.ofNullable(buildNetworkDevice()).orElse(item));
}
public String getRole() {
return this.role;
}
public A withRole(String role) {
this.role = role;
return (A) this;
}
public boolean hasRole() {
return this.role != null;
}
public A addToAdditionalProperties(String key,Object value) {
if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new LinkedHashMap(); }
if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
}
public A addToAdditionalProperties(Map map) {
if(this.additionalProperties == null && map != null) { this.additionalProperties = new LinkedHashMap(); }
if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
}
public A removeFromAdditionalProperties(String key) {
if(this.additionalProperties == null) { return (A) this; }
if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
}
public A removeFromAdditionalProperties(Map map) {
if(this.additionalProperties == null) { return (A) this; }
if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
}
public Map getAdditionalProperties() {
return this.additionalProperties;
}
public A withAdditionalProperties(Map additionalProperties) {
if (additionalProperties == null) {
this.additionalProperties = null;
} else {
this.additionalProperties = new LinkedHashMap(additionalProperties);
}
return (A) this;
}
public boolean hasAdditionalProperties() {
return this.additionalProperties != null;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
HostFluent that = (HostFluent) o;
if (!java.util.Objects.equals(failureDomain, that.failureDomain)) return false;
if (!java.util.Objects.equals(networkDevice, that.networkDevice)) return false;
if (!java.util.Objects.equals(role, that.role)) return false;
if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(failureDomain, networkDevice, role, additionalProperties, super.hashCode());
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (failureDomain != null) { sb.append("failureDomain:"); sb.append(failureDomain + ","); }
if (networkDevice != null) { sb.append("networkDevice:"); sb.append(networkDevice + ","); }
if (role != null) { sb.append("role:"); sb.append(role + ","); }
if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
sb.append("}");
return sb.toString();
}
public class NetworkDeviceNested extends NetworkDeviceSpecFluent> implements Nested{
NetworkDeviceNested(NetworkDeviceSpec item) {
this.builder = new NetworkDeviceSpecBuilder(this, item);
}
NetworkDeviceSpecBuilder builder;
public N and() {
return (N) HostFluent.this.withNetworkDevice(builder.build());
}
public N endNetworkDevice() {
return and();
}
}
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy