io.alauda.kubernetes.api.model.HostPortBuilder Maven / Gradle / Ivy
package io.alauda.kubernetes.api.model;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class HostPortBuilder extends HostPortFluentImpl implements VisitableBuilder{
HostPortFluent> fluent;
Boolean validationEnabled;
public HostPortBuilder(){
this(true);
}
public HostPortBuilder(Boolean validationEnabled){
this(new HostPort(), validationEnabled);
}
public HostPortBuilder(HostPortFluent> fluent){
this(fluent, true);
}
public HostPortBuilder(HostPortFluent> fluent,Boolean validationEnabled){
this(fluent, new HostPort(), validationEnabled);
}
public HostPortBuilder(HostPortFluent> fluent,HostPort instance){
this(fluent, instance, true);
}
public HostPortBuilder(HostPortFluent> fluent,HostPort instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withHost(instance.getHost());
this.validationEnabled = validationEnabled;
}
public HostPortBuilder(HostPort instance){
this(instance,true);
}
public HostPortBuilder(HostPort instance,Boolean validationEnabled){
this.fluent = this;
this.withHost(instance.getHost());
this.validationEnabled = validationEnabled;
}
public HostPort build(){
HostPort buildable = new HostPort(fluent.getHost());
io.alauda.kubernetes.api.builder.ValidationUtils.validate(buildable);
return buildable;
}
public boolean equals(Object o){
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
HostPortBuilder that = (HostPortBuilder) o;
if (fluent != null &&fluent != this ? !fluent.equals(that.fluent) :that.fluent != null &&fluent != this ) return false;
if (validationEnabled != null ? !validationEnabled.equals(that.validationEnabled) :that.validationEnabled != null) return false;
return true;
}
}