io.fabric8.kubernetes.api.model.HostAliasFluentImpl Maven / Gradle / Ivy
package io.fabric8.kubernetes.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.lang.StringBuilder;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.ArrayList;
import java.lang.String;
import io.fabric8.kubernetes.api.builder.Predicate;
import java.lang.StringBuffer;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.util.Collection;
import java.lang.Object;
import java.util.List;
import java.lang.Boolean;
public class HostAliasFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements HostAliasFluent{
private List hostnames = new ArrayList();
private String ip;
public HostAliasFluentImpl(){
}
public HostAliasFluentImpl(HostAlias instance){
this.withHostnames(instance.getHostnames());
this.withIp(instance.getIp());
}
public A addToHostnames(int index,String item){
if (this.hostnames == null) {this.hostnames = new ArrayList();}
this.hostnames.add(index, item);
return (A)this;
}
public A setToHostnames(int index,String item){
if (this.hostnames == null) {this.hostnames = new ArrayList();}
this.hostnames.set(index, item); return (A)this;
}
public A addToHostnames(String... items){
if (this.hostnames == null) {this.hostnames = new ArrayList();}
for (String item : items) {this.hostnames.add(item);} return (A)this;
}
public A addAllToHostnames(Collection items){
if (this.hostnames == null) {this.hostnames = new ArrayList();}
for (String item : items) {this.hostnames.add(item);} return (A)this;
}
public A removeFromHostnames(String... items){
for (String item : items) {if (this.hostnames!= null){ this.hostnames.remove(item);}} return (A)this;
}
public A removeAllFromHostnames(Collection items){
for (String item : items) {if (this.hostnames!= null){ this.hostnames.remove(item);}} return (A)this;
}
public List getHostnames(){
return this.hostnames;
}
public String getHostname(int index){
return this.hostnames.get(index);
}
public String getFirstHostname(){
return this.hostnames.get(0);
}
public String getLastHostname(){
return this.hostnames.get(hostnames.size() - 1);
}
public String getMatchingHostname(io.fabric8.kubernetes.api.builder.Predicate predicate){
for (String item: hostnames) { if(predicate.apply(item)){ return item;} } return null;
}
public Boolean hasMatchingHostname(io.fabric8.kubernetes.api.builder.Predicate predicate){
for (String item: hostnames) { if(predicate.apply(item)){ return true;} } return false;
}
public A withHostnames(List hostnames){
if (this.hostnames != null) { _visitables.get("hostnames").removeAll(this.hostnames);}
if (hostnames != null) {this.hostnames = new ArrayList(); for (String item : hostnames){this.addToHostnames(item);}} else { this.hostnames = null;} return (A) this;
}
public A withHostnames(String... hostnames){
if (this.hostnames != null) {this.hostnames.clear();}
if (hostnames != null) {for (String item :hostnames){ this.addToHostnames(item);}} return (A) this;
}
public Boolean hasHostnames(){
return hostnames != null && !hostnames.isEmpty();
}
public A addNewHostname(String arg1){
return (A)addToHostnames(new String(arg1));
}
public A addNewHostname(StringBuilder arg1){
return (A)addToHostnames(new String(arg1));
}
public A addNewHostname(StringBuffer arg1){
return (A)addToHostnames(new String(arg1));
}
public String getIp(){
return this.ip;
}
public A withIp(String ip){
this.ip=ip; return (A) this;
}
public Boolean hasIp(){
return this.ip != null;
}
public A withNewIp(String arg1){
return (A)withIp(new String(arg1));
}
public A withNewIp(StringBuilder arg1){
return (A)withIp(new String(arg1));
}
public A withNewIp(StringBuffer arg1){
return (A)withIp(new String(arg1));
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
HostAliasFluentImpl that = (HostAliasFluentImpl) o;
if (hostnames != null ? !hostnames.equals(that.hostnames) :that.hostnames != null) return false;
if (ip != null ? !ip.equals(that.ip) :that.ip != null) return false;
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy