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

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

    me.snowdrop.istio.api.model.v1.rbac.SubjectFluent fluent;
    Boolean validationEnabled;

    public SubjectBuilder(){
            this(true);
    }
    public SubjectBuilder(Boolean validationEnabled){
            this(new Subject(), validationEnabled);
    }
    public SubjectBuilder(me.snowdrop.istio.api.model.v1.rbac.SubjectFluent fluent){
            this(fluent, true);
    }
    public SubjectBuilder(me.snowdrop.istio.api.model.v1.rbac.SubjectFluent fluent,Boolean validationEnabled){
            this(fluent, new Subject(), validationEnabled);
    }
    public SubjectBuilder(me.snowdrop.istio.api.model.v1.rbac.SubjectFluent fluent,me.snowdrop.istio.api.model.v1.rbac.Subject instance){
            this(fluent, instance, true);
    }
    public SubjectBuilder(me.snowdrop.istio.api.model.v1.rbac.SubjectFluent fluent,me.snowdrop.istio.api.model.v1.rbac.Subject instance,Boolean validationEnabled){
            this.fluent = fluent; 
            fluent.withGroup(instance.getGroup()); 
            fluent.withProperties(instance.getProperties()); 
            fluent.withUser(instance.getUser()); 
            this.validationEnabled = validationEnabled; 
    }
    public SubjectBuilder(me.snowdrop.istio.api.model.v1.rbac.Subject instance){
            this(instance,true);
    }
    public SubjectBuilder(me.snowdrop.istio.api.model.v1.rbac.Subject instance,Boolean validationEnabled){
            this.fluent = this; 
            this.withGroup(instance.getGroup()); 
            this.withProperties(instance.getProperties()); 
            this.withUser(instance.getUser()); 
            this.validationEnabled = validationEnabled; 
    }

    public me.snowdrop.istio.api.model.v1.rbac.Subject build(){
            Subject buildable = new Subject(fluent.getGroup(),fluent.getProperties(),fluent.getUser());
            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;
            SubjectBuilder that = (SubjectBuilder) 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