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.util.LinkedHashMap;
import java.lang.Deprecated;
import io.fabric8.kubernetes.api.builder.BaseFluent;
import java.lang.Boolean;
import java.lang.Object;
import java.util.Map;

 /**
  * Generated
  */
public class SubjectFluentImpl> extends io.fabric8.kubernetes.api.builder.BaseFluent implements io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.SubjectFluent{
  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()); 
    this.withAdditionalProperties(instance.getAdditionalProperties());

  }
  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;
  private java.util.Map additionalProperties;
  
  /**
   * This method has been deprecated, please use method buildGroup instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  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;
  }
  
  /**
   * Method is deprecated. use withKind instead.
   */
  @java.lang.Deprecated
  public A withNewKind(java.lang.String arg0) {
    return (A)withKind(new String(arg0));
  }
  
  /**
   * This method has been deprecated, please use method buildServiceAccount instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  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);
  }
  
  /**
   * This method has been deprecated, please use method buildUser instead.
   * @return The buildable object.
   */
  @java.lang.Deprecated
  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 A addToAdditionalProperties(java.lang.String key,java.lang.Object value) {
    if(this.additionalProperties == null && key != null && value != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
    if(key != null && value != null) {this.additionalProperties.put(key, value);} return (A)this;
  }
  public A addToAdditionalProperties(java.util.Map map) {
    if(this.additionalProperties == null && map != null) { this.additionalProperties = new java.util.LinkedHashMap(); }
    if(map != null) { this.additionalProperties.putAll(map);} return (A)this;
  }
  public A removeFromAdditionalProperties(java.lang.String key) {
    if(this.additionalProperties == null) { return (A) this; }
    if(key != null && this.additionalProperties != null) {this.additionalProperties.remove(key);} return (A)this;
  }
  public A removeFromAdditionalProperties(java.util.Map map) {
    if(this.additionalProperties == null) { return (A) this; }
    if(map != null) { for(Object key : map.keySet()) {if (this.additionalProperties != null){this.additionalProperties.remove(key);}}} return (A)this;
  }
  public java.util.Map getAdditionalProperties() {
    return this.additionalProperties;
  }
  public A withAdditionalProperties(java.util.Map additionalProperties) {
    if (additionalProperties == null) { this.additionalProperties =  null;} else {this.additionalProperties = new java.util.LinkedHashMap(additionalProperties);} return (A) this;
  }
  public java.lang.Boolean hasAdditionalProperties() {
    return this.additionalProperties != null;
  }
  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;
    if (additionalProperties != null ? !additionalProperties.equals(that.additionalProperties) :that.additionalProperties != null) return false;
    return true;
  }
  public int hashCode() {
    return java.util.Objects.hash(group,  kind,  serviceAccount,  user,  additionalProperties,  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{
    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);
    }
    io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.GroupSubjectBuilder builder;
    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{
    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);
    }
    io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.ServiceAccountSubjectBuilder builder;
    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{
    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);
    }
    io.fabric8.kubernetes.api.model.flowcontrol.v1beta1.UserSubjectBuilder builder;
    public N and() {
      return (N) SubjectFluentImpl.this.withUser(builder.build());
    }
    public N endUser() {
      return and();
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy