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

io.alauda.kubernetes.api.model.FlexVolumeSourceFluentImpl Maven / Gradle / Ivy

There is a newer version: 0.2.12
Show newest version
package io.alauda.kubernetes.api.model;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import java.lang.Deprecated;
import javax.validation.Valid;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
import java.util.Map;

public class FlexVolumeSourceFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements FlexVolumeSourceFluent{

    private String driver;
    private String fsType;
    private Map options = new LinkedHashMap();
    private Boolean readOnly;
    private LocalObjectReferenceBuilder secretRef;

    public FlexVolumeSourceFluentImpl(){
    }
    public FlexVolumeSourceFluentImpl(FlexVolumeSource instance){
            this.withDriver(instance.getDriver()); 
            this.withFsType(instance.getFsType()); 
            this.withOptions(instance.getOptions()); 
            this.withReadOnly(instance.getReadOnly()); 
            this.withSecretRef(instance.getSecretRef()); 
    }

    public String getDriver(){
            return this.driver;
    }

    public A withDriver(String driver){
            this.driver=driver; return (A) this;
    }

    public Boolean hasDriver(){
            return this.driver!=null;
    }

    public String getFsType(){
            return this.fsType;
    }

    public A withFsType(String fsType){
            this.fsType=fsType; return (A) this;
    }

    public Boolean hasFsType(){
            return this.fsType!=null;
    }

    public A addToOptions(String key,String value){
            if(key != null && value != null) {this.options.put(key, value);} return (A)this;
    }

    public A addToOptions(Map map){
            if(map != null) { this.options.putAll(map);} return (A)this;
    }

    public A removeFromOptions(String key){
            if(key != null) {this.options.remove(key);} return (A)this;
    }

    public A removeFromOptions(Map map){
            if(map != null) { for(Object key : map.keySet()) {this.options.remove(key);}} return (A)this;
    }

    public Map getOptions(){
            return this.options;
    }

    public A withOptions(Map options){
            this.options.clear();
            if (options != null) {this.options.putAll(options);} return (A) this;
    }

    public Boolean hasOptions(){
            return this.options!=null;
    }

    public Boolean isReadOnly(){
            return this.readOnly;
    }

    public A withReadOnly(Boolean readOnly){
            this.readOnly=readOnly; return (A) this;
    }

    public Boolean hasReadOnly(){
            return this.readOnly!=null;
    }

    
/**
 * This method has been deprecated, please use method buildSecretRef instead.
 */
@Deprecated public LocalObjectReference getSecretRef(){
            return this.secretRef!=null?this.secretRef.build():null;
    }

    public LocalObjectReference buildSecretRef(){
            return this.secretRef!=null?this.secretRef.build():null;
    }

    public A withSecretRef(LocalObjectReference secretRef){
            _visitables.remove(this.secretRef);
            if (secretRef!=null){ this.secretRef= new LocalObjectReferenceBuilder(secretRef); _visitables.add(this.secretRef);} return (A) this;
    }

    public Boolean hasSecretRef(){
            return this.secretRef!=null;
    }

    public FlexVolumeSourceFluent.SecretRefNested withNewSecretRef(){
            return new SecretRefNestedImpl();
    }

    public FlexVolumeSourceFluent.SecretRefNested withNewSecretRefLike(LocalObjectReference item){
            return new SecretRefNestedImpl(item);
    }

    public FlexVolumeSourceFluent.SecretRefNested editSecretRef(){
            return withNewSecretRefLike(getSecretRef());
    }

    public FlexVolumeSourceFluent.SecretRefNested editOrNewSecretRef(){
            return withNewSecretRefLike(getSecretRef() != null ? getSecretRef(): new LocalObjectReferenceBuilder().build());
    }

    public FlexVolumeSourceFluent.SecretRefNested editOrNewSecretRefLike(LocalObjectReference item){
            return withNewSecretRefLike(getSecretRef() != null ? getSecretRef(): item);
    }

    public A withNewSecretRef(String name){
            return (A)withSecretRef(new LocalObjectReference(name));
    }

    public boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            FlexVolumeSourceFluentImpl that = (FlexVolumeSourceFluentImpl) o;
            if (driver != null ? !driver.equals(that.driver) :that.driver != null) return false;
            if (fsType != null ? !fsType.equals(that.fsType) :that.fsType != null) return false;
            if (options != null ? !options.equals(that.options) :that.options != null) return false;
            if (readOnly != null ? !readOnly.equals(that.readOnly) :that.readOnly != null) return false;
            if (secretRef != null ? !secretRef.equals(that.secretRef) :that.secretRef != null) return false;
            return true;
    }


    public class SecretRefNestedImpl extends LocalObjectReferenceFluentImpl> implements FlexVolumeSourceFluent.SecretRefNested,io.alauda.kubernetes.api.builder.Nested{

            private final LocalObjectReferenceBuilder builder;
    
            SecretRefNestedImpl(LocalObjectReference item){
                    this.builder = new LocalObjectReferenceBuilder(this, item);
            }
            SecretRefNestedImpl(){
                    this.builder = new LocalObjectReferenceBuilder(this);
            }
    
    public N and(){
            return (N) FlexVolumeSourceFluentImpl.this.withSecretRef(builder.build());
    }
    public N endSecretRef(){
            return and();
    }

}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy