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

io.fabric8.openshift.api.model.installer.baremetal.v1.HostFluent Maven / Gradle / Ivy

The newest version!
package io.fabric8.openshift.api.model.installer.baremetal.v1;

import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import com.fasterxml.jackson.databind.JsonNode;
import java.lang.String;
import java.util.LinkedHashMap;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
import java.util.Map;

/**
 * Generated
 */
@SuppressWarnings("unchecked")
public class HostFluent> extends BaseFluent{
  public HostFluent() {
  }
  
  public HostFluent(Host instance) {
    this.copyInstance(instance);
  }
  private BMCBuilder bmc;
  private String bootMACAddress;
  private String bootMode;
  private String hardwareProfile;
  private String name;
  private JsonNode networkConfig;
  private String role;
  private RootDeviceHintsBuilder rootDeviceHints;
  private Map additionalProperties;
  
  protected void copyInstance(Host instance) {
    instance = (instance != null ? instance : new Host());
    if (instance != null) {
          this.withBmc(instance.getBmc());
          this.withBootMACAddress(instance.getBootMACAddress());
          this.withBootMode(instance.getBootMode());
          this.withHardwareProfile(instance.getHardwareProfile());
          this.withName(instance.getName());
          this.withNetworkConfig(instance.getNetworkConfig());
          this.withRole(instance.getRole());
          this.withRootDeviceHints(instance.getRootDeviceHints());
          this.withAdditionalProperties(instance.getAdditionalProperties());
        }
  }
  
  public BMC buildBmc() {
    return this.bmc != null ? this.bmc.build() : null;
  }
  
  public A withBmc(BMC bmc) {
    this._visitables.remove("bmc");
    if (bmc != null) {
        this.bmc = new BMCBuilder(bmc);
        this._visitables.get("bmc").add(this.bmc);
    } else {
        this.bmc = null;
        this._visitables.get("bmc").remove(this.bmc);
    }
    return (A) this;
  }
  
  public boolean hasBmc() {
    return this.bmc != null;
  }
  
  public A withNewBmc(String address,Boolean disableCertificateVerification,String password,String username) {
    return (A)withBmc(new BMC(address, disableCertificateVerification, password, username));
  }
  
  public BmcNested withNewBmc() {
    return new BmcNested(null);
  }
  
  public BmcNested withNewBmcLike(BMC item) {
    return new BmcNested(item);
  }
  
  public BmcNested editBmc() {
    return withNewBmcLike(java.util.Optional.ofNullable(buildBmc()).orElse(null));
  }
  
  public BmcNested editOrNewBmc() {
    return withNewBmcLike(java.util.Optional.ofNullable(buildBmc()).orElse(new BMCBuilder().build()));
  }
  
  public BmcNested editOrNewBmcLike(BMC item) {
    return withNewBmcLike(java.util.Optional.ofNullable(buildBmc()).orElse(item));
  }
  
  public String getBootMACAddress() {
    return this.bootMACAddress;
  }
  
  public A withBootMACAddress(String bootMACAddress) {
    this.bootMACAddress = bootMACAddress;
    return (A) this;
  }
  
  public boolean hasBootMACAddress() {
    return this.bootMACAddress != null;
  }
  
  public String getBootMode() {
    return this.bootMode;
  }
  
  public A withBootMode(String bootMode) {
    this.bootMode = bootMode;
    return (A) this;
  }
  
  public boolean hasBootMode() {
    return this.bootMode != null;
  }
  
  public String getHardwareProfile() {
    return this.hardwareProfile;
  }
  
  public A withHardwareProfile(String hardwareProfile) {
    this.hardwareProfile = hardwareProfile;
    return (A) this;
  }
  
  public boolean hasHardwareProfile() {
    return this.hardwareProfile != null;
  }
  
  public String getName() {
    return this.name;
  }
  
  public A withName(String name) {
    this.name = name;
    return (A) this;
  }
  
  public boolean hasName() {
    return this.name != null;
  }
  
  public JsonNode getNetworkConfig() {
    return this.networkConfig;
  }
  
  public A withNetworkConfig(JsonNode networkConfig) {
    this.networkConfig = networkConfig;
    return (A) this;
  }
  
  public boolean hasNetworkConfig() {
    return this.networkConfig != null;
  }
  
  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 RootDeviceHints buildRootDeviceHints() {
    return this.rootDeviceHints != null ? this.rootDeviceHints.build() : null;
  }
  
  public A withRootDeviceHints(RootDeviceHints rootDeviceHints) {
    this._visitables.remove("rootDeviceHints");
    if (rootDeviceHints != null) {
        this.rootDeviceHints = new RootDeviceHintsBuilder(rootDeviceHints);
        this._visitables.get("rootDeviceHints").add(this.rootDeviceHints);
    } else {
        this.rootDeviceHints = null;
        this._visitables.get("rootDeviceHints").remove(this.rootDeviceHints);
    }
    return (A) this;
  }
  
  public boolean hasRootDeviceHints() {
    return this.rootDeviceHints != null;
  }
  
  public RootDeviceHintsNested withNewRootDeviceHints() {
    return new RootDeviceHintsNested(null);
  }
  
  public RootDeviceHintsNested withNewRootDeviceHintsLike(RootDeviceHints item) {
    return new RootDeviceHintsNested(item);
  }
  
  public RootDeviceHintsNested editRootDeviceHints() {
    return withNewRootDeviceHintsLike(java.util.Optional.ofNullable(buildRootDeviceHints()).orElse(null));
  }
  
  public RootDeviceHintsNested editOrNewRootDeviceHints() {
    return withNewRootDeviceHintsLike(java.util.Optional.ofNullable(buildRootDeviceHints()).orElse(new RootDeviceHintsBuilder().build()));
  }
  
  public RootDeviceHintsNested editOrNewRootDeviceHintsLike(RootDeviceHints item) {
    return withNewRootDeviceHintsLike(java.util.Optional.ofNullable(buildRootDeviceHints()).orElse(item));
  }
  
  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(bmc, that.bmc)) return false;
    if (!java.util.Objects.equals(bootMACAddress, that.bootMACAddress)) return false;
    if (!java.util.Objects.equals(bootMode, that.bootMode)) return false;
    if (!java.util.Objects.equals(hardwareProfile, that.hardwareProfile)) return false;
    if (!java.util.Objects.equals(name, that.name)) return false;
    if (!java.util.Objects.equals(networkConfig, that.networkConfig)) return false;
    if (!java.util.Objects.equals(role, that.role)) return false;
    if (!java.util.Objects.equals(rootDeviceHints, that.rootDeviceHints)) return false;
    if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(bmc,  bootMACAddress,  bootMode,  hardwareProfile,  name,  networkConfig,  role,  rootDeviceHints,  additionalProperties,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (bmc != null) { sb.append("bmc:"); sb.append(bmc + ","); }
    if (bootMACAddress != null) { sb.append("bootMACAddress:"); sb.append(bootMACAddress + ","); }
    if (bootMode != null) { sb.append("bootMode:"); sb.append(bootMode + ","); }
    if (hardwareProfile != null) { sb.append("hardwareProfile:"); sb.append(hardwareProfile + ","); }
    if (name != null) { sb.append("name:"); sb.append(name + ","); }
    if (networkConfig != null) { sb.append("networkConfig:"); sb.append(networkConfig + ","); }
    if (role != null) { sb.append("role:"); sb.append(role + ","); }
    if (rootDeviceHints != null) { sb.append("rootDeviceHints:"); sb.append(rootDeviceHints + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  public class BmcNested extends BMCFluent> implements Nested{
    BmcNested(BMC item) {
      this.builder = new BMCBuilder(this, item);
    }
    BMCBuilder builder;
    
    public N and() {
      return (N) HostFluent.this.withBmc(builder.build());
    }
    
    public N endBmc() {
      return and();
    }
    
  
  }
  public class RootDeviceHintsNested extends RootDeviceHintsFluent> implements Nested{
    RootDeviceHintsNested(RootDeviceHints item) {
      this.builder = new RootDeviceHintsBuilder(this, item);
    }
    RootDeviceHintsBuilder builder;
    
    public N and() {
      return (N) HostFluent.this.withRootDeviceHints(builder.build());
    }
    
    public N endRootDeviceHints() {
      return and();
    }
    
  
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy