annotations.io.alauda.devops.api.model.NamedRoleBindingBuilder Maven / Gradle / Ivy
package io.alauda.devops.api.model;
import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
public class NamedRoleBindingBuilder extends NamedRoleBindingFluentImpl implements VisitableBuilder{
NamedRoleBindingFluent> fluent;
Boolean validationEnabled;
public NamedRoleBindingBuilder(){
this(true);
}
public NamedRoleBindingBuilder(Boolean validationEnabled){
this(new NamedRoleBinding(), validationEnabled);
}
public NamedRoleBindingBuilder(NamedRoleBindingFluent> fluent){
this(fluent, true);
}
public NamedRoleBindingBuilder(NamedRoleBindingFluent> fluent,Boolean validationEnabled){
this(fluent, new NamedRoleBinding(), validationEnabled);
}
public NamedRoleBindingBuilder(NamedRoleBindingFluent> fluent,NamedRoleBinding instance){
this(fluent, instance, true);
}
public NamedRoleBindingBuilder(NamedRoleBindingFluent> fluent,NamedRoleBinding instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withName(instance.getName());
fluent.withRoleBinding(instance.getRoleBinding());
this.validationEnabled = validationEnabled;
}
public NamedRoleBindingBuilder(NamedRoleBinding instance){
this(instance,true);
}
public NamedRoleBindingBuilder(NamedRoleBinding instance,Boolean validationEnabled){
this.fluent = this;
this.withName(instance.getName());
this.withRoleBinding(instance.getRoleBinding());
this.validationEnabled = validationEnabled;
}
public NamedRoleBinding build(){
NamedRoleBinding buildable = new NamedRoleBinding(fluent.getName(),fluent.getRoleBinding());
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;
NamedRoleBindingBuilder that = (NamedRoleBindingBuilder) 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;
}
}