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

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

    ContactDataFluent fluent;
    Boolean validationEnabled;
    Validator validator;

    public ContactDataBuilder(){
            this(true);
    }
    public ContactDataBuilder(Boolean validationEnabled){
            this(new ContactData(), validationEnabled);
    }
    public ContactDataBuilder(ContactDataFluent fluent){
            this(fluent, true);
    }
    public ContactDataBuilder(ContactDataFluent fluent,Boolean validationEnabled){
            this(fluent, new ContactData(), validationEnabled);
    }
    public ContactDataBuilder(ContactDataFluent fluent,ContactData instance){
            this(fluent, instance, true);
    }
    public ContactDataBuilder(ContactDataFluent fluent,ContactData instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withEmail(instance.getEmail()); 
            fluent.withName(instance.getName()); 
            fluent.withUrl(instance.getUrl()); 
            this.validationEnabled = validationEnabled; 
    }
    public ContactDataBuilder(ContactData instance){
            this(instance,true);
    }
    public ContactDataBuilder(ContactData instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withEmail(instance.getEmail()); 
            this.withName(instance.getName()); 
            this.withUrl(instance.getUrl()); 
            this.validationEnabled = validationEnabled; 
    }
    public ContactDataBuilder(Validator validator){
            this(new ContactData(), true);
    }
    public ContactDataBuilder(ContactDataFluent fluent,ContactData instance,Validator validator){
            this.fluent = fluent; 
            fluent.withEmail(instance.getEmail()); 
            fluent.withName(instance.getName()); 
            fluent.withUrl(instance.getUrl()); 
            this.validator = validator;
            this.validationEnabled = validator != null; 
    }
    public ContactDataBuilder(ContactData instance,Validator validator){
            this.fluent = this; 
            this.withEmail(instance.getEmail()); 
            this.withName(instance.getName()); 
            this.withUrl(instance.getUrl()); 
            this.validator = validator; 
            this.validationEnabled = validator != null; 
    }

    public ContactData build(){
            ContactData buildable = new ContactData(fluent.getEmail(),fluent.getName(),fluent.getUrl());
            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;
            ContactDataBuilder that = (ContactDataBuilder) 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