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

io.fabric8.openshift.api.model.machine.v1.AWSFailureDomainFluent 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 AWSFailureDomainFluent> extends BaseFluent{
  public AWSFailureDomainFluent() {
  }
  
  public AWSFailureDomainFluent(AWSFailureDomain instance) {
    this.copyInstance(instance);
  }
  private AWSFailureDomainPlacementBuilder placement;
  private AWSResourceReferenceBuilder subnet;
  private Map additionalProperties;
  
  protected void copyInstance(AWSFailureDomain instance) {
    instance = (instance != null ? instance : new AWSFailureDomain());
  
    if (instance != null) {
        this.withPlacement(instance.getPlacement());
        this.withSubnet(instance.getSubnet());
        this.withPlacement(instance.getPlacement());
        this.withSubnet(instance.getSubnet());
        this.withAdditionalProperties(instance.getAdditionalProperties());
      }
  }
  
  public AWSFailureDomainPlacement buildPlacement() {
    return this.placement!=null ?this.placement.build():null;
  }
  
  public A withPlacement(AWSFailureDomainPlacement placement) {
    _visitables.get("placement").remove(this.placement);
    if (placement!=null){ this.placement= new AWSFailureDomainPlacementBuilder(placement); _visitables.get("placement").add(this.placement);} else { this.placement = null; _visitables.get("placement").remove(this.placement); } return (A) this;
  }
  
  public boolean hasPlacement() {
    return this.placement != null;
  }
  
  public A withNewPlacement(String availabilityZone) {
    return (A)withPlacement(new AWSFailureDomainPlacement(availabilityZone));
  }
  
  public PlacementNested withNewPlacement() {
    return new PlacementNested(null);
  }
  
  public PlacementNested withNewPlacementLike(AWSFailureDomainPlacement item) {
    return new PlacementNested(item);
  }
  
  public PlacementNested editPlacement() {
    return withNewPlacementLike(java.util.Optional.ofNullable(buildPlacement()).orElse(null));
  }
  
  public PlacementNested editOrNewPlacement() {
    return withNewPlacementLike(java.util.Optional.ofNullable(buildPlacement()).orElse(new AWSFailureDomainPlacementBuilder().build()));
  }
  
  public PlacementNested editOrNewPlacementLike(AWSFailureDomainPlacement item) {
    return withNewPlacementLike(java.util.Optional.ofNullable(buildPlacement()).orElse(item));
  }
  
  public AWSResourceReference buildSubnet() {
    return this.subnet!=null ?this.subnet.build():null;
  }
  
  public A withSubnet(AWSResourceReference subnet) {
    _visitables.get("subnet").remove(this.subnet);
    if (subnet!=null){ this.subnet= new AWSResourceReferenceBuilder(subnet); _visitables.get("subnet").add(this.subnet);} else { this.subnet = null; _visitables.get("subnet").remove(this.subnet); } return (A) this;
  }
  
  public boolean hasSubnet() {
    return this.subnet != null;
  }
  
  public SubnetNested withNewSubnet() {
    return new SubnetNested(null);
  }
  
  public SubnetNested withNewSubnetLike(AWSResourceReference item) {
    return new SubnetNested(item);
  }
  
  public SubnetNested editSubnet() {
    return withNewSubnetLike(java.util.Optional.ofNullable(buildSubnet()).orElse(null));
  }
  
  public SubnetNested editOrNewSubnet() {
    return withNewSubnetLike(java.util.Optional.ofNullable(buildSubnet()).orElse(new AWSResourceReferenceBuilder().build()));
  }
  
  public SubnetNested editOrNewSubnetLike(AWSResourceReference item) {
    return withNewSubnetLike(java.util.Optional.ofNullable(buildSubnet()).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;
    AWSFailureDomainFluent that = (AWSFailureDomainFluent) o;
    if (!java.util.Objects.equals(placement, that.placement)) return false;
  
    if (!java.util.Objects.equals(subnet, that.subnet)) return false;
  
    if (!java.util.Objects.equals(additionalProperties, that.additionalProperties)) return false;
  
    return true;
  }
  
  public int hashCode() {
    return java.util.Objects.hash(placement,  subnet,  additionalProperties,  super.hashCode());
  }
  
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("{");
    if (placement != null) { sb.append("placement:"); sb.append(placement + ","); }
    if (subnet != null) { sb.append("subnet:"); sb.append(subnet + ","); }
    if (additionalProperties != null && !additionalProperties.isEmpty()) { sb.append("additionalProperties:"); sb.append(additionalProperties); }
    sb.append("}");
    return sb.toString();
  }
  public class PlacementNested extends AWSFailureDomainPlacementFluent> implements Nested{
    PlacementNested(AWSFailureDomainPlacement item) {
      this.builder = new AWSFailureDomainPlacementBuilder(this, item);
    }
    AWSFailureDomainPlacementBuilder builder;
    
    public N and() {
      return (N) AWSFailureDomainFluent.this.withPlacement(builder.build());
    }
    
    public N endPlacement() {
      return and();
    }
    
  
  }
  public class SubnetNested extends AWSResourceReferenceFluent> implements Nested{
    SubnetNested(AWSResourceReference item) {
      this.builder = new AWSResourceReferenceBuilder(this, item);
    }
    AWSResourceReferenceBuilder builder;
    
    public N and() {
      return (N) AWSFailureDomainFluent.this.withSubnet(builder.build());
    }
    
    public N endSubnet() {
      return and();
    }
    
  
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy