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

io.fabric8.openshift.api.model.machine.v1.ControlPlaneMachineSetTemplateFluent Maven / Gradle / Ivy

There is a newer version: 6.13.4
Show newest version
package io.fabric8.openshift.api.model.machine.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 ControlPlaneMachineSetTemplateFluent> extends BaseFluent{
  public ControlPlaneMachineSetTemplateFluent() {
  }
  
  public ControlPlaneMachineSetTemplateFluent(ControlPlaneMachineSetTemplate instance) {
    this.copyInstance(instance);
  }
  private String machineType;
  private OpenShiftMachineV1Beta1MachineTemplateBuilder machinesV1beta1MachineOpenshiftIo;
  private Map additionalProperties;
  
  protected void copyInstance(ControlPlaneMachineSetTemplate instance) {
    instance = (instance != null ? instance : new ControlPlaneMachineSetTemplate());
  
    if (instance != null) {
        this.withMachineType(instance.getMachineType());
        this.withMachinesV1beta1MachineOpenshiftIo(instance.getMachinesV1beta1MachineOpenshiftIo());
        this.withMachineType(instance.getMachineType());
        this.withMachinesV1beta1MachineOpenshiftIo(instance.getMachinesV1beta1MachineOpenshiftIo());
        this.withAdditionalProperties(instance.getAdditionalProperties());
      }
  }
  
  public String getMachineType() {
    return this.machineType;
  }
  
  public A withMachineType(String machineType) {
    this.machineType=machineType; return (A) this;
  }
  
  public boolean hasMachineType() {
    return this.machineType != null;
  }
  
  public OpenShiftMachineV1Beta1MachineTemplate buildMachinesV1beta1MachineOpenshiftIo() {
    return this.machinesV1beta1MachineOpenshiftIo!=null ?this.machinesV1beta1MachineOpenshiftIo.build():null;
  }
  
  public A withMachinesV1beta1MachineOpenshiftIo(OpenShiftMachineV1Beta1MachineTemplate machinesV1beta1MachineOpenshiftIo) {
    _visitables.get("machinesV1beta1MachineOpenshiftIo").remove(this.machinesV1beta1MachineOpenshiftIo);
    if (machinesV1beta1MachineOpenshiftIo!=null){ this.machinesV1beta1MachineOpenshiftIo= new OpenShiftMachineV1Beta1MachineTemplateBuilder(machinesV1beta1MachineOpenshiftIo); _visitables.get("machinesV1beta1MachineOpenshiftIo").add(this.machinesV1beta1MachineOpenshiftIo);} else { this.machinesV1beta1MachineOpenshiftIo = null; _visitables.get("machinesV1beta1MachineOpenshiftIo").remove(this.machinesV1beta1MachineOpenshiftIo); } return (A) this;
  }
  
  public boolean hasMachinesV1beta1MachineOpenshiftIo() {
    return this.machinesV1beta1MachineOpenshiftIo != null;
  }
  
  public MachinesV1beta1MachineOpenshiftIoNested withNewMachinesV1beta1MachineOpenshiftIo() {
    return new MachinesV1beta1MachineOpenshiftIoNested(null);
  }
  
  public MachinesV1beta1MachineOpenshiftIoNested withNewMachinesV1beta1MachineOpenshiftIoLike(OpenShiftMachineV1Beta1MachineTemplate item) {
    return new MachinesV1beta1MachineOpenshiftIoNested(item);
  }
  
  public MachinesV1beta1MachineOpenshiftIoNested editMachinesV1beta1MachineOpenshiftIo() {
    return withNewMachinesV1beta1MachineOpenshiftIoLike(java.util.Optional.ofNullable(buildMachinesV1beta1MachineOpenshiftIo()).orElse(null));
  }
  
  public MachinesV1beta1MachineOpenshiftIoNested editOrNewMachinesV1beta1MachineOpenshiftIo() {
    return withNewMachinesV1beta1MachineOpenshiftIoLike(java.util.Optional.ofNullable(buildMachinesV1beta1MachineOpenshiftIo()).orElse(new OpenShiftMachineV1Beta1MachineTemplateBuilder().build()));
  }
  
  public MachinesV1beta1MachineOpenshiftIoNested editOrNewMachinesV1beta1MachineOpenshiftIoLike(OpenShiftMachineV1Beta1MachineTemplate item) {
    return withNewMachinesV1beta1MachineOpenshiftIoLike(java.util.Optional.ofNullable(buildMachinesV1beta1MachineOpenshiftIo()).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;
    ControlPlaneMachineSetTemplateFluent that = (ControlPlaneMachineSetTemplateFluent) o;
    if (!java.util.Objects.equals(machineType, that.machineType)) return false;
  
    if (!java.util.Objects.equals(machinesV1beta1MachineOpenshiftIo, that.machinesV1beta1MachineOpenshiftIo)) return false;
  
    if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
  
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(machineType,  machinesV1beta1MachineOpenshiftIo,  additionalProperties,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (machineType != null) { sb.append("machineType:"); sb.append(machineType + ","); }
    if (machinesV1beta1MachineOpenshiftIo != null) { sb.append("machinesV1beta1MachineOpenshiftIo:"); sb.append(machinesV1beta1MachineOpenshiftIo + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  public class MachinesV1beta1MachineOpenshiftIoNested extends OpenShiftMachineV1Beta1MachineTemplateFluent> implements Nested{
    MachinesV1beta1MachineOpenshiftIoNested(OpenShiftMachineV1Beta1MachineTemplate item) {
      this.builder = new OpenShiftMachineV1Beta1MachineTemplateBuilder(this, item);
    }
    OpenShiftMachineV1Beta1MachineTemplateBuilder builder;
    
    public N and() {
      return (N) ControlPlaneMachineSetTemplateFluent.this.withMachinesV1beta1MachineOpenshiftIo(builder.build());
    }
    
    public N endMachinesV1beta1MachineOpenshiftIo() {
      return and();
    }
    
  
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy