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

io.alauda.kubernetes.api.model.ResourceRequirementsFluentImpl 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 javax.validation.Valid;
import io.alauda.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 ResourceRequirementsFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements ResourceRequirementsFluent{

    private Map limits = new LinkedHashMap();
    private Map requests = new LinkedHashMap();

    public ResourceRequirementsFluentImpl(){
    }
    public ResourceRequirementsFluentImpl(ResourceRequirements instance){
            this.withLimits(instance.getLimits()); 
            this.withRequests(instance.getRequests()); 
    }

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

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

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

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

    public Map getLimits(){
            return this.limits;
    }

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

    public Boolean hasLimits(){
            return this.limits!=null;
    }

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

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

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

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

    public Map getRequests(){
            return this.requests;
    }

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

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




}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy