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

io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluentImpl Maven / Gradle / Ivy

There is a newer version: 7.0.1
Show newest version
package io.fabric8.kubernetes.api.model.flowcontrol.v1beta1;

import io.fabric8.kubernetes.api.builder.Nested;
import java.lang.String;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Object;
import java.lang.Boolean;

public class SubjectFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent {

    private io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubjectBuilder group;
    private java.lang.String kind;
    private io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubjectBuilder serviceAccount;
    private io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubjectBuilder user;

    public SubjectFluentImpl() {
    }

    public SubjectFluentImpl(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.Subject instance) {
        this.withGroup(instance.getGroup()); 
        this.withKind(instance.getKind()); 
        this.withServiceAccount(instance.getServiceAccount()); 
        this.withUser(instance.getUser()); 
    }

    
    @java.lang.Deprecated
        
    /**
     * This method has been deprecated, please use method buildGroup instead.
     * @return The buildable object.
     */
        public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubject getGroup() {
        return this.group!=null?this.group.build():null;
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubject buildGroup() {
        return this.group!=null?this.group.build():null;
    }

    public A withGroup(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubject group) {
        _visitables.get("group").remove(this.group);
        if (group!=null){ this.group= new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubjectBuilder(group); _visitables.get("group").add(this.group);} return (A) this;
    }

    public java.lang.Boolean hasGroup() {
        return this.group != null;
    }

    public A withNewGroup(java.lang.String name) {
        return (A)withGroup(new GroupSubject(name));
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.GroupNested withNewGroup() {
        return new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluentImpl.GroupNestedImpl();
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.GroupNested withNewGroupLike(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubject item) {
        return new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluentImpl.GroupNestedImpl(item);
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.GroupNested editGroup() {
        return withNewGroupLike(getGroup());
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.GroupNested editOrNewGroup() {
        return withNewGroupLike(getGroup() != null ? getGroup(): new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubjectBuilder().build());
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.GroupNested editOrNewGroupLike(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubject item) {
        return withNewGroupLike(getGroup() != null ? getGroup(): item);
    }

    public java.lang.String getKind() {
        return this.kind;
    }

    public A withKind(java.lang.String kind) {
        this.kind=kind; return (A) this;
    }

    public java.lang.Boolean hasKind() {
        return this.kind != null;
    }

    
    @java.lang.Deprecated
        
    /**
     * Method is deprecated. use withKind instead.
     */
        public A withNewKind(java.lang.String arg0) {
        return (A)withKind(new String(arg0));
    }

    
    @java.lang.Deprecated
        
    /**
     * This method has been deprecated, please use method buildServiceAccount instead.
     * @return The buildable object.
     */
        public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubject getServiceAccount() {
        return this.serviceAccount!=null?this.serviceAccount.build():null;
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubject buildServiceAccount() {
        return this.serviceAccount!=null?this.serviceAccount.build():null;
    }

    public A withServiceAccount(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubject serviceAccount) {
        _visitables.get("serviceAccount").remove(this.serviceAccount);
        if (serviceAccount!=null){ this.serviceAccount= new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubjectBuilder(serviceAccount); _visitables.get("serviceAccount").add(this.serviceAccount);} return (A) this;
    }

    public java.lang.Boolean hasServiceAccount() {
        return this.serviceAccount != null;
    }

    public A withNewServiceAccount(java.lang.String name,java.lang.String namespace) {
        return (A)withServiceAccount(new ServiceAccountSubject(name, namespace));
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.ServiceAccountNested withNewServiceAccount() {
        return new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluentImpl.ServiceAccountNestedImpl();
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.ServiceAccountNested withNewServiceAccountLike(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubject item) {
        return new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluentImpl.ServiceAccountNestedImpl(item);
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.ServiceAccountNested editServiceAccount() {
        return withNewServiceAccountLike(getServiceAccount());
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.ServiceAccountNested editOrNewServiceAccount() {
        return withNewServiceAccountLike(getServiceAccount() != null ? getServiceAccount(): new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubjectBuilder().build());
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.ServiceAccountNested editOrNewServiceAccountLike(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubject item) {
        return withNewServiceAccountLike(getServiceAccount() != null ? getServiceAccount(): item);
    }

    
    @java.lang.Deprecated
        
    /**
     * This method has been deprecated, please use method buildUser instead.
     * @return The buildable object.
     */
        public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubject getUser() {
        return this.user!=null?this.user.build():null;
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubject buildUser() {
        return this.user!=null?this.user.build():null;
    }

    public A withUser(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubject user) {
        _visitables.get("user").remove(this.user);
        if (user!=null){ this.user= new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubjectBuilder(user); _visitables.get("user").add(this.user);} return (A) this;
    }

    public java.lang.Boolean hasUser() {
        return this.user != null;
    }

    public A withNewUser(java.lang.String name) {
        return (A)withUser(new UserSubject(name));
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.UserNested withNewUser() {
        return new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluentImpl.UserNestedImpl();
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.UserNested withNewUserLike(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubject item) {
        return new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluentImpl.UserNestedImpl(item);
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.UserNested editUser() {
        return withNewUserLike(getUser());
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.UserNested editOrNewUser() {
        return withNewUserLike(getUser() != null ? getUser(): new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubjectBuilder().build());
    }

    public io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.UserNested editOrNewUserLike(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubject item) {
        return withNewUserLike(getUser() != null ? getUser(): item);
    }

    public boolean equals(java.lang.Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SubjectFluentImpl that = (SubjectFluentImpl) o;
        if (group != null ? !group.equals(that.group) :that.group != null) return false;
        if (kind != null ? !kind.equals(that.kind) :that.kind != null) return false;
        if (serviceAccount != null ? !serviceAccount.equals(that.serviceAccount) :that.serviceAccount != null) return false;
        if (user != null ? !user.equals(that.user) :that.user != null) return false;
        return true;
    }

    public int hashCode() {
        return java.util.Objects.hash(group,  kind,  serviceAccount,  user,  super.hashCode());
    }

    public class GroupNestedImpl extends io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubjectFluentImpl> implements io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.GroupNested,io.fabric8.kubernetes.api.builder.Nested {
        private final io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubjectBuilder builder;

            GroupNestedImpl(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubject item) {
                this.builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubjectBuilder(this, item);
                        
            }

            GroupNestedImpl() {
                this.builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubjectBuilder(this);
                        
            }

            public N and() {
                return (N) SubjectFluentImpl.this.withGroup(builder.build());
            }

            public N endGroup() {
                return and();
            }
    }


    public class ServiceAccountNestedImpl extends io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubjectFluentImpl> implements io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.ServiceAccountNested,io.fabric8.kubernetes.api.builder.Nested {
        private final io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubjectBuilder builder;

            ServiceAccountNestedImpl(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubject item) {
                this.builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubjectBuilder(this, item);
                        
            }

            ServiceAccountNestedImpl() {
                this.builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubjectBuilder(this);
                        
            }

            public N and() {
                return (N) SubjectFluentImpl.this.withServiceAccount(builder.build());
            }

            public N endServiceAccount() {
                return and();
            }
    }


    public class UserNestedImpl extends io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubjectFluentImpl> implements io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent.UserNested,io.fabric8.kubernetes.api.builder.Nested {
        private final io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubjectBuilder builder;

            UserNestedImpl(io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubject item) {
                this.builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubjectBuilder(this, item);
                        
            }

            UserNestedImpl() {
                this.builder = new io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubjectBuilder(this);
                        
            }

            public N and() {
                return (N) SubjectFluentImpl.this.withUser(builder.build());
            }

            public N endUser() {
                return and();
            }
    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy