io.kubernetes.client.openapi.models.V1alpha1ServerStorageVersionFluentImpl Maven / Gradle / Ivy
package io.kubernetes.client.openapi.models;
import java.lang.StringBuilder;
import com.google.gson.annotations.SerializedName;
import java.util.ArrayList;
import java.lang.String;
import io.kubernetes.client.fluent.Predicate;
import java.lang.StringBuffer;
import io.kubernetes.client.fluent.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
public class V1alpha1ServerStorageVersionFluentImpl> extends io.kubernetes.client.fluent.BaseFluent implements V1alpha1ServerStorageVersionFluent {
private String apiServerID;
private List decodableVersions;
private String encodingVersion;
public V1alpha1ServerStorageVersionFluentImpl() {
}
public V1alpha1ServerStorageVersionFluentImpl(V1alpha1ServerStorageVersion instance) {
this.withApiServerID(instance.getApiServerID());
this.withDecodableVersions(instance.getDecodableVersions());
this.withEncodingVersion(instance.getEncodingVersion());
}
public String getApiServerID() {
return this.apiServerID;
}
public A withApiServerID(String apiServerID) {
this.apiServerID=apiServerID; return (A) this;
}
public Boolean hasApiServerID() {
return this.apiServerID != null;
}
public A withNewApiServerID(String arg1) {
return (A)withApiServerID(new String(arg1));
}
public A withNewApiServerID(StringBuilder arg1) {
return (A)withApiServerID(new String(arg1));
}
public A withNewApiServerID(StringBuffer arg1) {
return (A)withApiServerID(new String(arg1));
}
public A addToDecodableVersions(int index,String item) {
if (this.decodableVersions == null) {this.decodableVersions = new ArrayList();}
this.decodableVersions.add(index, item);
return (A)this;
}
public A setToDecodableVersions(int index,String item) {
if (this.decodableVersions == null) {this.decodableVersions = new ArrayList();}
this.decodableVersions.set(index, item); return (A)this;
}
public A addToDecodableVersions(String... items) {
if (this.decodableVersions == null) {this.decodableVersions = new ArrayList();}
for (String item : items) {this.decodableVersions.add(item);} return (A)this;
}
public A addAllToDecodableVersions(Collection items) {
if (this.decodableVersions == null) {this.decodableVersions = new ArrayList();}
for (String item : items) {this.decodableVersions.add(item);} return (A)this;
}
public A removeFromDecodableVersions(String... items) {
for (String item : items) {if (this.decodableVersions!= null){ this.decodableVersions.remove(item);}} return (A)this;
}
public A removeAllFromDecodableVersions(Collection items) {
for (String item : items) {if (this.decodableVersions!= null){ this.decodableVersions.remove(item);}} return (A)this;
}
public List getDecodableVersions() {
return this.decodableVersions;
}
public String getDecodableVersion(int index) {
return this.decodableVersions.get(index);
}
public String getFirstDecodableVersion() {
return this.decodableVersions.get(0);
}
public String getLastDecodableVersion() {
return this.decodableVersions.get(decodableVersions.size() - 1);
}
public String getMatchingDecodableVersion(io.kubernetes.client.fluent.Predicate predicate) {
for (String item: decodableVersions) { if(predicate.apply(item)){ return item;} } return null;
}
public Boolean hasMatchingDecodableVersion(io.kubernetes.client.fluent.Predicate predicate) {
for (String item: decodableVersions) { if(predicate.apply(item)){ return true;} } return false;
}
public A withDecodableVersions(List decodableVersions) {
if (this.decodableVersions != null) { _visitables.get("decodableVersions").removeAll(this.decodableVersions);}
if (decodableVersions != null) {this.decodableVersions = new ArrayList(); for (String item : decodableVersions){this.addToDecodableVersions(item);}} else { this.decodableVersions = null;} return (A) this;
}
public A withDecodableVersions(String... decodableVersions) {
if (this.decodableVersions != null) {this.decodableVersions.clear();}
if (decodableVersions != null) {for (String item :decodableVersions){ this.addToDecodableVersions(item);}} return (A) this;
}
public Boolean hasDecodableVersions() {
return decodableVersions != null && !decodableVersions.isEmpty();
}
public A addNewDecodableVersion(String arg1) {
return (A)addToDecodableVersions(new String(arg1));
}
public A addNewDecodableVersion(StringBuilder arg1) {
return (A)addToDecodableVersions(new String(arg1));
}
public A addNewDecodableVersion(StringBuffer arg1) {
return (A)addToDecodableVersions(new String(arg1));
}
public String getEncodingVersion() {
return this.encodingVersion;
}
public A withEncodingVersion(String encodingVersion) {
this.encodingVersion=encodingVersion; return (A) this;
}
public Boolean hasEncodingVersion() {
return this.encodingVersion != null;
}
public A withNewEncodingVersion(String arg1) {
return (A)withEncodingVersion(new String(arg1));
}
public A withNewEncodingVersion(StringBuilder arg1) {
return (A)withEncodingVersion(new String(arg1));
}
public A withNewEncodingVersion(StringBuffer arg1) {
return (A)withEncodingVersion(new String(arg1));
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
V1alpha1ServerStorageVersionFluentImpl that = (V1alpha1ServerStorageVersionFluentImpl) o;
if (apiServerID != null ? !apiServerID.equals(that.apiServerID) :that.apiServerID != null) return false;
if (decodableVersions != null ? !decodableVersions.equals(that.decodableVersions) :that.decodableVersions != null) return false;
if (encodingVersion != null ? !encodingVersion.equals(that.encodingVersion) :that.encodingVersion != null) return false;
return true;
}
public int hashCode() {
return java.util.Objects.hash(apiServerID, decodableVersions, encodingVersion, super.hashCode());
}
}