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

me.snowdrop.istio.mixer.template.quota.QuotaSpecFluentImpl Maven / Gradle / Ivy

package me.snowdrop.istio.mixer.template.quota;

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

public class QuotaSpecFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements QuotaSpecFluent{

    private Map dimensions;
    private String name;

    public QuotaSpecFluentImpl(){
    }
    public QuotaSpecFluentImpl(QuotaSpec instance){
            this.withDimensions(instance.getDimensions()); 
            this.withName(instance.getName()); 
    }

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

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

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

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

    public Map getDimensions(){
            return this.dimensions;
    }

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

    public Boolean hasDimensions(){
            return this.dimensions != null;
    }

    public String getName(){
            return this.name;
    }

    public A withName(String name){
            this.name=name; return (A) this;
    }

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




}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy