io.kubernetes.client.openapi.models.V1APIServiceSpecFluentImpl Maven / Gradle / Ivy
package io.kubernetes.client.openapi.models;
import java.lang.StringBuilder;
import com.google.gson.annotations.SerializedName;
import io.kubernetes.client.fluent.Nested;
import java.lang.String;
import java.lang.Integer;
import java.lang.StringBuffer;
import java.lang.Deprecated;
import java.lang.Byte;
import io.kubernetes.client.fluent.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
public class V1APIServiceSpecFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1APIServiceSpecFluent {
private List caBundle;
private String group;
private Integer groupPriorityMinimum;
private Boolean insecureSkipTLSVerify;
private ApiregistrationV1ServiceReferenceBuilder service;
private String version;
private Integer versionPriority;
public V1APIServiceSpecFluentImpl() {
}
public V1APIServiceSpecFluentImpl(V1APIServiceSpec instance) {
this.withCaBundle(instance.getCaBundle());
this.withGroup(instance.getGroup());
this.withGroupPriorityMinimum(instance.getGroupPriorityMinimum());
this.withInsecureSkipTLSVerify(instance.getInsecureSkipTLSVerify());
this.withService(instance.getService());
this.withVersion(instance.getVersion());
this.withVersionPriority(instance.getVersionPriority());
}
public A withCaBundle(byte... caBundle) {
if (this.caBundle != null) {this.caBundle.clear();}
if (caBundle != null) {for (byte item :caBundle){ this.addToCaBundle(item);}} return (A) this;
}
public byte[] getCaBundle() {
//This needs to work with primitives, so we use arrays.
int size = caBundle != null ? caBundle.size() : 0;
byte[] result = new byte[size];
if (size == 0) {
return result;
}
int index = 0;
for (byte item : caBundle) {
result[index++]=item;
}
return result;
}
public A addToCaBundle(int index,Byte item) {
if (this.caBundle == null) {this.caBundle = null;}
this.caBundle.add(index, item);
return (A)this;
}
public A setToCaBundle(int index,Byte item) {
if (this.caBundle == null) {this.caBundle = null;}
this.caBundle.set(index, item); return (A)this;
}
public A addToCaBundle(Byte... items) {
if (this.caBundle == null) {this.caBundle = null;}
for (Byte item : items) {this.caBundle.add(item);} return (A)this;
}
public A addAllToCaBundle(Collection items) {
if (this.caBundle == null) {this.caBundle = null;}
for (Byte item : items) {this.caBundle.add(item);} return (A)this;
}
public A removeFromCaBundle(Byte... items) {
for (Byte item : items) {if (this.caBundle!= null){ this.caBundle.remove(item);}} return (A)this;
}
public A removeAllFromCaBundle(Collection items) {
for (Byte item : items) {if (this.caBundle!= null){ this.caBundle.remove(item);}} return (A)this;
}
public Boolean hasCaBundle() {
return caBundle != null && !caBundle.isEmpty();
}
public A addNewCaBundle(String arg1) {
return (A)addToCaBundle(new Byte(arg1));
}
public A addNewCaBundle(byte arg1) {
return (A)addToCaBundle(new Byte(arg1));
}
public String getGroup() {
return this.group;
}
public A withGroup(String group) {
this.group=group; return (A) this;
}
public Boolean hasGroup() {
return this.group != null;
}
public A withNewGroup(String arg1) {
return (A)withGroup(new String(arg1));
}
public A withNewGroup(StringBuilder arg1) {
return (A)withGroup(new String(arg1));
}
public A withNewGroup(StringBuffer arg1) {
return (A)withGroup(new String(arg1));
}
public Integer getGroupPriorityMinimum() {
return this.groupPriorityMinimum;
}
public A withGroupPriorityMinimum(Integer groupPriorityMinimum) {
this.groupPriorityMinimum=groupPriorityMinimum; return (A) this;
}
public Boolean hasGroupPriorityMinimum() {
return this.groupPriorityMinimum != null;
}
public Boolean isInsecureSkipTLSVerify() {
return this.insecureSkipTLSVerify;
}
public A withInsecureSkipTLSVerify(Boolean insecureSkipTLSVerify) {
this.insecureSkipTLSVerify=insecureSkipTLSVerify; return (A) this;
}
public Boolean hasInsecureSkipTLSVerify() {
return this.insecureSkipTLSVerify != null;
}
public A withNewInsecureSkipTLSVerify(String arg1) {
return (A)withInsecureSkipTLSVerify(new Boolean(arg1));
}
public A withNewInsecureSkipTLSVerify(boolean arg1) {
return (A)withInsecureSkipTLSVerify(new Boolean(arg1));
}
/**
* This method has been deprecated, please use method buildService instead.
* @return The buildable object.
*/
@Deprecated public ApiregistrationV1ServiceReference getService() {
return this.service!=null?this.service.build():null;
}
public ApiregistrationV1ServiceReference buildService() {
return this.service!=null?this.service.build():null;
}
public A withService(ApiregistrationV1ServiceReference service) {
_visitables.get("service").remove(this.service);
if (service!=null){ this.service= new ApiregistrationV1ServiceReferenceBuilder(service); _visitables.get("service").add(this.service);} return (A) this;
}
public Boolean hasService() {
return this.service != null;
}
public V1APIServiceSpecFluent.ServiceNested withNewService() {
return new ServiceNestedImpl();
}
public V1APIServiceSpecFluent.ServiceNested withNewServiceLike(ApiregistrationV1ServiceReference item) {
return new ServiceNestedImpl(item);
}
public V1APIServiceSpecFluent.ServiceNested editService() {
return withNewServiceLike(getService());
}
public V1APIServiceSpecFluent.ServiceNested editOrNewService() {
return withNewServiceLike(getService() != null ? getService(): new ApiregistrationV1ServiceReferenceBuilder().build());
}
public V1APIServiceSpecFluent.ServiceNested editOrNewServiceLike(ApiregistrationV1ServiceReference item) {
return withNewServiceLike(getService() != null ? getService(): item);
}
public String getVersion() {
return this.version;
}
public A withVersion(String version) {
this.version=version; return (A) this;
}
public Boolean hasVersion() {
return this.version != null;
}
public A withNewVersion(String arg1) {
return (A)withVersion(new String(arg1));
}
public A withNewVersion(StringBuilder arg1) {
return (A)withVersion(new String(arg1));
}
public A withNewVersion(StringBuffer arg1) {
return (A)withVersion(new String(arg1));
}
public Integer getVersionPriority() {
return this.versionPriority;
}
public A withVersionPriority(Integer versionPriority) {
this.versionPriority=versionPriority; return (A) this;
}
public Boolean hasVersionPriority() {
return this.versionPriority != null;
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
V1APIServiceSpecFluentImpl that = (V1APIServiceSpecFluentImpl) o;
if (caBundle != null ? !caBundle.equals(that.caBundle) :that.caBundle != null) return false;
if (group != null ? !group.equals(that.group) :that.group != null) return false;
if (groupPriorityMinimum != null ? !groupPriorityMinimum.equals(that.groupPriorityMinimum) :that.groupPriorityMinimum != null) return false;
if (insecureSkipTLSVerify != null ? !insecureSkipTLSVerify.equals(that.insecureSkipTLSVerify) :that.insecureSkipTLSVerify != null) return false;
if (service != null ? !service.equals(that.service) :that.service != null) return false;
if (version != null ? !version.equals(that.version) :that.version != null) return false;
if (versionPriority != null ? !versionPriority.equals(that.versionPriority) :that.versionPriority != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(caBundle, group, groupPriorityMinimum, insecureSkipTLSVerify, service, version, versionPriority, super.hashCode());
}
public class ServiceNestedImpl extends ApiregistrationV1ServiceReferenceFluentImpl> implements V1APIServiceSpecFluent.ServiceNested,io.kubernetes.client.fluent.Nested {
private final ApiregistrationV1ServiceReferenceBuilder builder;
ServiceNestedImpl(ApiregistrationV1ServiceReference item) {
this.builder = new ApiregistrationV1ServiceReferenceBuilder(this, item);
}
ServiceNestedImpl() {
this.builder = new ApiregistrationV1ServiceReferenceBuilder(this);
}
public N and() {
return (N) V1APIServiceSpecFluentImpl.this.withService(builder.build());
}
public N endService() {
return and();
}
}
}