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

io.fabric8.openshift.api.model.installer.gcp.v1.OSDiskFluentImpl Maven / Gradle / Ivy

package io.fabric8.openshift.api.model.installer.gcp.v1;

import java.lang.SuppressWarnings;
import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Long;
import java.lang.Object;
import java.lang.Boolean;
import java.util.Map;

 /**
  * Generated
  */
  @SuppressWarnings(value = "unchecked")
  public class OSDiskFluentImpl> extends BaseFluent implements OSDiskFluent{
  public OSDiskFluentImpl() {
  }
  public OSDiskFluentImpl(OSDisk instance) {
    if (instance != null) {
      this.withDiskSizeGB(instance.getDiskSizeGB());
      this.withDiskType(instance.getDiskType());
      this.withEncryptionKey(instance.getEncryptionKey());
      this.withAdditionalProperties(instance.getAdditionalProperties());
    }
  }
  private Long diskSizeGB;
  private String diskType;
  private EncryptionKeyReferenceBuilder encryptionKey;
  private Map additionalProperties;
  public Long getDiskSizeGB() {
    return this.diskSizeGB;
  }
  public A withDiskSizeGB(Long diskSizeGB) {
    this.diskSizeGB=diskSizeGB; return (A) this;
  }
  public Boolean hasDiskSizeGB() {
    return this.diskSizeGB != null;
  }
  public String getDiskType() {
    return this.diskType;
  }
  public A withDiskType(String diskType) {
    this.diskType=diskType; return (A) this;
  }
  public Boolean hasDiskType() {
    return this.diskType != null;
  }
  
  /**
   * This method has been deprecated, please use method buildEncryptionKey instead.
   * @return The buildable object.
   */
  @Deprecated
  public EncryptionKeyReference getEncryptionKey() {
    return this.encryptionKey!=null ?this.encryptionKey.build():null;
  }
  public EncryptionKeyReference buildEncryptionKey() {
    return this.encryptionKey!=null ?this.encryptionKey.build():null;
  }
  public A withEncryptionKey(EncryptionKeyReference encryptionKey) {
    _visitables.get("encryptionKey").remove(this.encryptionKey);
    if (encryptionKey!=null){ this.encryptionKey= new EncryptionKeyReferenceBuilder(encryptionKey); _visitables.get("encryptionKey").add(this.encryptionKey);} else { this.encryptionKey = null; _visitables.get("encryptionKey").remove(this.encryptionKey); } return (A) this;
  }
  public Boolean hasEncryptionKey() {
    return this.encryptionKey != null;
  }
  public OSDiskFluentImpl.EncryptionKeyNested withNewEncryptionKey() {
    return new OSDiskFluentImpl.EncryptionKeyNestedImpl();
  }
  public OSDiskFluentImpl.EncryptionKeyNested withNewEncryptionKeyLike(EncryptionKeyReference item) {
    return new OSDiskFluentImpl.EncryptionKeyNestedImpl(item);
  }
  public OSDiskFluentImpl.EncryptionKeyNested editEncryptionKey() {
    return withNewEncryptionKeyLike(getEncryptionKey());
  }
  public OSDiskFluentImpl.EncryptionKeyNested editOrNewEncryptionKey() {
    return withNewEncryptionKeyLike(getEncryptionKey() != null ? getEncryptionKey(): new EncryptionKeyReferenceBuilder().build());
  }
  public OSDiskFluentImpl.EncryptionKeyNested editOrNewEncryptionKeyLike(EncryptionKeyReference item) {
    return withNewEncryptionKeyLike(getEncryptionKey() != null ? getEncryptionKey(): 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;
    OSDiskFluentImpl that = (OSDiskFluentImpl) o;
    if (!java.util.Objects.equals(diskSizeGB, that.diskSizeGB)) return false;

    if (!java.util.Objects.equals(diskType, that.diskType)) return false;

    if (!java.util.Objects.equals(encryptionKey, that.encryptionKey)) return false;

    if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;

    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(diskSizeGB,  diskType,  encryptionKey,  additionalProperties,  super.hashCode());
  }
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (diskSizeGB != null) { sb.append("diskSizeGB:"); sb.append(diskSizeGB + ","); }
    if (diskType != null) { sb.append("diskType:"); sb.append(diskType + ","); }
    if (encryptionKey != null) { sb.append("encryptionKey:"); sb.append(encryptionKey + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  class EncryptionKeyNestedImpl extends EncryptionKeyReferenceFluentImpl> implements OSDiskFluentImpl.EncryptionKeyNested,Nested{
    EncryptionKeyNestedImpl(EncryptionKeyReference item) {
      this.builder = new EncryptionKeyReferenceBuilder(this, item);
    }
    EncryptionKeyNestedImpl() {
      this.builder = new EncryptionKeyReferenceBuilder(this);
    }
    EncryptionKeyReferenceBuilder builder;
    public N and() {
      return (N) OSDiskFluentImpl.this.withEncryptionKey(builder.build());
    }
    public N endEncryptionKey() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy