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

me.snowdrop.istio.api.model.v1.rbac.ConstraintBuilder Maven / Gradle / Ivy

package me.snowdrop.istio.api.model.v1.rbac;

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

public class ConstraintBuilder extends ConstraintFluentImpl implements VisitableBuilder{

    ConstraintFluent fluent;
    Boolean validationEnabled;

    public ConstraintBuilder(){
            this(true);
    }
    public ConstraintBuilder(Boolean validationEnabled){
            this(new Constraint(), validationEnabled);
    }
    public ConstraintBuilder(ConstraintFluent fluent){
            this(fluent, true);
    }
    public ConstraintBuilder(ConstraintFluent fluent,Boolean validationEnabled){
            this(fluent, new Constraint(), validationEnabled);
    }
    public ConstraintBuilder(ConstraintFluent fluent,Constraint instance){
            this(fluent, instance, true);
    }
    public ConstraintBuilder(ConstraintFluent fluent,Constraint instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withKey(instance.getKey()); 
            fluent.withValues(instance.getValues()); 
            this.validationEnabled = validationEnabled; 
    }
    public ConstraintBuilder(Constraint instance){
            this(instance,true);
    }
    public ConstraintBuilder(Constraint instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withKey(instance.getKey()); 
            this.withValues(instance.getValues()); 
            this.validationEnabled = validationEnabled; 
    }

    public Constraint build(){
            Constraint buildable = new Constraint(fluent.getKey(),fluent.getValues());
            io.fabric8.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;
            ConstraintBuilder that = (ConstraintBuilder) 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