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

io.fabric8.openshift.api.model.CustomDeploymentStrategyParamsFluent Maven / Gradle / Ivy

package io.fabric8.openshift.api.model;

import java.util.HashMap;
import java.util.Map;
import io.fabric8.kubernetes.api.model.EnvVar;
import java.util.List;
import java.util.ArrayList;
import io.fabric8.common.Nested;
import io.fabric8.kubernetes.api.model.EnvVarFluent;
import io.fabric8.common.Fluent;
import io.fabric8.kubernetes.api.model.EnvVarBuilder;

public class CustomDeploymentStrategyParamsFluent> implements Fluent{

    private List command  = new ArrayList();
    private List environment  = new ArrayList();
    private String image ;
    private Map additionalProperties  = new HashMap();

    public List getCommand(){
    return this.command;
    }
    public T withCommand(List command){
    this.command.clear();if (command != null) {this.command.addAll(command);} return (T) this;
    }
    public List getEnvironment(){
    return this.environment;
    }
    public T withEnvironment(List environment){
    this.environment.clear();if (environment != null) {this.environment.addAll(environment);} return (T) this;
    }
    public String getImage(){
    return this.image;
    }
    public T withImage(String image){
    this.image=image; return (T) this;
    }
    public Map getAdditionalProperties(){
    return this.additionalProperties;
    }
    public T withAdditionalProperties(Map additionalProperties){
    this.additionalProperties.clear();if (additionalProperties != null) {this.additionalProperties.putAll(additionalProperties);} return (T) this;
    }
    public T addToCommand(String item){
    if (item != null) {this.command.add(item);} return (T)this;
    }
    public T addToEnvironment(EnvVar item){
    if (item != null) {this.environment.add(item);} return (T)this;
    }
    public EnvironmentNested addNewEnvironment(){
    return new EnvironmentNested();
    }
    public T addNewEnvironment(String name, String value){
    return addToEnvironment(new EnvVar(name, value));
    }
    public T addToAdditionalProperties(String key, Object value){
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (T)this;
    }

    public class EnvironmentNested extends EnvVarFluent> implements Nested{

        private final EnvVarBuilder builder = new EnvVarBuilder(this);
    
            public N endEnvironment(){
            return and();
        }
            public N and(){
            return (N) CustomDeploymentStrategyParamsFluent.this.addToEnvironment(builder.build());
        }
    
}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy