io.alauda.kubernetes.api.model.VolumeMountBuilder 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 VolumeMountBuilder extends VolumeMountFluentImpl implements VisitableBuilder{
VolumeMountFluent> fluent;
Boolean validationEnabled;
public VolumeMountBuilder(){
this(true);
}
public VolumeMountBuilder(Boolean validationEnabled){
this(new VolumeMount(), validationEnabled);
}
public VolumeMountBuilder(VolumeMountFluent> fluent){
this(fluent, true);
}
public VolumeMountBuilder(VolumeMountFluent> fluent,Boolean validationEnabled){
this(fluent, new VolumeMount(), validationEnabled);
}
public VolumeMountBuilder(VolumeMountFluent> fluent,VolumeMount instance){
this(fluent, instance, true);
}
public VolumeMountBuilder(VolumeMountFluent> fluent,VolumeMount instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withMountPath(instance.getMountPath());
fluent.withName(instance.getName());
fluent.withReadOnly(instance.getReadOnly());
fluent.withSubPath(instance.getSubPath());
this.validationEnabled = validationEnabled;
}
public VolumeMountBuilder(VolumeMount instance){
this(instance,true);
}
public VolumeMountBuilder(VolumeMount instance,Boolean validationEnabled){
this.fluent = this;
this.withMountPath(instance.getMountPath());
this.withName(instance.getName());
this.withReadOnly(instance.getReadOnly());
this.withSubPath(instance.getSubPath());
this.validationEnabled = validationEnabled;
}
public VolumeMount build(){
VolumeMount buildable = new VolumeMount(fluent.getMountPath(),fluent.getName(),fluent.isReadOnly(),fluent.getSubPath());
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;
VolumeMountBuilder that = (VolumeMountBuilder) 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;
}
}