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

io.kubernetes.client.openapi.models.V1FCVolumeSourceFluentImpl Maven / Gradle / Ivy

There is a newer version: 22.0.0
Show newest version
package io.kubernetes.client.openapi.models;

import java.lang.StringBuilder;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.lang.String;
import io.kubernetes.client.fluent.Predicate;
import java.lang.Integer;
import java.lang.StringBuffer;
import io.kubernetes.client.fluent.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;

public class V1FCVolumeSourceFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1FCVolumeSourceFluent {

    private String fsType;
    private Integer lun;
    private Boolean readOnly;
    private List targetWWNs;
    private List wwids;

    public V1FCVolumeSourceFluentImpl() { 
    }


    public V1FCVolumeSourceFluentImpl(V1FCVolumeSource instance) { 
        this.withFsType(instance.getFsType());

        this.withLun(instance.getLun());

        this.withReadOnly(instance.getReadOnly());

        this.withTargetWWNs(instance.getTargetWWNs());

        this.withWwids(instance.getWwids());

    }


    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 withNewFsType(String arg1) {
        return (A)withFsType(new String(arg1));
    }

    public A withNewFsType(StringBuilder arg1) {
        return (A)withFsType(new String(arg1));
    }

    public A withNewFsType(StringBuffer arg1) {
        return (A)withFsType(new String(arg1));
    }

    public Integer getLun() {
        return this.lun;
    }

    public A withLun(Integer lun) {
        this.lun=lun; return (A) this;
    }

    public Boolean hasLun() {
        return this.lun != 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;
    }

    public A withNewReadOnly(String arg1) {
        return (A)withReadOnly(new Boolean(arg1));
    }

    public A withNewReadOnly(boolean arg1) {
        return (A)withReadOnly(new Boolean(arg1));
    }

    public A addToTargetWWNs(int index,String item) {
        if (this.targetWWNs == null) {this.targetWWNs = new ArrayList();}
        this.targetWWNs.add(index, item);
        return (A)this;
    }

    public A setToTargetWWNs(int index,String item) {
        if (this.targetWWNs == null) {this.targetWWNs = new ArrayList();}
        this.targetWWNs.set(index, item); return (A)this;
    }

    public A addToTargetWWNs(String... items) {
        if (this.targetWWNs == null) {this.targetWWNs = new ArrayList();}
        for (String item : items) {this.targetWWNs.add(item);} return (A)this;
    }

    public A addAllToTargetWWNs(Collection items) {
        if (this.targetWWNs == null) {this.targetWWNs = new ArrayList();}
        for (String item : items) {this.targetWWNs.add(item);} return (A)this;
    }

    public A removeFromTargetWWNs(String... items) {
        for (String item : items) {if (this.targetWWNs!= null){ this.targetWWNs.remove(item);}} return (A)this;
    }

    public A removeAllFromTargetWWNs(Collection items) {
        for (String item : items) {if (this.targetWWNs!= null){ this.targetWWNs.remove(item);}} return (A)this;
    }

    public List getTargetWWNs() {
        return this.targetWWNs;
    }

    public String getTargetWWN(int index) {
        return this.targetWWNs.get(index);
    }

    public String getFirstTargetWWN() {
        return this.targetWWNs.get(0);
    }

    public String getLastTargetWWN() {
        return this.targetWWNs.get(targetWWNs.size() - 1);
    }

    public String getMatchingTargetWWN(io.kubernetes.client.fluent.Predicate predicate) {
        for (String item: targetWWNs) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingTargetWWN(io.kubernetes.client.fluent.Predicate predicate) {
        for (String item: targetWWNs) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withTargetWWNs(List targetWWNs) {
        if (this.targetWWNs != null) { _visitables.get("targetWWNs").removeAll(this.targetWWNs);}
        if (targetWWNs != null) {this.targetWWNs = new ArrayList(); for (String item : targetWWNs){this.addToTargetWWNs(item);}} else { this.targetWWNs = null;} return (A) this;
    }

    public A withTargetWWNs(String... targetWWNs) {
        if (this.targetWWNs != null) {this.targetWWNs.clear();}
        if (targetWWNs != null) {for (String item :targetWWNs){ this.addToTargetWWNs(item);}} return (A) this;
    }

    public Boolean hasTargetWWNs() {
        return targetWWNs != null && !targetWWNs.isEmpty();
    }

    public A addNewTargetWWN(String arg1) {
        return (A)addToTargetWWNs(new String(arg1));
    }

    public A addNewTargetWWN(StringBuilder arg1) {
        return (A)addToTargetWWNs(new String(arg1));
    }

    public A addNewTargetWWN(StringBuffer arg1) {
        return (A)addToTargetWWNs(new String(arg1));
    }

    public A addToWwids(int index,String item) {
        if (this.wwids == null) {this.wwids = new ArrayList();}
        this.wwids.add(index, item);
        return (A)this;
    }

    public A setToWwids(int index,String item) {
        if (this.wwids == null) {this.wwids = new ArrayList();}
        this.wwids.set(index, item); return (A)this;
    }

    public A addToWwids(String... items) {
        if (this.wwids == null) {this.wwids = new ArrayList();}
        for (String item : items) {this.wwids.add(item);} return (A)this;
    }

    public A addAllToWwids(Collection items) {
        if (this.wwids == null) {this.wwids = new ArrayList();}
        for (String item : items) {this.wwids.add(item);} return (A)this;
    }

    public A removeFromWwids(String... items) {
        for (String item : items) {if (this.wwids!= null){ this.wwids.remove(item);}} return (A)this;
    }

    public A removeAllFromWwids(Collection items) {
        for (String item : items) {if (this.wwids!= null){ this.wwids.remove(item);}} return (A)this;
    }

    public List getWwids() {
        return this.wwids;
    }

    public String getWwid(int index) {
        return this.wwids.get(index);
    }

    public String getFirstWwid() {
        return this.wwids.get(0);
    }

    public String getLastWwid() {
        return this.wwids.get(wwids.size() - 1);
    }

    public String getMatchingWwid(io.kubernetes.client.fluent.Predicate predicate) {
        for (String item: wwids) { if(predicate.apply(item)){ return item;} } return null;
    }

    public Boolean hasMatchingWwid(io.kubernetes.client.fluent.Predicate predicate) {
        for (String item: wwids) { if(predicate.apply(item)){ return true;} } return false;
    }

    public A withWwids(List wwids) {
        if (this.wwids != null) { _visitables.get("wwids").removeAll(this.wwids);}
        if (wwids != null) {this.wwids = new ArrayList(); for (String item : wwids){this.addToWwids(item);}} else { this.wwids = null;} return (A) this;
    }

    public A withWwids(String... wwids) {
        if (this.wwids != null) {this.wwids.clear();}
        if (wwids != null) {for (String item :wwids){ this.addToWwids(item);}} return (A) this;
    }

    public Boolean hasWwids() {
        return wwids != null && !wwids.isEmpty();
    }

    public A addNewWwid(String arg1) {
        return (A)addToWwids(new String(arg1));
    }

    public A addNewWwid(StringBuilder arg1) {
        return (A)addToWwids(new String(arg1));
    }

    public A addNewWwid(StringBuffer arg1) {
        return (A)addToWwids(new String(arg1));
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        V1FCVolumeSourceFluentImpl that = (V1FCVolumeSourceFluentImpl) o;
        if (fsType != null ? !fsType.equals(that.fsType) :that.fsType != null) return false;
        if (lun != null ? !lun.equals(that.lun) :that.lun != null) return false;
        if (readOnly != null ? !readOnly.equals(that.readOnly) :that.readOnly != null) return false;
        if (targetWWNs != null ? !targetWWNs.equals(that.targetWWNs) :that.targetWWNs != null) return false;
        if (wwids != null ? !wwids.equals(that.wwids) :that.wwids != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(fsType,  lun,  readOnly,  targetWWNs,  wwids,  super.hashCode());
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy