annotations.io.alauda.kubernetes.api.model.PersistentVolumeClaimVolumeSourceBuilder 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 PersistentVolumeClaimVolumeSourceBuilder extends PersistentVolumeClaimVolumeSourceFluentImpl implements VisitableBuilder{
PersistentVolumeClaimVolumeSourceFluent> fluent;
Boolean validationEnabled;
public PersistentVolumeClaimVolumeSourceBuilder(){
this(true);
}
public PersistentVolumeClaimVolumeSourceBuilder(Boolean validationEnabled){
this(new PersistentVolumeClaimVolumeSource(), validationEnabled);
}
public PersistentVolumeClaimVolumeSourceBuilder(PersistentVolumeClaimVolumeSourceFluent> fluent){
this(fluent, true);
}
public PersistentVolumeClaimVolumeSourceBuilder(PersistentVolumeClaimVolumeSourceFluent> fluent,Boolean validationEnabled){
this(fluent, new PersistentVolumeClaimVolumeSource(), validationEnabled);
}
public PersistentVolumeClaimVolumeSourceBuilder(PersistentVolumeClaimVolumeSourceFluent> fluent,PersistentVolumeClaimVolumeSource instance){
this(fluent, instance, true);
}
public PersistentVolumeClaimVolumeSourceBuilder(PersistentVolumeClaimVolumeSourceFluent> fluent,PersistentVolumeClaimVolumeSource instance,Boolean validationEnabled){
this.fluent = fluent;
fluent.withClaimName(instance.getClaimName());
fluent.withReadOnly(instance.getReadOnly());
this.validationEnabled = validationEnabled;
}
public PersistentVolumeClaimVolumeSourceBuilder(PersistentVolumeClaimVolumeSource instance){
this(instance,true);
}
public PersistentVolumeClaimVolumeSourceBuilder(PersistentVolumeClaimVolumeSource instance,Boolean validationEnabled){
this.fluent = this;
this.withClaimName(instance.getClaimName());
this.withReadOnly(instance.getReadOnly());
this.validationEnabled = validationEnabled;
}
public PersistentVolumeClaimVolumeSource build(){
PersistentVolumeClaimVolumeSource buildable = new PersistentVolumeClaimVolumeSource(fluent.getClaimName(),fluent.isReadOnly());
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;
PersistentVolumeClaimVolumeSourceBuilder that = (PersistentVolumeClaimVolumeSourceBuilder) 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;
}
}