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

me.snowdrop.istio.api.rbac.v1alpha1.WorkloadSelectorFluentImpl Maven / Gradle / Ivy

package me.snowdrop.istio.api.rbac.v1alpha1;

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

public class WorkloadSelectorFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements me.snowdrop.istio.api.rbac.v1alpha1.WorkloadSelectorFluent{

    private Map labels;

    public WorkloadSelectorFluentImpl(){
    }
    public WorkloadSelectorFluentImpl(me.snowdrop.istio.api.rbac.v1alpha1.WorkloadSelector instance){
            this.withLabels(instance.getLabels()); 
    }

    public A addToLabels(String key,String value){
            if(this.labels == null && key != null && value != null) { this.labels = new LinkedHashMap(); }
            if(key != null && value != null) {this.labels.put(key, value);} return (A)this;
    }

    public A addToLabels(Map map){
            if(this.labels == null && map != null) { this.labels = new LinkedHashMap(); }
            if(map != null) { this.labels.putAll(map);} return (A)this;
    }

    public A removeFromLabels(String key){
            if(this.labels == null) { return (A) this; }
            if(key != null && this.labels != null) {this.labels.remove(key);} return (A)this;
    }

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

    public Map getLabels(){
            return this.labels;
    }

    public A withLabels(Map labels){
            if (labels == null) { this.labels =  null;} else {this.labels = new LinkedHashMap(labels);} return (A) this;
    }

    public Boolean hasLabels(){
            return this.labels != 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;
            WorkloadSelectorFluentImpl that = (WorkloadSelectorFluentImpl) o;
            if (labels != null ? !labels.equals(that.labels) :that.labels != null) return false;
            return true;
    }




}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy