All Downloads are FREE. Search and download functionalities are using the official Maven repository.

annotations.me.snowdrop.applicationcrd.api.model.ImageSpecBuilder Maven / Gradle / Ivy

package me.snowdrop.applicationcrd.api.model;

import io.fabric8.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;
import javax.validation.Validator;

public class ImageSpecBuilder extends ImageSpecFluentImpl implements VisitableBuilder{

    ImageSpecFluent fluent;
    Boolean validationEnabled;
    Validator validator;

    public ImageSpecBuilder(){
            this(true);
    }
    public ImageSpecBuilder(Boolean validationEnabled){
            this(new ImageSpec(), validationEnabled);
    }
    public ImageSpecBuilder(ImageSpecFluent fluent){
            this(fluent, true);
    }
    public ImageSpecBuilder(ImageSpecFluent fluent,Boolean validationEnabled){
            this(fluent, new ImageSpec(), validationEnabled);
    }
    public ImageSpecBuilder(ImageSpecFluent fluent,ImageSpec instance){
            this(fluent, instance, true);
    }
    public ImageSpecBuilder(ImageSpecFluent fluent,ImageSpec instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withSize(instance.getSize()); 
            fluent.withSrc(instance.getSrc()); 
            fluent.withType(instance.getType()); 
            this.validationEnabled = validationEnabled; 
    }
    public ImageSpecBuilder(ImageSpec instance){
            this(instance,true);
    }
    public ImageSpecBuilder(ImageSpec instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withSize(instance.getSize()); 
            this.withSrc(instance.getSrc()); 
            this.withType(instance.getType()); 
            this.validationEnabled = validationEnabled; 
    }
    public ImageSpecBuilder(Validator validator){
            this(new ImageSpec(), true);
    }
    public ImageSpecBuilder(ImageSpecFluent fluent,ImageSpec instance,Validator validator){
            this.fluent = fluent; 
            fluent.withSize(instance.getSize()); 
            fluent.withSrc(instance.getSrc()); 
            fluent.withType(instance.getType()); 
            this.validator = validator;
            this.validationEnabled = validator != null; 
    }
    public ImageSpecBuilder(ImageSpec instance,Validator validator){
            this.fluent = this; 
            this.withSize(instance.getSize()); 
            this.withSrc(instance.getSrc()); 
            this.withType(instance.getType()); 
            this.validator = validator; 
            this.validationEnabled = validator != null; 
    }

    public ImageSpec build(){
            ImageSpec buildable = new ImageSpec(fluent.getSize(),fluent.getSrc(),fluent.getType());
            if (validationEnabled) {io.fabric8.kubernetes.api.builder.ValidationUtils.validate(buildable, validator);}
            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;
            ImageSpecBuilder that = (ImageSpecBuilder) 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;
    }




}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy