annotations.io.alauda.kubernetes.api.model.GlobalParameterBuilder 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 GlobalParameterBuilder extends GlobalParameterFluentImpl implements VisitableBuilder{
GlobalParameterFluent> fluent;
Boolean validationEnabled;
public GlobalParameterBuilder(){
this(true);
}
public GlobalParameterBuilder(Boolean validationEnabled){
this(new GlobalParameter(), validationEnabled);
}
public GlobalParameterBuilder(GlobalParameterFluent> fluent){
this(fluent, true);
}
public GlobalParameterBuilder(GlobalParameterFluent> fluent,Boolean validationEnabled){
this(fluent, new GlobalParameter(), validationEnabled);
}
public GlobalParameterBuilder(GlobalParameterFluent> fluent,GlobalParameter instance){
this(fluent, instance, true);
}
public GlobalParameterBuilder(GlobalParameterFluent> fluent,GlobalParameter instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withDescription(instance.getDescription());
fluent.withName(instance.getName());
this.validationEnabled = validationEnabled;
}
public GlobalParameterBuilder(GlobalParameter instance){
this(instance,true);
}
public GlobalParameterBuilder(GlobalParameter instance,Boolean validationEnabled){
this.fluent = this;
this.withDescription(instance.getDescription());
this.withName(instance.getName());
this.validationEnabled = validationEnabled;
}
public GlobalParameter build(){
GlobalParameter buildable = new GlobalParameter(fluent.getDescription(),fluent.getName());
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;
GlobalParameterBuilder that = (GlobalParameterBuilder) 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;
}
}