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

io.alauda.kubernetes.api.model.FCVolumeSourceFluentImpl 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 java.util.ArrayList;
import java.lang.String;
import io.alauda.kubernetes.api.builder.Predicate;
import java.lang.Integer;
import javax.validation.Valid;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;

public class FCVolumeSourceFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements FCVolumeSourceFluent{

    private String fsType;
    private Integer lun;
    private Boolean readOnly;
    private List targetWWNs = new ArrayList();

    public FCVolumeSourceFluentImpl(){
    }
    public FCVolumeSourceFluentImpl(FCVolumeSource instance){
            this.withFsType(instance.getFsType()); 
            this.withLun(instance.getLun()); 
            this.withReadOnly(instance.getReadOnly()); 
            this.withTargetWWNs(instance.getTargetWWNs()); 
    }

    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 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 addToTargetWWNs(int index,String item){
            this.targetWWNs.add(index, item); return (A)this;
    }

    public A setToTargetWWNs(int index,String item){
            this.targetWWNs.set(index, item); return (A)this;
    }

    public A addToTargetWWNs(String... items){
            for (String item : items) {this.targetWWNs.add(item);} return (A)this;
    }

    public A addAllToTargetWWNs(Collection items){
            for (String item : items) {this.targetWWNs.add(item);} return (A)this;
    }

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

    public A removeAllFromTargetWWNs(Collection items){
            for (String item : items) {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.alauda.kubernetes.api.builder.Predicate predicate){
            for (String item: targetWWNs) { if(predicate.apply(item)){return item;} } return null;
    }

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

    public A withTargetWWNs(String... targetWWNs){
            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 boolean equals(Object o){
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            if (!super.equals(o)) return false;
            FCVolumeSourceFluentImpl that = (FCVolumeSourceFluentImpl) 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;
            return true;
    }




}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy