annotations.io.alauda.kubernetes.api.model.CapabilitiesBuilder 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 CapabilitiesBuilder extends CapabilitiesFluentImpl implements VisitableBuilder{
CapabilitiesFluent> fluent;
Boolean validationEnabled;
public CapabilitiesBuilder(){
this(true);
}
public CapabilitiesBuilder(Boolean validationEnabled){
this(new Capabilities(), validationEnabled);
}
public CapabilitiesBuilder(CapabilitiesFluent> fluent){
this(fluent, true);
}
public CapabilitiesBuilder(CapabilitiesFluent> fluent,Boolean validationEnabled){
this(fluent, new Capabilities(), validationEnabled);
}
public CapabilitiesBuilder(CapabilitiesFluent> fluent,Capabilities instance){
this(fluent, instance, true);
}
public CapabilitiesBuilder(CapabilitiesFluent> fluent,Capabilities instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withAdd(instance.getAdd());
fluent.withDrop(instance.getDrop());
this.validationEnabled = validationEnabled;
}
public CapabilitiesBuilder(Capabilities instance){
this(instance,true);
}
public CapabilitiesBuilder(Capabilities instance,Boolean validationEnabled){
this.fluent = this;
this.withAdd(instance.getAdd());
this.withDrop(instance.getDrop());
this.validationEnabled = validationEnabled;
}
public Capabilities build(){
Capabilities buildable = new Capabilities(fluent.getAdd(),fluent.getDrop());
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;
CapabilitiesBuilder that = (CapabilitiesBuilder) 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;
}
}