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

io.alauda.kubernetes.api.model.ResourceFieldSelectorBuilder Maven / Gradle / Ivy

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

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

public class ResourceFieldSelectorBuilder extends ResourceFieldSelectorFluentImpl implements VisitableBuilder{

    ResourceFieldSelectorFluent fluent;
    Boolean validationEnabled;

    public ResourceFieldSelectorBuilder(){
            this(true);
    }
    public ResourceFieldSelectorBuilder(Boolean validationEnabled){
            this(new ResourceFieldSelector(), validationEnabled);
    }
    public ResourceFieldSelectorBuilder(ResourceFieldSelectorFluent fluent){
            this(fluent, true);
    }
    public ResourceFieldSelectorBuilder(ResourceFieldSelectorFluent fluent,Boolean validationEnabled){
            this(fluent, new ResourceFieldSelector(), validationEnabled);
    }
    public ResourceFieldSelectorBuilder(ResourceFieldSelectorFluent fluent,ResourceFieldSelector instance){
            this(fluent, instance, true);
    }
    public ResourceFieldSelectorBuilder(ResourceFieldSelectorFluent fluent,ResourceFieldSelector instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withContainerName(instance.getContainerName()); 
            fluent.withDivisor(instance.getDivisor()); 
            fluent.withResource(instance.getResource()); 
            this.validationEnabled = validationEnabled; 
    }
    public ResourceFieldSelectorBuilder(ResourceFieldSelector instance){
            this(instance,true);
    }
    public ResourceFieldSelectorBuilder(ResourceFieldSelector instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withContainerName(instance.getContainerName()); 
            this.withDivisor(instance.getDivisor()); 
            this.withResource(instance.getResource()); 
            this.validationEnabled = validationEnabled; 
    }

    public ResourceFieldSelector build(){
            ResourceFieldSelector buildable = new ResourceFieldSelector(fluent.getContainerName(),fluent.getDivisor(),fluent.getResource());
            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;
            ResourceFieldSelectorBuilder that = (ResourceFieldSelectorBuilder) 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