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

annotations.me.snowdrop.applicationcrd.api.model.ApplicationBuilder 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 ApplicationBuilder extends ApplicationFluentImpl implements VisitableBuilder{

    ApplicationFluent fluent;
    Boolean validationEnabled;
    Validator validator;

    public ApplicationBuilder(){
            this(true);
    }
    public ApplicationBuilder(Boolean validationEnabled){
            this(new Application(), validationEnabled);
    }
    public ApplicationBuilder(ApplicationFluent fluent){
            this(fluent, true);
    }
    public ApplicationBuilder(ApplicationFluent fluent,Boolean validationEnabled){
            this(fluent, new Application(), validationEnabled);
    }
    public ApplicationBuilder(ApplicationFluent fluent,Application instance){
            this(fluent, instance, true);
    }
    public ApplicationBuilder(ApplicationFluent fluent,Application instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withApiVersion(instance.getApiVersion()); 
            fluent.withKind(instance.getKind()); 
            fluent.withMetadata(instance.getMetadata()); 
            fluent.withSpec(instance.getSpec()); 
            fluent.withStatus(instance.getStatus()); 
            this.validationEnabled = validationEnabled; 
    }
    public ApplicationBuilder(Application instance){
            this(instance,true);
    }
    public ApplicationBuilder(Application instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withApiVersion(instance.getApiVersion()); 
            this.withKind(instance.getKind()); 
            this.withMetadata(instance.getMetadata()); 
            this.withSpec(instance.getSpec()); 
            this.withStatus(instance.getStatus()); 
            this.validationEnabled = validationEnabled; 
    }
    public ApplicationBuilder(Validator validator){
            this(new Application(), true);
    }
    public ApplicationBuilder(ApplicationFluent fluent,Application instance,Validator validator){
            this.fluent = fluent; 
            fluent.withApiVersion(instance.getApiVersion()); 
            fluent.withKind(instance.getKind()); 
            fluent.withMetadata(instance.getMetadata()); 
            fluent.withSpec(instance.getSpec()); 
            fluent.withStatus(instance.getStatus()); 
            this.validator = validator;
            this.validationEnabled = validator != null; 
    }
    public ApplicationBuilder(Application instance,Validator validator){
            this.fluent = this; 
            this.withApiVersion(instance.getApiVersion()); 
            this.withKind(instance.getKind()); 
            this.withMetadata(instance.getMetadata()); 
            this.withSpec(instance.getSpec()); 
            this.withStatus(instance.getStatus()); 
            this.validator = validator; 
            this.validationEnabled = validator != null; 
    }

    public Application build(){
            Application buildable = new Application(fluent.getApiVersion(),fluent.getKind(),fluent.getMetadata(),fluent.getSpec(),fluent.getStatus());
            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;
            ApplicationBuilder that = (ApplicationBuilder) 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