annotations.io.alauda.kubernetes.api.model.CodeRepoServiceSpecFluentImpl Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.alauda.kubernetes.api.builder.Nested;
import java.lang.String;
import java.util.LinkedHashMap;
import java.lang.Deprecated;
import javax.validation.Valid;
import io.alauda.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;
import java.util.Map;
public class CodeRepoServiceSpecFluentImpl> extends io.alauda.kubernetes.api.builder.BaseFluent implements CodeRepoServiceSpecFluent{
private Map data = new LinkedHashMap();
private HostPortBuilder http;
private Boolean _public;
private String type;
public CodeRepoServiceSpecFluentImpl(){
}
public CodeRepoServiceSpecFluentImpl(CodeRepoServiceSpec instance){
this.withData(instance.getData());
this.withHttp(instance.getHttp());
this.withPublic(instance.getPublic());
this.withType(instance.getType());
}
public A addToData(String key,String value){
if(key != null && value != null) {this.data.put(key, value);} return (A)this;
}
public A addToData(Map map){
if(map != null) { this.data.putAll(map);} return (A)this;
}
public A removeFromData(String key){
if(key != null) {this.data.remove(key);} return (A)this;
}
public A removeFromData(Map map){
if(map != null) { for(Object key : map.keySet()) {this.data.remove(key);}} return (A)this;
}
public Map getData(){
return this.data;
}
public A withData(Map data){
this.data.clear();
if (data != null) {this.data.putAll(data);} return (A) this;
}
public Boolean hasData(){
return this.data!=null;
}
/**
* This method has been deprecated, please use method buildHttp instead.
*/
@Deprecated public HostPort getHttp(){
return this.http!=null?this.http.build():null;
}
public HostPort buildHttp(){
return this.http!=null?this.http.build():null;
}
public A withHttp(HostPort http){
_visitables.remove(this.http);
if (http!=null){ this.http= new HostPortBuilder(http); _visitables.add(this.http);} return (A) this;
}
public Boolean hasHttp(){
return this.http!=null;
}
public CodeRepoServiceSpecFluent.HttpNested withNewHttp(){
return new HttpNestedImpl();
}
public CodeRepoServiceSpecFluent.HttpNested withNewHttpLike(HostPort item){
return new HttpNestedImpl(item);
}
public CodeRepoServiceSpecFluent.HttpNested editHttp(){
return withNewHttpLike(getHttp());
}
public CodeRepoServiceSpecFluent.HttpNested editOrNewHttp(){
return withNewHttpLike(getHttp() != null ? getHttp(): new HostPortBuilder().build());
}
public CodeRepoServiceSpecFluent.HttpNested editOrNewHttpLike(HostPort item){
return withNewHttpLike(getHttp() != null ? getHttp(): item);
}
public A withNewHttp(String host){
return (A)withHttp(new HostPort(host));
}
public Boolean isPublic(){
return this._public;
}
public A withPublic(Boolean _public){
this._public=_public; return (A) this;
}
public Boolean hasPublic(){
return this._public!=null;
}
public String getType(){
return this.type;
}
public A withType(String type){
this.type=type; return (A) this;
}
public Boolean hasType(){
return this.type!=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;
CodeRepoServiceSpecFluentImpl that = (CodeRepoServiceSpecFluentImpl) o;
if (data != null ? !data.equals(that.data) :that.data != null) return false;
if (http != null ? !http.equals(that.http) :that.http != null) return false;
if (_public != null ? !_public.equals(that._public) :that._public != null) return false;
if (type != null ? !type.equals(that.type) :that.type != null) return false;
return true;
}
public class HttpNestedImpl extends HostPortFluentImpl> implements CodeRepoServiceSpecFluent.HttpNested,io.alauda.kubernetes.api.builder.Nested{
private final HostPortBuilder builder;
HttpNestedImpl(HostPort item){
this.builder = new HostPortBuilder(this, item);
}
HttpNestedImpl(){
this.builder = new HostPortBuilder(this);
}
public N and(){
return (N) CodeRepoServiceSpecFluentImpl.this.withHttp(builder.build());
}
public N endHttp(){
return and();
}
}
}