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

annotations.me.snowdrop.istio.api.model.v1.rbac.AccessRuleBuilder 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 AccessRuleBuilder extends AccessRuleFluentImpl implements VisitableBuilder{

    AccessRuleFluent fluent;
    Boolean validationEnabled;

    public AccessRuleBuilder(){
            this(true);
    }
    public AccessRuleBuilder(Boolean validationEnabled){
            this(new AccessRule(), validationEnabled);
    }
    public AccessRuleBuilder(AccessRuleFluent fluent){
            this(fluent, true);
    }
    public AccessRuleBuilder(AccessRuleFluent fluent,Boolean validationEnabled){
            this(fluent, new AccessRule(), validationEnabled);
    }
    public AccessRuleBuilder(AccessRuleFluent fluent,AccessRule instance){
            this(fluent, instance, true);
    }
    public AccessRuleBuilder(AccessRuleFluent fluent,AccessRule instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withConstraints(instance.getConstraints()); 
            fluent.withMethods(instance.getMethods()); 
            fluent.withPaths(instance.getPaths()); 
            fluent.withServices(instance.getServices()); 
            this.validationEnabled = validationEnabled; 
    }
    public AccessRuleBuilder(AccessRule instance){
            this(instance,true);
    }
    public AccessRuleBuilder(AccessRule instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withConstraints(instance.getConstraints()); 
            this.withMethods(instance.getMethods()); 
            this.withPaths(instance.getPaths()); 
            this.withServices(instance.getServices()); 
            this.validationEnabled = validationEnabled; 
    }

    public AccessRule build(){
            AccessRule buildable = new AccessRule(fluent.getConstraints(),fluent.getMethods(),fluent.getPaths(),fluent.getServices());
            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;
            AccessRuleBuilder that = (AccessRuleBuilder) 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