io.alauda.devops.api.model.RoleBindingRestrictionBuilder 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 RoleBindingRestrictionBuilder extends RoleBindingRestrictionFluentImpl implements VisitableBuilder{
RoleBindingRestrictionFluent> fluent;
Boolean validationEnabled;
public RoleBindingRestrictionBuilder(){
this(true);
}
public RoleBindingRestrictionBuilder(Boolean validationEnabled){
this(new RoleBindingRestriction(), validationEnabled);
}
public RoleBindingRestrictionBuilder(RoleBindingRestrictionFluent> fluent){
this(fluent, true);
}
public RoleBindingRestrictionBuilder(RoleBindingRestrictionFluent> fluent,Boolean validationEnabled){
this(fluent, new RoleBindingRestriction(), validationEnabled);
}
public RoleBindingRestrictionBuilder(RoleBindingRestrictionFluent> fluent,RoleBindingRestriction instance){
this(fluent, instance, true);
}
public RoleBindingRestrictionBuilder(RoleBindingRestrictionFluent> fluent,RoleBindingRestriction instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withApiVersion(instance.getApiVersion());
fluent.withKind(instance.getKind());
fluent.withMetadata(instance.getMetadata());
fluent.withSpec(instance.getSpec());
this.validationEnabled = validationEnabled;
}
public RoleBindingRestrictionBuilder(RoleBindingRestriction instance){
this(instance,true);
}
public RoleBindingRestrictionBuilder(RoleBindingRestriction instance,Boolean validationEnabled){
this.fluent = this;
this.withApiVersion(instance.getApiVersion());
this.withKind(instance.getKind());
this.withMetadata(instance.getMetadata());
this.withSpec(instance.getSpec());
this.validationEnabled = validationEnabled;
}
public RoleBindingRestriction build(){
RoleBindingRestriction buildable = new RoleBindingRestriction(fluent.getApiVersion(),fluent.getKind(),fluent.getMetadata(),fluent.getSpec());
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;
RoleBindingRestrictionBuilder that = (RoleBindingRestrictionBuilder) 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;
}
}