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

annotations.io.alauda.devops.api.model.ParameterBuilder Maven / Gradle / Ivy

There is a newer version: 0.2.12
Show newest version
package io.alauda.devops.api.model;

import io.alauda.kubernetes.api.builder.VisitableBuilder;
import java.lang.Object;
import java.lang.Boolean;

public class ParameterBuilder extends ParameterFluentImpl implements VisitableBuilder{

    ParameterFluent fluent;
    Boolean validationEnabled;

    public ParameterBuilder(){
            this(true);
    }
    public ParameterBuilder(Boolean validationEnabled){
            this(new Parameter(), validationEnabled);
    }
    public ParameterBuilder(ParameterFluent fluent){
            this(fluent, true);
    }
    public ParameterBuilder(ParameterFluent fluent,Boolean validationEnabled){
            this(fluent, new Parameter(), validationEnabled);
    }
    public ParameterBuilder(ParameterFluent fluent,Parameter instance){
            this(fluent, instance, true);
    }
    public ParameterBuilder(ParameterFluent fluent,Parameter instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withDescription(instance.getDescription()); 
            fluent.withDisplayName(instance.getDisplayName()); 
            fluent.withFrom(instance.getFrom()); 
            fluent.withGenerate(instance.getGenerate()); 
            fluent.withName(instance.getName()); 
            fluent.withRequired(instance.getRequired()); 
            fluent.withValue(instance.getValue()); 
            this.validationEnabled = validationEnabled; 
    }
    public ParameterBuilder(Parameter instance){
            this(instance,true);
    }
    public ParameterBuilder(Parameter instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withDescription(instance.getDescription()); 
            this.withDisplayName(instance.getDisplayName()); 
            this.withFrom(instance.getFrom()); 
            this.withGenerate(instance.getGenerate()); 
            this.withName(instance.getName()); 
            this.withRequired(instance.getRequired()); 
            this.withValue(instance.getValue()); 
            this.validationEnabled = validationEnabled; 
    }

    public Parameter build(){
            Parameter buildable = new Parameter(fluent.getDescription(),fluent.getDisplayName(),fluent.getFrom(),fluent.getGenerate(),fluent.getName(),fluent.isRequired(),fluent.getValue());
            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;
            ParameterBuilder that = (ParameterBuilder) 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 - 2025 Weber Informatics LLC | Privacy Policy